summaryrefslogtreecommitdiffstats
path: root/ConfigureChecks.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'ConfigureChecks.cmake')
-rw-r--r--ConfigureChecks.cmake160
1 files changed, 92 insertions, 68 deletions
diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake
index cfb6a8d7..67500f42 100644
--- a/ConfigureChecks.cmake
+++ b/ConfigureChecks.cmake
@@ -59,95 +59,99 @@ if( WITH_GNOKII AND (BUILD_KADDRESSBOOK OR BUILD_KMOBILE) )
pkg_search_module( GNOKII gnokii )
if( NOT GNOKII_FOUND )
tde_message_fatal( "gnokii are requested, but was not found on your system" )
+ else( )
+ tde_save_and_set( CMAKE_REQUIRED_INCLUDES "${GNOKII_INCLUDE_DIRS}" )
+ check_include_file( "gnokii.h" HAVE_GNOKII_H )
+ tde_restore( CMAKE_REQUIRED_INCLUDES )
endif( )
endif( )
-if( BUILD_LIBTDENETWORK OR BUILD_CERTMANAGER OR BUILD_KMAIL OR BUILD_KADDRESSBOOK OR BUILD_KONTACT )
+if( (BUILD_LIBTDENETWORK OR BUILD_CERTMANAGER OR BUILD_KMAIL OR BUILD_KADDRESSBOOK OR BUILD_KONTACT) AND NOT HAVE_GPGME_0_4_BRANCH )
- if( NOT HAVE_GPGME_0_4_BRANCH )
- message( STATUS "checking for 'gpgme'" )
- endif( )
+ message( STATUS "checking for 'gpgme'" )
- # find gpgme-config
- find_program( GPGME_EXECUTABLE NAMES gpgme-config )
- if( NOT GPGME_EXECUTABLE )
- tde_message_fatal( "gpgme-config was NOT found.\n gpgme library is installed?" )
- endif( )
+ # check for gpgme
+ pkg_search_module( GPGME gpgme )
+ if( NOT GPGME_FOUND )
- # find gpg-error-config
- find_program( GPG_ERR_EXECUTABLE NAMES gpg-error-config )
- if( NOT GPG_ERR_EXECUTABLE )
- tde_message_fatal( "gpg-error-config was NOT found.\n gpg-error library is installed?" )
- endif( )
+ # find gpgme-config
+ find_program( GPGME_EXECUTABLE NAMES gpgme-config )
+ if( NOT GPGME_EXECUTABLE )
+ tde_message_fatal( "gpgme-config was NOT found.\n gpgme library is installed?" )
+ endif( )
- macro( __run_gpgme_config __type __var )
- execute_process(
- COMMAND ${GPGME_EXECUTABLE} --${__type}
- OUTPUT_VARIABLE ${__var}
- RESULT_VARIABLE __result
- OUTPUT_STRIP_TRAILING_WHITESPACE )
- if( _result )
- tde_message_fatal( "Unable to run ${GPGME_EXECUTABLE}!\n gpgme library incorrectly installed?\n Path to gpgme-config incorrect?" )
+ macro( __run_gpgme_config __type __var )
+ execute_process(
+ COMMAND ${GPGME_EXECUTABLE} --${__type}
+ OUTPUT_VARIABLE ${__var}
+ RESULT_VARIABLE __result
+ OUTPUT_STRIP_TRAILING_WHITESPACE )
+ if( _result )
+ tde_message_fatal( "Unable to run ${GPGME_EXECUTABLE}!\n gpgme library incorrectly installed?\n Path to gpgme-config incorrect?" )
+ endif( )
+ endmacro( )
+
+ __run_gpgme_config( version GPGME_VERSION )
+ __run_gpgme_config( cflags GPGME_INCLUDE_DIRS )
+ __run_gpgme_config( libs GPGME_LIBRARIES )
+
+ if( GPGME_INCLUDE_DIRS )
+ string( REGEX REPLACE "(^| +)-I" ";" GPGME_INCLUDE_DIRS "${GPGME_INCLUDE_DIRS}" )
endif( )
- endmacro( )
-
- macro( __run_gpgerr_config __type __var )
- execute_process(
- COMMAND ${GPG_ERR_EXECUTABLE} --${__type}
- OUTPUT_VARIABLE ${__var}
- RESULT_VARIABLE __result
- OUTPUT_STRIP_TRAILING_WHITESPACE )
- if( _result )
- tde_message_fatal( "Unable to run ${GPG_ERR_EXECUTABLE}!\n gpg-error library incorrectly installed?\n Path to gpgme-config are incorrect?" )
+ if( GPGME_LIBRARIES )
+ string( REGEX REPLACE "(^| +)-l" ";" GPGME_LIBRARIES "${GPGME_LIBRARIES}" )
endif( )
- endmacro( )
- __run_gpgme_config( version GPGME_VERSION )
- __run_gpgme_config( cflags GPGME_INCLUDE_DIRS )
- __run_gpgme_config( libs GPGME_LIBRARIES )
+ endif()
- __run_gpgerr_config( version GPGERR_VERSION )
- __run_gpgerr_config( cflags GPGERR_INCLUDE_DIRS )
- __run_gpgerr_config( libs GPGERR_LIBRARIES )
+ # check for gpg-error
+ pkg_search_module( GPGERR gpg-error )
+ if( NOT GPGERR_FOUND )
- # cleanup
- if( GPGME_INCLUDE_DIRS )
- string( REGEX REPLACE "(^| )-I" ";" GPGME_INCLUDE_DIRS "${GPGME_INCLUDE_DIRS}" )
- endif( )
- if( GPGME_LIBRARIES )
- string( REGEX REPLACE "(^| )-l" ";" GPGME_LIBRARIES "${GPGME_LIBRARIES}" )
- endif( )
- if( GPGERR_INCLUDE_DIRS )
- string( REGEX REPLACE "(^| )-I" ";" GPGERR_INCLUDE_DIRS "${GPGERR_INCLUDE_DIRS}" )
- endif( )
- if( GPGERR_LIBRARIES )
- string( REGEX REPLACE "(^| )-l" ";" GPGERR_LIBRARIES "${GPGERR_LIBRARIES}" )
- endif( )
- set( GPGME_INCLUDE_DIRS "${GPGME_INCLUDE_DIRS} ${GPGERR_INCLUDE_DIRS}" CACHE INTERNAL "" FORCE )
- set( GPGME_LIBRARIES "${GPGME_LIBRARIES} ${GPGERR_LIBRARIES}" CACHE INTERNAL "" FORCE )
- string( REGEX REPLACE " ;" ";" GPGME_INCLUDE_DIRS "${GPGME_INCLUDE_DIRS}" )
- string( REGEX REPLACE " ;" ";" GPGME_LIBRARIES "${GPGME_LIBRARIES}" )
- set( GPGME_INCLUDE_DIRS "${GPGME_INCLUDE_DIRS}" CACHE INTERNAL "" FORCE )
- set( GPGME_LIBRARIES "${GPGME_LIBRARIES}" CACHE INTERNAL "" FORCE )
+ # find gpg-error-config
+ find_program( GPG_ERR_EXECUTABLE NAMES gpgrt-config gpg-error-config )
+ if( NOT GPG_ERR_EXECUTABLE )
+ tde_message_fatal( "gpgrt-config or gpg-error-config was NOT found.\n gpg-error library is installed?" )
+ endif( )
- # assuming that all newer system have gpgme >= 0.4
- set( HAVE_GPGME_0_4_BRANCH 1 CACHE INTERNAL "" )
+ macro( __run_gpgerr_config __type __var )
+ execute_process(
+ COMMAND ${GPG_ERR_EXECUTABLE} --${__type}
+ OUTPUT_VARIABLE ${__var}
+ RESULT_VARIABLE __result
+ OUTPUT_STRIP_TRAILING_WHITESPACE )
+ if( _result )
+ tde_message_fatal( "Unable to run ${GPG_ERR_EXECUTABLE}!\n gpg-error library incorrectly installed?\n Path to gpgme-config are incorrect?" )
+ endif( )
+ endmacro( )
+
+ __run_gpgerr_config( version GPGERR_VERSION )
+ __run_gpgerr_config( cflags GPGERR_INCLUDE_DIRS )
+ __run_gpgerr_config( libs GPGERR_LIBRARIES )
+
+ if( GPGERR_INCLUDE_DIRS )
+ string( REGEX REPLACE "(^| +)-I" ";" GPGERR_INCLUDE_DIRS "${GPGERR_INCLUDE_DIRS}" )
+ endif( )
+ if( GPGERR_LIBRARIES )
+ string( REGEX REPLACE "(^| +)-l" ";" GPGERR_LIBRARIES "${GPGERR_LIBRARIES}" )
+ endif( )
- # NOTE: assume we have largefile support (need for gpgme)
- # FIXME: to be sure, we must check it
- add_definitions( -D_FILE_OFFSET_BITS=64 )
+ endif()
- if( NOT HAVE_GPGME_0_4_BRANCH )
- message( STATUS " found 'gpgme', version ${GPGME_VERSION}" )
- endif( )
+ # assuming that all newer system have gpgme >= 0.4
+ set( GPGME_INCLUDE_DIRS "${GPGME_INCLUDE_DIRS};${GPGERR_INCLUDE_DIRS}" CACHE INTERNAL "" FORCE )
+ set( GPGME_LIBRARIES "${GPGME_LIBRARIES};${GPGERR_LIBRARIES}" CACHE INTERNAL "" FORCE )
+ set( HAVE_GPGME_0_4_BRANCH 1 CACHE INTERNAL "" )
+ message( STATUS " found 'gpgme', version ${GPGME_VERSION}" )
# check for various GPGME features
tde_save( CMAKE_CXX_FLAGS )
+ tde_save( CMAKE_REQUIRED_INCLUDES )
tde_save( CMAKE_REQUIRED_LIBRARIES )
string( REGEX REPLACE "-include tqt.h" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}" )
- # See FIXME above regarding -D_FILE_OFFSET_BITS=64
- set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GPGME_INCLUDE_DIRS} -D_FILE_OFFSET_BITS=64")
+ set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${LARGEFILES_DEFINITIONS}")
+ set( CMAKE_REQUIRED_INCLUDES "${GPGME_INCLUDE_DIRS}")
set( CMAKE_REQUIRED_LIBRARIES "${GPGME_LIBRARIES}")
# check for GPGME_KEYLIST_MODE_VALIDATE
@@ -206,6 +210,7 @@ if( BUILD_LIBTDENETWORK OR BUILD_CERTMANAGER OR BUILD_KMAIL OR BUILD_KADDRESSBOO
# done checking for GPGME features
tde_restore( CMAKE_CXX_FLAGS )
+ tde_restore( CMAKE_REQUIRED_INCLUDES )
tde_restore( CMAKE_REQUIRED_LIBRARIES )
endif( )
@@ -237,6 +242,25 @@ if( BUILD_KARM AND WITH_XSCREENSAVER )
endif( )
endif( )
+if( BUILD_TDERESOURCES AND WITH_GROUPWISE )
+ check_symbol_exists( strrchr "string.h" HAVE_STRRCHR )
+ check_symbol_exists( strtod "stdlib.h" HAVE_STRTOD )
+ check_symbol_exists( sscanf "stdio.h" HAVE_SSCANF )
+ check_symbol_exists( strtol "stdlib.h" HAVE_STRTOL )
+ check_symbol_exists( strtoul "stdlib.h" HAVE_STRTOUL )
+ check_symbol_exists( strtoll "stdlib.h" HAVE_STRTOLL )
+ check_symbol_exists( strtoull "stdlib.h" HAVE_STRTOULL )
+ check_symbol_exists( gettimeofday "sys/time.h" HAVE_GETTIMEOFDAY )
+ check_include_file( "sys/timeb.h" HAVE_SYS_TIMEB_H )
+ check_symbol_exists( ftime "sys/timeb.h" HAVE_FTIME )
+ check_symbol_exists( rand_r "stdlib.h" HAVE_RAND_R )
+ check_symbol_exists( gmtime_r "time.h" HAVE_GMTIME_R )
+ check_symbol_exists( localtime_r "time.h" HAVE_LOCALTIME_R )
+ check_symbol_exists( timegm "time.h" HAVE_TIMEGM )
+ check_symbol_exists( wctomb "stdlib.h" HAVE_WCTOMB )
+ check_symbol_exists( mbtowc "stdlib.h" HAVE_MBTOWC )
+ check_symbol_exists( isnan "math.h" HAVE_ISNAN )
+endif ( )
# required stuff
find_package( TQt )