List:Commits« Previous MessageNext Message »
From:Joerg Bruehe Date:January 25 2011 8:53pm
Subject:bzr push into mysql-5.5-bugteam branch (joerg:3100 to 3101)
View as plain text  
 3101 Joerg Bruehe	2011-01-25 [merge]
      Next step for a test build. 42969

    renamed:
      cmake/version_files.cmake.in => cmake/info_macros.cmake.in
    modified:
      CMakeLists.txt
      cmake/make_dist.cmake.in
      cmake/info_macros.cmake.in
 3100 Joerg Bruehe	2011-01-25 [merge]
      Get a new change of the 42969 bug, for a test build.

    modified:
      support-files/mysql.spec.sh
=== modified file 'CMakeLists.txt'
--- a/CMakeLists.txt	2011-01-24 12:34:07 +0000
+++ b/CMakeLists.txt	2011-01-25 20:45:04 +0000
@@ -318,16 +318,16 @@ CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/inclu
 CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/sql/sql_builtin.cc.in
     ${CMAKE_BINARY_DIR}/sql/sql_builtin.cc)
 CONFIGURE_FILE(
-    ${CMAKE_SOURCE_DIR}/cmake/version_files.cmake.in ${CMAKE_BINARY_DIR}/version_files.cmake @ONLY)
+    ${CMAKE_SOURCE_DIR}/cmake/info_macros.cmake.in ${CMAKE_BINARY_DIR}/info_macros.cmake @ONLY)
 
 # Handle the "INFO_*" files.
-INCLUDE(${CMAKE_BINARY_DIR}/version_files.cmake)
+INCLUDE(${CMAKE_BINARY_DIR}/info_macros.cmake)
 # Source: This can be done during the cmake phase, all information is
 # available.
 CREATE_INFO_SRC(${CMAKE_BINARY_DIR})
 # Build flags: This must be postponed to the make phase.
 ADD_CUSTOM_TARGET(INFO_BIN ALL
-  COMMAND ${CMAKE_COMMAND} -P ${CMAKE_BINARY_DIR}/version_files.cmake
+  COMMAND ${CMAKE_COMMAND} -P ${CMAKE_BINARY_DIR}/info_macros.cmake
   WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
 )
 

=== renamed file 'cmake/version_files.cmake.in' => 'cmake/info_macros.cmake.in'
--- a/cmake/version_files.cmake.in	2011-01-24 12:34:07 +0000
+++ b/cmake/info_macros.cmake.in	2011-01-25 20:51:38 +0000
@@ -20,9 +20,7 @@
 SET(VERSION "@VERSION@")
 SET(CMAKE_SOURCE_DIR "@CMAKE_SOURCE_DIR@")
 SET(CMAKE_BINARY_DIR "@CMAKE_BINARY_DIR@")
-SET(CPACK_SOURCE_PACKAGE_FILE_NAME "@CPACK_SOURCE_PACKAGE_FILE_NAME@")
 SET(BZR_EXECUTABLE "@BZR_EXECUTABLE@")
-SET(PACKAGE_DIR  ${CMAKE_BINARY_DIR}/${CPACK_SOURCE_PACKAGE_FILE_NAME})
  
  
 # This may be used during "make dist".
@@ -33,19 +31,28 @@ SET(PACKAGE_DIR  ${CMAKE_BINARY_DIR}/${C
 # (typically, by developers directly in their tree).
   
 MACRO(CREATE_INFO_SRC target_dir)
+  SET(INFO_SRC "${target_dir}/INFO_SRC")
+
   IF(EXISTS ${CMAKE_SOURCE_DIR}/.bzr)
     # We have a working "bzr" and sources are in a BZR repository: Always update.
     EXECUTE_PROCESS(
       COMMAND ${BZR_EXECUTABLE} version-info ${CMAKE_SOURCE_DIR}
       WORKING_DIRECTORY ${target_dir}
-      OUTPUT_FILE "INFO_SRC"
+      OUTPUT_FILE ${INFO_SRC}
       RESULT_VARIABLE RESULT
     )
     # For better readability ...
-    FILE(APPEND "${target_dir}/INFO_SRC" "\nMySQL source ${VERSION}\n")
+    FILE(APPEND ${INFO_SRC} "\nMySQL source ${VERSION}\n")
+    FILE(APPEND ${INFO_SRC} "\n(1) Source ${CMAKE_SOURCE_DIR} - Binaries ${CMAKE_BINARY_DIR} - Target ${target_dir}\n")
+  ELSEIF(EXISTS ../INFO_SRC)
+    # The following is a special rule for our build environment, where we already exported from a BZR tree.
+    FILE(READ ../INFO_SRC SOURCE_INFO
+    FILE(WRITE ${INFO_SRC} "${SOURCE_INFO}\n")
+    FILE(APPEND ${INFO_SRC} "\n(2) Source ${CMAKE_SOURCE_DIR} - Binaries ${CMAKE_BINARY_DIR} - Target ${target_dir}\n")
   ELSEIF(NOT EXISTS ${target_dir}/INFO_SRC)
     # The following is a fall-back if there should be no BZR available.
-    FILE(WRITE "${target_dir}/INFO_SRC" "\nMySQL source ${VERSION}\n")
+    FILE(WRITE ${INFO_SRC} "\nMySQL source ${VERSION}\n")
+    FILE(APPEND ${INFO_SRC} "\n(3) Source ${CMAKE_SOURCE_DIR} - Binaries ${CMAKE_BINARY_DIR} - Target ${target_dir}\n")
   ENDIF()
 ENDMACRO(CREATE_INFO_SRC)
 
@@ -58,14 +65,15 @@ MACRO(CREATE_INFO_BIN)
 
   FILE(WRITE ${INFO_BIN} "===== Information about the build process: =====\n")
   IF (WIN32)
-    EXECUTE_PROCESS(COMMAND "date" "/T" OUTPUT_VARIABLE TMP_DATE)
+    EXECUTE_PROCESS(COMMAND date /c /T OUTPUT_VARIABLE TMP_DATE)
   ELSEIF(UNIX)
-    EXECUTE_PROCESS(COMMAND "date" "+%Y-%m-%d %H:%M:%S" OUTPUT_VARIABLE TMP_DATE OUTPUT_STRIP_TRAILING_WHITESPACE)
+    EXECUTE_PROCESS(COMMAND date "+%Y-%m-%d %H:%M:%S" OUTPUT_VARIABLE TMP_DATE OUTPUT_STRIP_TRAILING_WHITESPACE)
   ELSE()
     SET(TMP_DATE "No date command known")
   ENDIF()
   SITE_NAME(HOSTNAME)
   FILE(APPEND ${INFO_BIN} "Build was run at: ${TMP_DATE} on host '${HOSTNAME}'\n\n")
+  FILE(APPEND ${INFO_BIN} "\nSource ${CMAKE_SOURCE_DIR} - Binaries ${CMAKE_BINARY_DIR}\n")
 
   # According to the cmake docs, this variable should always be set.
   # However, it is empty in my local tests, cmake 2.6.0 on Linux (Debian stable, Jan 2011).
@@ -77,29 +85,23 @@ MACRO(CREATE_INFO_BIN)
     FILE(APPEND ${INFO_BIN} "Build was done on  ${CMAKE_HOST_SYSTEM} using ${CMAKE_HOST_SYSTEM_PROCESSOR}\n\n")
   ENDIF()
 
-  FILE(APPEND ${INFO_BIN} "===== Compiler flags used (from the 'sql/' subdirectory): =====\n")
-  IF(EXISTS sql/CMakeFiles/sql.dir/flags.make)
-    # current dir == ${CMAKE_BINARY_DIR}, see the call in top "CMakeLists.txt"
-    FILE(STRINGS sql/CMakeFiles/sql.dir/flags.make COMPILE_FLAGS REGEX "^# compile|^C_|^CXX_")
-    STRING(REPLACE "# compile" "\n# compile" COMPILE_FLAGS_1 ${COMPILE_FLAGS})
-    STRING(REPLACE "C_"        "\nC_"        COMPILE_FLAGS_2 ${COMPILE_FLAGS_1})
-    STRING(REPLACE "CXX_"      "\nCXX_"      COMPILE_FLAGS_LINES ${COMPILE_FLAGS_2})
-    # The below line did not work in tests using cmake 2.6.0, the matter should be checked again with newer versions.
-    # STRING(REGEX REPLACE "(^# compile|^C_|^CXX_)" "\n\\1" COMPILE_FLAGS_LINES ${COMPILE_FLAGS})
-    FILE(APPEND ${INFO_BIN} ${COMPILE_FLAGS_LINES} "\n\n")
-  ELSE()
-    FILE(APPEND ${INFO_BIN} "File 'sql/CMakeFiles/sql.dir/flags.make' is not yet found.\n\n")
+  IF (WIN32)
+    FILE(APPEND ${INFO_BIN} "===== Compiler / generator used: =====\n")
+    FILE(APPEND ${INFO_BIN} ${CMAKE_GENERATOR} "\n\n")
+  ELSEIF(UNIX)
+    FILE(APPEND ${INFO_BIN} "===== Compiler flags used (from the 'sql/' subdirectory): =====\n")
+    IF(EXISTS sql/CMakeFiles/sql.dir/flags.make)
+      EXECUTE_PROCESS(COMMAND egrep "^# compile|^C_|^CXX_" sql/CMakeFiles/sql.dir/flags.make OUTPUT_VARIABLE COMPILE_FLAGS)
+      FILE(APPEND ${INFO_BIN} ${COMPILE_FLAGS} "\n\n")
+    ELSE()
+      FILE(APPEND ${INFO_BIN} "File 'sql/CMakeFiles/sql.dir/flags.make' is not yet found.\n\n")
+    ENDIF()
   ENDIF()
 
   FILE(APPEND ${INFO_BIN} "===== Feature flags used: =====\n")
   IF(EXISTS ${CMAKE_BINARY_DIR}/CMakeCache.txt)
-    # The intention is to do the equivalent of "grep '^WITH' CMakeCache.txt".
-    # Note that "FILE(STRINGS ...)" will simply ignore carriage return (CR) characters,
-    # so the variable will have all those lines joined to one.
-    # To get readable output, "STRING(REPLACE ...)" is used, making it multi-line again.
-    FILE(STRINGS ${CMAKE_BINARY_DIR}/CMakeCache.txt FEATURE_FLAGS REGEX "^WITH")
-    STRING(REPLACE "WITH" "\nWITH" FEATURE_FLAGS_LINES ${FEATURE_FLAGS})
-    FILE(APPEND ${INFO_BIN} ${FEATURE_FLAGS_LINES} "\n\n")
+    EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -L ${CMAKE_BINARY_DIR} OUTPUT_VARIABLE FEATURE_FLAGS)
+    FILE(APPEND ${INFO_BIN} ${FEATURE_FLAGS} "\n\n")
   ELSE()
     FILE(APPEND ${INFO_BIN} "File 'CMakeCache.txt' is not yet found.\n\n")
   ENDIF()

=== modified file 'cmake/make_dist.cmake.in'
--- a/cmake/make_dist.cmake.in	2011-01-24 12:34:07 +0000
+++ b/cmake/make_dist.cmake.in	2011-01-25 20:45:04 +0000
@@ -107,7 +107,7 @@ IF(MYSQL_DOCS_LOCATION)
 ENDIF()
 
 # Ensure there is a "INFO_SRC" file.
-INCLUDE(${CMAKE_BINARY_DIR}/version_files.cmake)
+INCLUDE(${CMAKE_BINARY_DIR}/info_macros.cmake)
 IF(NOT EXISTS ${PACKAGE_DIR}/INFO_SRC)
   CREATE_INFO_SRC(${PACKAGE_DIR})
 ENDIF()

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-5.5-bugteam branch (joerg:3100 to 3101) Joerg Bruehe25 Jan