[brlcad-commits] SF.net SVN: brlcad:[41127] brlcad/branches/cmake/src/other/tcl
Open Source Solid Modeling CAD
Brought to you by:
brlcad
From: <sta...@us...> - 2010-10-22 21:34:17
|
Revision: 41127 http://brlcad.svn.sourceforge.net/brlcad/?rev=41127&view=rev Author: starseeker Date: 2010-10-22 21:34:10 +0000 (Fri, 22 Oct 2010) Log Message: ----------- More tests for tcl. Modified Paths: -------------- brlcad/branches/cmake/src/other/tcl/CMake/CheckSystemFunctionality.cmake brlcad/branches/cmake/src/other/tcl/CMakeLists.txt Modified: brlcad/branches/cmake/src/other/tcl/CMake/CheckSystemFunctionality.cmake =================================================================== --- brlcad/branches/cmake/src/other/tcl/CMake/CheckSystemFunctionality.cmake 2010-10-22 20:17:38 UTC (rev 41126) +++ brlcad/branches/cmake/src/other/tcl/CMake/CheckSystemFunctionality.cmake 2010-10-22 21:34:10 UTC (rev 41127) @@ -180,3 +180,28 @@ FILE(APPEND ${CONFIG_H_FILE} "#define HAVE_ALLOCA 1\n") ENDIF(WORKING_ALLOCA) ENDMACRO(CMAKE_ALLOCA) + +MACRO(CHECK_COMPILER_SUPPORTS_HIDDEN) + SET(TEST_SRC" + #define MODULE_SCOPE extern __attribute__((__visibility__("hidden"))) + main(){}; + ") + CHECK_C_SOURCE_COMPILES("${TEST_SRC}" COMPILER_SUPPORTS_HIDDEN) +ENDMACRO(CHECK_COMPILER_SUPPORTS_HIDDEN) + +MACRO(CHECK_GETADDERINFO_WORKING) + SET(GETADDERINFO_SRC " + #include <netdb.h> + int main () { + const char *name, *port; + struct addrinfo *aiPtr, hints; + (void)getaddrinfo(name,port, &hints, &aiPtr); + (void)freeaddrinfo(aiPtr); + return 0; + }") + CHECK_C_SOURCE_RUNS("${GETADDERINFO_SRC}" WORKING_GETADDERINFO) + IF(WORKING_GETADDERINFO) + FILE(APPEND ${CONFIG_H_FILE} "#define HAVE_GETADDERINFO 1\n") + ENDIF(WORKING_GETADDERINFO) + +ENDMACRO(CHECK_GETADDERINFO_WORKING) Modified: brlcad/branches/cmake/src/other/tcl/CMakeLists.txt =================================================================== --- brlcad/branches/cmake/src/other/tcl/CMakeLists.txt 2010-10-22 20:17:38 UTC (rev 41126) +++ brlcad/branches/cmake/src/other/tcl/CMakeLists.txt 2010-10-22 21:34:10 UTC (rev 41127) @@ -133,8 +133,10 @@ FILE(APPEND ${CONFIG_H_FILE} "#define TCL_LIBRARY \"${CMAKE_INSTALL_PREFIX}/lib/${CMAKE_SHARED_LIBRARY_PREFIX}tcl${TCL_MAJOR_VERSION}.${TCL_MINOR_VERSION}${CMAKE_SHARED_LIBRARY_SUFFIX}\"\n") FILE(APPEND ${CONFIG_H_FILE} "#define TCL_PACKAGE_PATH \"${CMAKE_INSTALL_PREFIX}/lib\"\n") -# Hardcode this for now, check m4 logic -FILE(APPEND ${CONFIG_H_FILE} "#define TCL_CFGVAL_ENCODING \"iso8859-1\"\n") +IF(NOT TCL_CFGVAL_ENCODING) + SET(TCL_CFGVAL_ENCODING "iso8859-1") +ENDIF(NOT TCL_CFGVAL_ENCODING) +FILE(APPEND ${CONFIG_H_FILE} "#define TCL_CFGVAL_ENCODING \"${TCL_CFGVAL_ENCODING}\"\n") IF(APPLE) @@ -148,7 +150,16 @@ # Define a number of variables to be controlled by options OPTION(TCL_THREADS "Enable Tcl Thread support" ON) FILE(APPEND ${CONFIG_H_FILE} "#cmakedefine TCL_THREADS 1\n") +IF(TCL_THREADS) + FILE(APPEND ${CONFIG_H_FILE} "#define USE_THREAD_ALLOC 1\n") + FILE(APPEND ${CONFIG_H_FILE} "#define _REENTRANT 1\n") + FILE(APPEND ${CONFIG_H_FILE} "#define _THREAD_SAFE 1\n") + IF(${CMAKE_SYSTEM_NAME} MATCHES "^SunOS$") + FILE(APPEND ${CONFIG_H_FILE} "#define _POSIX_PTHREAD_SEMANTICS 1\n") + ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "^SunOS$") +ENDIF(TCL_THREADS) + # Tom's math library OPTION(TCL_TOMMATH "Enable Tcl Tom's Math Library" ON) FILE(APPEND ${CONFIG_H_FILE} "#cmakedefine TCL_TOMMATH 1\n") @@ -177,6 +188,40 @@ CHECK_INCLUDE_FILE_USABILITY_H(dlfcn.h DLFCN_H) CHECK_INCLUDE_FILE_USABILITY_H(sys/param.h SYS_PARAM_H) + +CHECK_LIBRARY(M m sin) +CHECK_LIBRARY(IEEE ieee main) +CHECK_LIBRARY(INET inet main) + +CHECK_INCLUDE_FILE_USABILITY_H(net/errno.h NET_ERRNO_H) + +CHECK_FUNCTION_EXISTS(connect HAVE_CONNECT) +CHECK_FUNCTION_EXISTS(gethostbyname HAVE_GETHOSTBYNAME) +IF(NOT HAVE_GETHOSTBYNAME) + CHECK_LIBRARY(GHBN lnsl gethostbyname) + SET(HAVE_GETHOSTBYNAME ${GHBN}) +ENDIF(NOT HAVE_GETHOSTBYNAME) + +CHECK_COMPILER_SUPPORTS_HIDDEN() + +CHECK_LIBRARY(DL dl dlopen) + +INCLUDE(TestBigEndian) +TEST_BIG_ENDIAN(IS_BIGENDIAN) + +CHECK_FUNCTION_EXISTS_H(getcwd HAVE_GETCWD) +CHECK_FUNCTION_EXISTS_H(opendir HAVE_OPENDIR) +CHECK_FUNCTION_EXISTS_H(strtol HAVE_STRTOL) +CHECK_FUNCTION_EXISTS_H(waitpid HAVE_WAITPID) +CHECK_FUNCTION_EXISTS(getaddrinfo HAVE_GETADDRINFO) +IF(HAVE_GETADDRINFO) + CHECK_GETADDERINFO_WORKING() +ENDIF(HAVE_GETADDRINFO) + + + + + CHECK_INCLUDE_FILE_H(sys/time.h HAVE_SYS_TIME_H) CHECK_FUNCTION_EXISTS_H(gmtime_r HAVE_GMTIME_R) CHECK_FUNCTION_EXISTS_H(localtime_r HAVE_LOCALTIME_R) @@ -188,11 +233,8 @@ CHECK_INCLUDE_FILE_H(sys/ioctl.h HAVE_SYS_IOCTL_H) CHECK_INCLUDE_FILE_H(sys/filio.h HAVE_SYS_FILIO_H) -CHECK_FUNCTION_EXISTS_H(getcwd HAVE_GETCWD) -CHECK_FUNCTION_EXISTS_H(opendir HAVE_OPENDIR) -CHECK_FUNCTION_EXISTS_H(strtol HAVE_STRTOL) -CHECK_FUNCTION_EXISTS_H(waitpid HAVE_WAITPID) -CHECK_FUNCTION_EXISTS_H(getaddrinfo HAVE_GETADDRINFO) + + #CHECK_FUNCTION_EXISTS_H( HAVE_GETPWUID_R_5) CHECK_FUNCTION_EXISTS_H(getpwuid HAVE_GETPWUID_R) #CHECK_FUNCTION_EXISTS_H( HAVE_GETPWNAM_R_5) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |