Revision: 40930
http://brlcad.svn.sourceforge.net/brlcad/?rev=40930&view=rev
Author: starseeker
Date: 2010-10-07 16:46:52 +0000 (Thu, 07 Oct 2010)
Log Message:
-----------
Cleanup, add in custom check for ALLOCA that mimics the autoconf test, check
for dtrace header if that option is enabled.
Modified Paths:
--------------
brlcad/branches/cmake/CMakeLists.txt
brlcad/branches/cmake/misc/CMake/BRLCAD_CheckFunctions.cmake
brlcad/branches/cmake/misc/CMake/CheckCFileRuns.cmake
brlcad/branches/cmake/src/other/CMakeLists.txt
Added Paths:
-----------
brlcad/branches/cmake/misc/CMake/test_srcs/alloca_header_test.c
brlcad/branches/cmake/misc/CMake/test_srcs/alloca_test.c
Modified: brlcad/branches/cmake/CMakeLists.txt
===================================================================
--- brlcad/branches/cmake/CMakeLists.txt 2010-10-07 15:44:18 UTC (rev
40929)
+++ brlcad/branches/cmake/CMakeLists.txt 2010-10-07 16:46:52 UTC (rev
40930)
@@ -508,6 +508,12 @@
# Build with dtrace support
OPTION(BRLCAD-ENABLE_DTRACE "Build with dtrace support" OFF)
MARK_AS_ADVANCED(BRLCAD-ENABLE_DTRACE)
+IF(BRLCAD-ENABLE_DTRACE)
+ BRLCAD_INCLUDE_FILE(sys/sdt.h HAVE_SYS_SDT_H)
+ IF(NOT HAVE_SYS_SDT_H)
+ SET(BRLCAD-ENABLE_DTRACE OFF)
+ ENDIF(NOT HAVE_SYS_SDT_H)
+ENDIF(BRLCAD-ENABLE_DTRACE)
# Enable/disable 64-bit build settings. This is autodetcted based on
# the size of the void pointer - don't override this setting unless
@@ -660,13 +666,13 @@
# OpenGL graphics
if(BRLCAD-ENABLE_OPENGL)
- INCLUDE(${BRLCAD_CMAKE_DIR}/FindGL.cmake)
- if (OPENGL_INCLUDE_DIR_GL)
- FILE(APPEND ${CONFIG_H_FILE} "#define HAVE_GL_GL_H 1\n")
+ INCLUDE(${BRLCAD_CMAKE_DIR}/FindGL.cmake)
+ if (OPENGL_INCLUDE_DIR_GL)
+ FILE(APPEND ${CONFIG_H_FILE} "#define HAVE_GL_GL_H 1\n")
endif (OPENGL_INCLUDE_DIR_GL)
- if (OPENGL_INCLUDE_DIR_GLX)
- FILE(APPEND ${CONFIG_H_FILE} "#define HAVE_GL_GLX_H 1\n")
- endif (OPENGL_INCLUDE_DIR_GLX)
+ if (OPENGL_INCLUDE_DIR_GLX)
+ FILE(APPEND ${CONFIG_H_FILE} "#define HAVE_GL_GLX_H 1\n")
+ endif (OPENGL_INCLUDE_DIR_GLX)
endif (BRLCAD-ENABLE_OPENGL)
# SGI graphics library
@@ -722,7 +728,6 @@
BRLCAD_INCLUDE_FILE(dirent.h HAVE_DIRENT_H)
# Need to compare this with the configure.ac list
-BRLCAD_INCLUDE_FILE(alloca.h HAVE_ALLOCA_H)
BRLCAD_INCLUDE_FILE(dslib.h HAVE_DSLIB_H)
BRLCAD_INCLUDE_FILE(getopt.h HAVE_GETOPT_H)
BRLCAD_INCLUDE_FILE(gl/device.h HAVE_GL_DEVICE_H)
@@ -785,6 +790,9 @@
# *******************************************************************
BRLCAD_TYPE_SIZE("ssize_t" SSIZE_T)
+BRLCAD_TYPE_SIZE("uint64_t" UINT64_T)
+BRLCAD_TYPE_SIZE("uintptr_t" UINTPTR_T)
+BRLCAD_TYPE_SIZE("sig_t" SIG_T)
@@ -797,10 +805,12 @@
# *******************************************************************
# *** Check for Functions - Stage 7 of 9 ***
# *******************************************************************
+
+# ALLOCA
+CMAKE_ALLOCA()
+
BRLCAD_FUNCTION_EXISTS(XQueryExtension HAVE_XQUERYEXTENSION)
BRLCAD_FUNCTION_EXISTS(alarm HAVE_ALARM)
-# TODO - this test isn't working and it should - look into AC macro for ALLOCA
-BRLCAD_FUNCTION_EXISTS(alloca HAVE_ALLOCA)
BRLCAD_FUNCTION_EXISTS(dlopen HAVE_DLOPEN)
BRLCAD_FUNCTION_EXISTS(drand48 HAVE_DRAND48)
BRLCAD_FUNCTION_EXISTS(fchmod HAVE_FCHMOD)
Modified: brlcad/branches/cmake/misc/CMake/BRLCAD_CheckFunctions.cmake
===================================================================
--- brlcad/branches/cmake/misc/CMake/BRLCAD_CheckFunctions.cmake
2010-10-07 15:44:18 UTC (rev 40929)
+++ brlcad/branches/cmake/misc/CMake/BRLCAD_CheckFunctions.cmake
2010-10-07 16:46:52 UTC (rev 40930)
@@ -100,3 +100,16 @@
FILE(APPEND ${CONFIG_H_FILE} "#define HAVE_SYS_WAIT_H 1\n")
ENDIF(WORKING_SYS_WAIT)
ENDMACRO(CMAKE_HEADER_SYS_WAIT)
+
+# ALLOCA
+MACRO(CMAKE_ALLOCA)
+
CHECK_C_FILE_RUNS(${CMAKE_SOURCE_DIR}/misc/CMake/test_srcs/alloca_header_test.c
WORKING_ALLOCA_H)
+ IF(WORKING_ALLOCA_H)
+ FILE(APPEND ${CONFIG_H_FILE} "#define HAVE_ALLOCA_H 1\n")
+ SET(FILE_RUN_DEFINITIONS "-DHAVE_ALLOCA_H")
+ ENDIF(WORKING_ALLOCA_H)
+
CHECK_C_FILE_RUNS(${CMAKE_SOURCE_DIR}/misc/CMake/test_srcs/alloca_test.c
WORKING_ALLOCA)
+ IF(WORKING_ALLOCA)
+ FILE(APPEND ${CONFIG_H_FILE} "#define HAVE_ALLOCA 1\n")
+ ENDIF(WORKING_ALLOCA)
+ENDMACRO(CMAKE_ALLOCA)
Modified: brlcad/branches/cmake/misc/CMake/CheckCFileRuns.cmake
===================================================================
--- brlcad/branches/cmake/misc/CMake/CheckCFileRuns.cmake 2010-10-07
15:44:18 UTC (rev 40929)
+++ brlcad/branches/cmake/misc/CMake/CheckCFileRuns.cmake 2010-10-07
16:46:52 UTC (rev 40930)
@@ -45,7 +45,7 @@
TRY_RUN(${VAR}_EXITCODE ${VAR}_COMPILED
${CMAKE_BINARY_DIR}
${SOURCE}
- COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
+ COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
${FILE_RUN_DEFINITIONS}
CMAKE_FLAGS
-DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS}
-DCMAKE_SKIP_RPATH:BOOL=${CMAKE_SKIP_RPATH}
"${CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES}"
Added: brlcad/branches/cmake/misc/CMake/test_srcs/alloca_header_test.c
===================================================================
--- brlcad/branches/cmake/misc/CMake/test_srcs/alloca_header_test.c
(rev 0)
+++ brlcad/branches/cmake/misc/CMake/test_srcs/alloca_header_test.c
2010-10-07 16:46:52 UTC (rev 40930)
@@ -0,0 +1,10 @@
+#include <alloca.h>
+int
+main ()
+{
+ char *p = (char *) alloca (2 * sizeof (int));
+ if (p) return 0;
+ ;
+ return 0;
+}
+
Property changes on:
brlcad/branches/cmake/misc/CMake/test_srcs/alloca_header_test.c
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: svn:eol-style
+ native
Added: brlcad/branches/cmake/misc/CMake/test_srcs/alloca_test.c
===================================================================
--- brlcad/branches/cmake/misc/CMake/test_srcs/alloca_test.c
(rev 0)
+++ brlcad/branches/cmake/misc/CMake/test_srcs/alloca_test.c 2010-10-07
16:46:52 UTC (rev 40930)
@@ -0,0 +1,30 @@
+#ifdef __GNUC__
+# define alloca __builtin_alloca
+#else
+# ifdef _MSC_VER
+# include <malloc.h>
+# define alloca _alloca
+# else
+# ifdef HAVE_ALLOCA_H
+# include <alloca.h>
+# else
+# ifdef _AIX
+ #pragma alloca
+# else
+# ifndef alloca /* predefined by HP cc +Olibcalls */
+char *alloca ();
+# endif
+# endif
+# endif
+# endif
+#endif
+
+int
+main ()
+{
+ char *p = (char *) alloca (1);
+ if (p) return 0;
+ ;
+ return 0;
+}
+
Property changes on: brlcad/branches/cmake/misc/CMake/test_srcs/alloca_test.c
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: svn:eol-style
+ native
Modified: brlcad/branches/cmake/src/other/CMakeLists.txt
===================================================================
--- brlcad/branches/cmake/src/other/CMakeLists.txt 2010-10-07 15:44:18 UTC
(rev 40929)
+++ brlcad/branches/cmake/src/other/CMakeLists.txt 2010-10-07 16:46:52 UTC
(rev 40930)
@@ -50,6 +50,7 @@
# libregex Library
THIRD_PARTY_OPTION(REGEX regex)
THIRD_PARTY_SUBDIR(REGEX libregex)
+BRLCAD_INCLUDE_FILE(regex.h HAVE_REGEX_H)
# libutahrle Library - The directory to perform ADD_SUBDIRECTORY on and the
# include directory for utahrle are different, so override the macro's setting
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3.
Spend less time writing and rewriting code and more time creating great
experiences on the web. Be a part of the beta today.
http://p.sf.net/sfu/beautyoftheweb
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits