gawk-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gawk-diffs] [SCM] gawk branch, cmake, updated. 8401ded64836e829620dfbbc


From: Juergen Kahrs
Subject: [gawk-diffs] [SCM] gawk branch, cmake, updated. 8401ded64836e829620dfbbc2b6edf731edfb337
Date: Sun, 17 Feb 2013 13:45:30 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gawk".

The branch, cmake has been updated
       via  8401ded64836e829620dfbbc2b6edf731edfb337 (commit)
      from  9d0462137c48a149b41ffc8cce183999374c8683 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=8401ded64836e829620dfbbc2b6edf731edfb337

commit 8401ded64836e829620dfbbc2b6edf731edfb337
Author: Juergen Kahrs <address@hidden>
Date:   Sun Feb 17 14:44:47 2013 +0100

    CMake option USE_CONFIG_H allows to generate config.h. Some test cases with 
extensions still fail with this option switched ON.

diff --git a/cmake/configure.cmake b/cmake/configure.cmake
index 8b285e5..a4f3161 100644
--- a/cmake/configure.cmake
+++ b/cmake/configure.cmake
@@ -24,6 +24,18 @@
 
 ## process this file with CMake to produce Makefile
 
+option (USE_CONFIG_H          "Generate a file config.h for inclusion into C 
source code" OFF)
+if (USE_CONFIG_H)
+  file( WRITE config.h "/* all settings defined by CMake. */\n\n" )
+  ADD_DEFINITIONS (-D HAVE_CONFIG_H)
+  # Configure a header file to pass some of the CMake settings
+  # to the source code
+  # http://www.cmake.org/cmake/help/v2.8.8/cmake.html#command:configure_file
+  # CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/config.cmake.h.in 
${CMAKE_CURRENT_BINARY_DIR}/config.h IMMEDIATE )
+else()
+  file( WRITE config.h "/* empty file, all settings defined by CMake. */" )
+endif()
+
 include(CheckIncludeFiles)
 include(CheckIncludeFile)
 include(CheckSymbolExists)
@@ -32,54 +44,48 @@ include(CheckLibraryExists)
 include(CheckTypeSize)
 include(CheckStructHasMember)
 
+MACRO(DefineConfigH feature)
+#  message(STATUS feature=${feature}=${${feature}})
+  if (${feature})
+    if (${USE_CONFIG_H} STREQUAL ON)
+      FILE( APPEND config.h "#define ${feature} ${${feature}}\n")
+    else()
+      #ADD_DEFINITIONS (-D ${feature})
+      ADD_DEFINITIONS (-D${feature}=${${feature}})
+    endif ()
+  endif ()
+ENDMACRO(DefineConfigH)
+
 MACRO(DefineFunctionIfAvailable func feature)
   check_function_exists("${func}" "${feature}")
-  IF (${feature})
-    ADD_DEFINITIONS (-D ${feature})
-  ENDIF ()
+  DefineConfigH(${feature})
 ENDMACRO(DefineFunctionIfAvailable)
 
 MACRO(DefineHFileIfAvailable hfile feature)
   check_include_file("${hfile}" "${feature}")
-  IF (${feature})
-    ADD_DEFINITIONS (-D ${feature})
-  ENDIF ()
+  DefineConfigH(${feature})
 ENDMACRO(DefineHFileIfAvailable)
 
 MACRO(DefineTypeIfAvailable type feature)
   check_type_size("${type}" "${feature}")
-  IF (${feature})
-    ADD_DEFINITIONS (-D ${feature}=${${feature}})
-  ENDIF ()
+  DefineConfigH(${feature})
 ENDMACRO(DefineTypeIfAvailable)
 
 MACRO(DefineSymbolIfAvailable symbol hfile feature)
   check_symbol_exists("${symbol}" "${hfile}" "${feature}")
-  IF (${feature})
-    ADD_DEFINITIONS (-D ${feature})
-  ENDIF ()
+  DefineConfigH(${feature})
 ENDMACRO(DefineSymbolIfAvailable)
 
 MACRO(DefineStructHasMemberIfAvailable struct member hfile feature)
   check_struct_has_member("${struct}" "${member}" "${hfile}" "${feature}")
-  IF (${feature})
-    ADD_DEFINITIONS (-D ${feature})
-  ENDIF ()
+  DefineConfigH(${feature})
 ENDMACRO(DefineStructHasMemberIfAvailable)
 
 MACRO(DefineLibraryIfAvailable lib func location feature)
   check_library_exists("${lib}" "${func}" "${location}" "${feature}")
-  IF (${feature})
-    ADD_DEFINITIONS (-D ${feature})
-  ENDIF ()
+  DefineConfigH(${feature})
 ENDMACRO(DefineLibraryIfAvailable)
 
-file( WRITE config.h "/* empty file, all settings defined by CMake. */" )
-# Configure a header file to pass some of the CMake settings
-# to the source code
-# http://www.cmake.org/cmake/help/v2.8.8/cmake.html#command:configure_file
-# CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/config.cmake.h.in 
${CMAKE_CURRENT_BINARY_DIR}/config.h IMMEDIATE )
-
 FILE( READ  configure.ac CONFIG_AUTOMAKE )
 STRING( REGEX MATCH "AC_INIT\\(\\[GNU Awk\\], ([0-9]+\\.[0-9]+\\.[0-9]+)" 
GAWK_AUTOMAKE_LINE_VERSION "${CONFIG_AUTOMAKE}") 
 STRING( REGEX REPLACE ".*([0-9]+)\\.[0-9]+\\.[0-9]+.*" "\\1" 
GAWK_MAJOR_VERSION "${GAWK_AUTOMAKE_LINE_VERSION}") 

-----------------------------------------------------------------------

Summary of changes:
 cmake/configure.cmake |   54 +++++++++++++++++++++++++++---------------------
 1 files changed, 30 insertions(+), 24 deletions(-)


hooks/post-receive
-- 
gawk



reply via email to

[Prev in Thread] Current Thread [Next in Thread]