diff options
author | Sunanda Menon <sunanda.menon@oracle.com> | 2010-11-22 11:35:48 +0100 |
---|---|---|
committer | Sunanda Menon <sunanda.menon@oracle.com> | 2010-11-22 11:35:48 +0100 |
commit | 377c783e7555e4ba4b72ea4b0b36d11b4527be5a (patch) | |
tree | dab3dae70b89d544616766e8274cdddcadc53b71 /cmake | |
parent | 92db6e9af9fdfb0988fff56b50ef035ac38044ec (diff) | |
parent | af67d8ae02d024d2d2de41584e0befc87518f3fd (diff) | |
download | mariadb-git-377c783e7555e4ba4b72ea4b0b36d11b4527be5a.tar.gz |
merge
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/Makefile.am | 40 | ||||
-rw-r--r-- | cmake/build_configurations/mysql_release.cmake | 24 | ||||
-rw-r--r-- | cmake/make_dist.cmake.in | 32 | ||||
-rw-r--r-- | cmake/mysql_version.cmake | 74 | ||||
-rw-r--r-- | cmake/os/Windows.cmake | 10 | ||||
-rw-r--r-- | cmake/os/WindowsCache.cmake | 1 | ||||
-rw-r--r-- | cmake/versioninfo.rc.in | 8 |
7 files changed, 39 insertions, 150 deletions
diff --git a/cmake/Makefile.am b/cmake/Makefile.am deleted file mode 100644 index af3ec4f980d..00000000000 --- a/cmake/Makefile.am +++ /dev/null @@ -1,40 +0,0 @@ -EXTRA_DIST = \ - cmake_parse_arguments.cmake \ - cpack_source_ignore_files.cmake \ - package_name.cmake \ - configurable_file_content.in \ - check_minimal_version.cmake \ - create_initial_db.cmake.in \ - make_dist.cmake.in \ - dtrace.cmake \ - abi_check.cmake \ - bison.cmake \ - configure.pl \ - character_sets.cmake \ - libutils.cmake \ - readline.cmake \ - mysql_version.cmake \ - install_macros.cmake \ - ssl.cmake \ - plugin.cmake \ - zlib.cmake \ - stack_direction.c \ - do_abi_check.cmake \ - merge_archives_unix.cmake.in \ - dtrace_prelink.cmake \ - versioninfo.rc.in \ - mysql_add_executable.cmake \ - tags.cmake \ - install_layout.cmake \ - build_configurations/mysql_release.cmake \ - os/Windows.cmake \ - os/WindowsCache.cmake \ - os/Linux.cmake \ - os/SunOS.cmake \ - os/Darwin.cmake \ - os/HP-UX.cmake \ - os/AIX.cmake \ - os/OS400.cmake \ - os/Cygwin.cmake - - diff --git a/cmake/build_configurations/mysql_release.cmake b/cmake/build_configurations/mysql_release.cmake index b28af926bd5..56a6d897318 100644 --- a/cmake/build_configurations/mysql_release.cmake +++ b/cmake/build_configurations/mysql_release.cmake @@ -101,8 +101,10 @@ IF(NOT COMPILATION_COMMENT) ENDIF() IF(WIN32) - # Sign executables with authenticode certificate - SET(SIGNCODE 1 CACHE BOOL "") + IF(NOT CMAKE_USING_VC_FREE_TOOLS) + # Sign executables with authenticode certificate + SET(SIGNCODE 1 CACHE BOOL "") + ENDIF() ENDIF() IF(UNIX) @@ -225,22 +227,4 @@ IF(UNIX) ENDIF() ENDIF() ENDIF() - - IF(CMAKE_C_FLAGS_DEBUG) - SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}" - CACHE STRING "Debug C compile flags") - ENDIF() - IF(CMAKE_CXX_FLAGS_DEBUG) - SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}" - CACHE STRING "Debug C++ compile flags") - ENDIF() - IF(CMAKE_C_FLAGS_RELWITHDEBINFO) - SET(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}" - CACHE STRING "RelWithDebInfo C compile flags") - ENDIF() - IF(CMAKE_CXX_FLAGS_RELWITHDEBINFO) - SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}" - CACHE STRING "RelWithDebInfo C++ compile flags") - ENDIF() - ENDIF() diff --git a/cmake/make_dist.cmake.in b/cmake/make_dist.cmake.in index 13950e08553..95412370c28 100644 --- a/cmake/make_dist.cmake.in +++ b/cmake/make_dist.cmake.in @@ -14,19 +14,12 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # Make source distribution -# If bzr is present, run bzr export, add output of BUILD/autorun.sh -# if autotools are present, also pack bison output into it. +# If bzr is present, run bzr export. # Otherwise, just run cpack with source configuration. 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(GLIBTOOLIZE_EXECUTABLE "@GLIBTOOLIZE_EXECUTABLE@") -SET(LIBTOOLIZE_EXECUTABLE "@LIBTOOLIZE_EXECUTABLE@") -SET(ACLOCAL_EXECUTABLE "@ACLOCAL_EXECUTABLE@") -SET(AUTOCONF_EXECUTABLE "@AUTOCONF_EXECUTABLE@") -SET(AUTOHEADER_EXECUTABLE "@AUTOHEADER_EXECUTABLE@") -SET(AUTOMAKE_EXECUTABLE "@AUTOMAKE_EXECUTABLE@") SET(CMAKE_CPACK_COMMAND "@CMAKE_CPACK_COMMAND@") SET(CMAKE_COMMAND "@CMAKE_COMMAND@") SET(BZR_EXECUTABLE "@BZR_EXECUTABLE@") @@ -101,28 +94,6 @@ IF(NOT BZR_EXECUTABLE) ) ENDIF() -# Try to pack output of BUILD/autorun, if autotools are present -IF(GLIBTOOLIZE_EXECUTABLE OR LIBTOOLIZE_EXECUTABLE) - IF(ACLOCAL_EXECUTABLE AND AUTOMAKE_EXECUTABLE AND AUTOCONF_EXECUTABLE - AND AUTOHEADER_EXECUTABLE) - SET(HAVE_AUTOTOOLS 1) - ENDIF() -ENDIF() - -IF(HAVE_AUTOTOOLS) - EXECUTE_PROCESS(COMMAND BUILD/autorun.sh - WORKING_DIRECTORY ${PACKAGE_DIR}) -ELSE() - MESSAGE( "Autotools not found, resulting source package can only be built" - " with cmake") - CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/cmake/configure.pl - ${PACKAGE_DIR}/configure - COPYONLY) - IF(UNIX) - EXECUTE_PROCESS(COMMAND chmod +x ${PACKAGE_DIR}/configure) - ENDIF() -ENDIF() - # Copy bison output CONFIGURE_FILE(${CMAKE_BINARY_DIR}/sql/sql_yacc.h ${PACKAGE_DIR}/sql/sql_yacc.h COPYONLY) @@ -138,7 +109,6 @@ ENDIF() # In case we used CPack, it could have copied some # extra files that are not usable on different machines. FILE(REMOVE ${PACKAGE_DIR}/CMakeCache.txt) -FILE(REMOVE_RECURSE ${PACKAGE_DIR}/autom4te.cache) # When packing source, prefer gnu tar to "cmake -P tar" # cmake does not preserve timestamps.gnuwin32 tar is broken, cygwin is ok diff --git a/cmake/mysql_version.cmake b/cmake/mysql_version.cmake index 9f0f7729c22..b4be85ff657 100644 --- a/cmake/mysql_version.cmake +++ b/cmake/mysql_version.cmake @@ -13,16 +13,24 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -# Read value for a variable from configure.in +# +# Global constants, only to be changed between major releases. +# + +SET(SHARED_LIB_MAJOR_VERSION "16") +SET(PROTOCOL_VERSION "10") +SET(DOT_FRM_VERSION "6") + +# Read value for a variable from VERSION. MACRO(MYSQL_GET_CONFIG_VALUE keyword var) IF(NOT ${var}) - IF (EXISTS ${CMAKE_SOURCE_DIR}/configure.in) - FILE (STRINGS ${CMAKE_SOURCE_DIR}/configure.in str REGEX "^[ ]*${keyword}=") + IF (EXISTS ${CMAKE_SOURCE_DIR}/VERSION) + FILE (STRINGS ${CMAKE_SOURCE_DIR}/VERSION str REGEX "^[ ]*${keyword}=") IF(str) STRING(REPLACE "${keyword}=" "" str ${str}) - STRING(REGEX REPLACE "[ ].*" "" str ${str}) - SET(${var} ${str} CACHE INTERNAL "Config variable") + STRING(REGEX REPLACE "[ ].*" "" str "${str}") + SET(${var} ${str}) ENDIF() ENDIF() ENDIF() @@ -32,60 +40,32 @@ ENDMACRO() # Read mysql version for configure script MACRO(GET_MYSQL_VERSION) + MYSQL_GET_CONFIG_VALUE("MYSQL_VERSION_MAJOR" MAJOR_VERSION) + MYSQL_GET_CONFIG_VALUE("MYSQL_VERSION_MINOR" MINOR_VERSION) + MYSQL_GET_CONFIG_VALUE("MYSQL_VERSION_PATCH" PATCH_VERSION) + MYSQL_GET_CONFIG_VALUE("MYSQL_VERSION_EXTRA" EXTRA_VERSION) - IF(NOT VERSION_STRING) - IF(EXISTS ${CMAKE_SOURCE_DIR}/configure.in) - FILE(STRINGS ${CMAKE_SOURCE_DIR}/configure.in str REGEX "AM_INIT_AUTOMAKE") - STRING(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+[-][^ \\)]+" VERSION_STRING "${str}") - IF(NOT VERSION_STRING) - STRING(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+" VERSION_STRING "${str}") - IF(NOT VERSION_STRING) - FILE(STRINGS configure.in str REGEX "AC_INIT\\(") - STRING(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+[-][a-zAZ0-9]+" VERSION_STRING "${str}") - IF(NOT VERSION_STRING) - STRING(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+" VERSION_STRING "${str}") - ENDIF() - ENDIF() - ENDIF() - ENDIF() + IF(NOT MAJOR_VERSION OR NOT MINOR_VERSION OR NOT PATCH_VERSION) + MESSAGE(FATAL_ERROR "VERSION file cannot be parsed.") ENDIF() - - IF(NOT VERSION_STRING) - MESSAGE(FATAL_ERROR - "VERSION_STRING cannot be parsed, please specify -DVERSION_STRING=major.minor.patch-extra" - "when calling cmake") - ENDIF() - - SET(VERSION ${VERSION_STRING}) - STRING(REPLACE "-" "_" MYSQL_U_SCORE_VERSION "${VERSION_STRING}") - - # Remove trailing (non-numeric) part of the version string - STRING(REGEX REPLACE "[^\\.0-9].*" "" VERSION_STRING ${VERSION_STRING}) - - STRING(REGEX REPLACE "([0-9]+)\\.[0-9]+\\.[0-9]+" "\\1" MAJOR_VERSION "${VERSION_STRING}") - STRING(REGEX REPLACE "[0-9]+\\.([0-9]+)\\.[0-9]+" "\\1" MINOR_VERSION "${VERSION_STRING}") - STRING(REGEX REPLACE "[0-9]+\\.[0-9]+\\.([0-9]+)" "\\1" PATCH "${VERSION_STRING}") + SET(VERSION "${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}${EXTRA_VERSION}") + MESSAGE("-- MySQL ${VERSION}") SET(MYSQL_BASE_VERSION "${MAJOR_VERSION}.${MINOR_VERSION}" CACHE INTERNAL "MySQL Base version") - SET(MYSQL_NO_DASH_VERSION "${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH}") - MATH(EXPR MYSQL_VERSION_ID "10000*${MAJOR_VERSION} + 100*${MINOR_VERSION} + ${PATCH}") + SET(MYSQL_NO_DASH_VERSION "${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}") + STRING(REPLACE "-" "_" MYSQL_RPM_VERSION "${VERSION}") + MATH(EXPR MYSQL_VERSION_ID "10000*${MAJOR_VERSION} + 100*${MINOR_VERSION} + ${PATCH_VERSION}") MARK_AS_ADVANCED(VERSION MYSQL_VERSION_ID MYSQL_BASE_VERSION) SET(CPACK_PACKAGE_VERSION_MAJOR ${MAJOR_VERSION}) SET(CPACK_PACKAGE_VERSION_MINOR ${MINOR_VERSION}) - SET(CPACK_PACKAGE_VERSION_PATCH ${PATCH}) + SET(CPACK_PACKAGE_VERSION_PATCH ${PATCH_VERSION}) ENDMACRO() # Get mysql version and other interesting variables GET_MYSQL_VERSION() -MYSQL_GET_CONFIG_VALUE("PROTOCOL_VERSION" PROTOCOL_VERSION) -MYSQL_GET_CONFIG_VALUE("DOT_FRM_VERSION" DOT_FRM_VERSION) -MYSQL_GET_CONFIG_VALUE("MYSQL_TCP_PORT_DEFAULT" MYSQL_TCP_PORT_DEFAULT) -MYSQL_GET_CONFIG_VALUE("MYSQL_UNIX_ADDR_DEFAULT" MYSQL_UNIX_ADDR_DEFAULT) -MYSQL_GET_CONFIG_VALUE("SHARED_LIB_MAJOR_VERSION" SHARED_LIB_MAJOR_VERSION) -IF(NOT MYSQL_TCP_PORT_DEFAULT) - SET(MYSQL_TCP_PORT_DEFAULT "3306") -ENDIF() +SET(MYSQL_TCP_PORT_DEFAULT "3306") + IF(NOT MYSQL_TCP_PORT) SET(MYSQL_TCP_PORT ${MYSQL_TCP_PORT_DEFAULT}) SET(MYSQL_TCP_PORT_DEFAULT "0") diff --git a/cmake/os/Windows.cmake b/cmake/os/Windows.cmake index aac7e484f26..0dbfde5294c 100644 --- a/cmake/os/Windows.cmake +++ b/cmake/os/Windows.cmake @@ -91,7 +91,6 @@ IF(MSVC) STRING(REGEX REPLACE "/INCREMENTAL:([^ ]+)" "" CMAKE_${type}_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_${type}_LINKER_FLAGS_RELWITHDEBINFO}") ENDFOREACH() - ADD_DEFINITIONS(-DPTHREAD_STACK_MIN=1048576) # Mark 32 bit executables large address aware so they can # use > 2GB address space IF(CMAKE_SIZEOF_VOID_P MATCHES 4) @@ -105,14 +104,9 @@ IF(MSVC) ENDIF() #TODO: update the code and remove the disabled warnings - ADD_DEFINITIONS(/wd4800 /wd4805) - IF (MSVC_VERSION GREATER 1310) - ADD_DEFINITIONS(/wd4996) - ENDIF() + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4800 /wd4805 /wd4996") + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4800 /wd4805 /wd4996 /we4099") - # Make class/struct definition mismatch an error (overseen too often, - # adds tons of new warnings) - ADD_DEFINITIONS(/we4099) IF(CMAKE_SIZEOF_VOID_P MATCHES 8) # _WIN64 is defined by the compiler itself. diff --git a/cmake/os/WindowsCache.cmake b/cmake/os/WindowsCache.cmake index 4936ae369bc..ff068bfeaf6 100644 --- a/cmake/os/WindowsCache.cmake +++ b/cmake/os/WindowsCache.cmake @@ -57,6 +57,7 @@ SET(HAVE_FCNTL_H 1 CACHE INTERNAL "") SET(HAVE_FCNTL_NONBLOCK CACHE INTERNAL "") SET(HAVE_FCONVERT CACHE INTERNAL "") SET(HAVE_FDATASYNC CACHE INTERNAL "") +SET(HAVE_DECL_FDATASYNC CACHE INTERNAL "") SET(HAVE_FENV_H CACHE INTERNAL "") SET(HAVE_FESETROUND CACHE INTERNAL "") SET(HAVE_FGETLN CACHE INTERNAL "") diff --git a/cmake/versioninfo.rc.in b/cmake/versioninfo.rc.in index 97c45ec86c0..c625ce8c7f4 100644 --- a/cmake/versioninfo.rc.in +++ b/cmake/versioninfo.rc.in @@ -1,7 +1,7 @@ #include <windows.h>
VS_VERSION_INFO VERSIONINFO
-FILEVERSION @MAJOR_VERSION@,@MINOR_VERSION@,@PATCH@,0
-PRODUCTVERSION @MAJOR_VERSION@,@MINOR_VERSION@,@PATCH@,0
+FILEVERSION @MAJOR_VERSION@,@MINOR_VERSION@,@PATCH_VERSION@,0
+PRODUCTVERSION @MAJOR_VERSION@,@MINOR_VERSION@,@PATCH_VERSION@,0
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
FILEFLAGS 0
FILEOS VOS__WINDOWS32
@@ -12,8 +12,8 @@ BEGIN BEGIN
BLOCK "040904E4"
BEGIN
- VALUE "FileVersion", "@MAJOR_VERSION@.@MINOR_VERSION@.@PATCH@.0\0"
- VALUE "ProductVersion", "@MAJOR_VERSION@.@MINOR_VERSION@.@PATCH@.0\0"
+ VALUE "FileVersion", "@MAJOR_VERSION@.@MINOR_VERSION@.@PATCH_VERSION@.0\0"
+ VALUE "ProductVersion", "@MAJOR_VERSION@.@MINOR_VERSION@.@PATCH_VERSION@.0\0"
END
END
BLOCK "VarFileInfo"
|