diff options
author | Davi Arnaut <davi.arnaut@oracle.com> | 2010-11-20 12:47:50 -0200 |
---|---|---|
committer | Davi Arnaut <davi.arnaut@oracle.com> | 2010-11-20 12:47:50 -0200 |
commit | 8664de2230300967537d75a9ec51d15c400ca36d (patch) | |
tree | 2d19b102b6c66d0bcf7bb480f2140a6ffc9da7bb /cmake | |
parent | 766db2b52fe28514d47b159b9ec05445bdf36ab9 (diff) | |
download | mariadb-git-8664de2230300967537d75a9ec51d15c400ca36d.tar.gz |
WL#5665: Removal of the autotools-based build system
The autotools-based build system has been superseded and
is being removed in order to ease the maintenance burden on
developers tweaking and maintaining the build system.
In order to support tools that need to extract the server
version, a new file that (only) contains the server version,
called VERSION, is introduced. The file contents are human
and machine-readable. The format is:
MYSQL_VERSION_MAJOR=5
MYSQL_VERSION_MINOR=5
MYSQL_VERSION_PATCH=8
MYSQL_VERSION_EXTRA=-rc
The CMake based version extraction in cmake/mysql_version.cmake
is changed to extract the version from this file. The configure
to CMake wrapper is retained for backwards compatibility and to
support the BUILD/ scripts. Also, a new a makefile target
show-dist-name that prints the server version is introduced.
VERSION:
Add top-level version file.
cmake/mysql_version.cmake:
Get version information from the top-level VERSION file.
Do not cache the version components (MAJOR_VERSION, etc).
Add MYSQL_RPM_VERSION as a replacement for MYSQL_U_SCORE_VERSION.
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/Makefile.am | 40 | ||||
-rw-r--r-- | cmake/make_dist.cmake.in | 32 | ||||
-rw-r--r-- | cmake/mysql_version.cmake | 72 | ||||
-rw-r--r-- | cmake/versioninfo.rc.in | 8 |
4 files changed, 31 insertions, 121 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/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..e981e58c292 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 +# +# 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 configure.in 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/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"
|