diff options
author | Jon Olav Hauglid <jon.hauglid@sun.com> | 2010-05-18 14:52:51 +0200 |
---|---|---|
committer | Jon Olav Hauglid <jon.hauglid@sun.com> | 2010-05-18 14:52:51 +0200 |
commit | 198d51efe7a7bcd9ffceb2953faccc39d6df55d6 (patch) | |
tree | 7a7d548b20b27bd6b1cdb29f4052ffd1b406f39b /cmake | |
parent | d1dd2d11c4207b8e75931b9c575ea51273185b4b (diff) | |
parent | 21643fb22e527f4328b1dde1d21193b5e80455e3 (diff) | |
download | mariadb-git-198d51efe7a7bcd9ffceb2953faccc39d6df55d6.tar.gz |
manual merge from mysql-trunk-bugfixing
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/build_configurations/mysql_release.cmake | 20 | ||||
-rwxr-xr-x | cmake/install_layout.cmake | 249 | ||||
-rw-r--r-- | cmake/install_macros.cmake | 33 | ||||
-rw-r--r-- | cmake/mysql_version.cmake | 12 | ||||
-rw-r--r-- | cmake/plugin.cmake | 1 |
5 files changed, 223 insertions, 92 deletions
diff --git a/cmake/build_configurations/mysql_release.cmake b/cmake/build_configurations/mysql_release.cmake index b329a09d56e..97de0965f6b 100644 --- a/cmake/build_configurations/mysql_release.cmake +++ b/cmake/build_configurations/mysql_release.cmake @@ -80,9 +80,6 @@ IF(FEATURE_SET) ENDFOREACH() ENDIF() -SET(WITHOUT_AUDIT_NULL ON CACHE BOOL "") -SET(WITHOUT_DAEMON_EXAMPLE ON CACHE BOOL "") - OPTION(ENABLE_LOCAL_INFILE "" ON) SET(WITH_SSL bundled CACHE STRING "") SET(WITH_ZLIB bundled CACHE STRING "") @@ -122,8 +119,12 @@ IF(UNIX) IF(CMAKE_SYSTEM_NAME MATCHES "HP-UX") IF(CMAKE_C_COMPILER_ID MATCHES "HP") IF(CMAKE_SYSTEM_PROCESSOR MATCHES "ia64") - SET(CMAKE_C_FLAGS_RELWITHDEBINFO "-g +O2 +DD64 +DSitanium2 -mt -AC99") - SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-g +O2 +DD64 +DSitanium2 -mt -Aa") + SET(CMAKE_C_FLAGS + "${CMAKE_C_FLAGS} +DD64 +DSitanium2 -mt -AC99") + SET(CMAKE_CXX_FLAGS + "${CMAKE_CXX_FLAGS} +DD64 +DSitanium2 -mt -Aa") + SET(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS} +O2") + SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS} +O2") ENDIF() ENDIF() SET(WITH_SSL) @@ -132,15 +133,16 @@ IF(UNIX) # Linux flags IF(CMAKE_SYSTEM_NAME MATCHES "Linux") IF(CMAKE_C_COMPILER_ID MATCHES "Intel") - SET(CMAKE_C_FLAGS_RELWITHDEBINFO "-static-intel -g -O3 -unroll2 -ip -mp -restrict") - SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-static-intel -g -O3 -unroll2 -ip -mp -restrict") + SET(CMAKE_C_FLAGS_RELWITHDEBINFO "-static-intel -static-libgcc -g -O3 -unroll2 -ip -mp -restrict -no-ftz -no-prefetch") + SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-static-intel -static-libgcc -g -O3 -unroll2 -ip -mp -restrict -no-ftz -no-prefetch") + SET(WITH_SSL no) ENDIF() ENDIF() # OSX flags IF(APPLE) - SET(CMAKE_C_FLAGS_RELWITHDEBINFO "-Os ${CMAKE_C_FLAGS_RELWITHDEBINFO}") - SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-Os ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}") + SET(CMAKE_C_FLAGS_RELWITHDEBINFO "-g -Os -fno-common") + SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-g -Os -felide-constructors -fno-common") ENDIF() # Solaris flags diff --git a/cmake/install_layout.cmake b/cmake/install_layout.cmake index 2d8c218a293..ade6cdb747f 100755 --- a/cmake/install_layout.cmake +++ b/cmake/install_layout.cmake @@ -14,99 +14,184 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # The purpose of this file is to set the default installation layout. -# Currently, there are 2 different installation layouts , -# one is used in tar.gz packages (Windows zip is about the same), another one -# in RPMs. - -# There are currently 2 layouts defines, named STANDALONE (tar.gz layout) -# and UNIX (rpm layout). To force a directory layout when invoking cmake use -# -DINSTALL_LAYOUT=[STANDALONE|UNIX]. -# This wil use a predefined layout. There is a possibility to further fine-tune -# installation directories. Several variables are can be overwritten -# -# - INSTALL_BINDIR (directory with client executables and Unix shell scripts) -# - INSTALL_SBINDIR (directory with mysqld) -# - INSTALL_LIBDIR (directory with client end embedded libraries) -# - INSTALL_PLUGINDIR (directory for plugins) -# - INSTALL_INCLUDEDIR (directory for MySQL headers) -# - INSTALL_DOCDIR (documentation) -# - INSTALL_MANDIR (man pages) -# - INSTALL_SCRIPTDIR (several scripts, rarely used) -# - INSTALL_MYSQLSHAREDIR (MySQL character sets and localized error messages) -# - INSTALL_SHAREDIR (location of aclocal/mysql.m4) -# - INSTALL_SQLBENCHDIR (sql-bench) -# - INSTALL_MYSQLTESTDIR (mysql-test) -# - INSTALL_DOCREADMEDIR (readme and similar) -# - INSTALL_SUPPORTFILESDIR (used only in standalone installer) +# +# The current choices of installation layout are: +# +# STANDALONE +# Build with prefix=/usr/local/mysql, create tarball with install prefix="." +# and relative links. Windows zip uses the same tarball layout but without +# the build prefix. +# +# RPM +# Build as per default RPM layout, with prefix=/usr +# +# DEB +# Build as per STANDALONE, prefix=/opt/mysql-$major.$minor +# +# SVR4 +# Solaris package layout suitable for pkg* tools, prefix=/opt/mysql/mysql +# +# To force a directory layout, use -DINSTALL_LAYOUT=<layout>. +# +# The default is STANDALONE. +# +# There is the possibility to further fine-tune installation directories. +# Several variables can be overwritten: +# +# - INSTALL_BINDIR (directory with client executables and scripts) +# - INSTALL_SBINDIR (directory with mysqld) +# - INSTALL_SCRIPTDIR (several scripts, rarely used) +# +# - INSTALL_LIBDIR (directory with client end embedded libraries) +# - INSTALL_PLUGINDIR (directory for plugins) +# +# - INSTALL_INCLUDEDIR (directory for MySQL headers) +# +# - INSTALL_DOCDIR (documentation) +# - INSTALL_DOCREADMEDIR (readme and similar) +# - INSTALL_MANDIR (man pages) +# - INSTALL_INFODIR (info pages) +# +# - INSTALL_SHAREDIR (location of aclocal/mysql.m4) +# - INSTALL_MYSQLSHAREDIR (MySQL character sets and localized error messages) +# - INSTALL_MYSQLTESTDIR (mysql-test) +# - INSTALL_SQLBENCHDIR (sql-bench) +# - INSTALL_SUPPORTFILESDIR (various extra support files) +# +# - INSTALL_MYSQLDATADIR (data directory) -# Default installation layout on Unix is UNIX (kent wants it so) IF(NOT INSTALL_LAYOUT) - IF(WIN32) - SET(DEFAULT_INSTALL_LAYOUT "STANDALONE") - ELSE() - SET(DEFAULT_INSTALL_LAYOUT "UNIX") - ENDIF() + SET(DEFAULT_INSTALL_LAYOUT "STANDALONE") ENDIF() -SET(INSTALL_LAYOUT "${DEFAULT_INSTALL_LAYOUT}" -CACHE STRING "Installation directory layout. Options are: STANDALONE (as in zip or tar.gz installer) or UNIX") - -IF(NOT INSTALL_LAYOUT MATCHES "STANDALONE") - IF(NOT INSTALL_LAYOUT MATCHES "UNIX") - SET(INSTALL_LAYOUT "${DEFAULT_INSTALL_LAYOUT}") - ENDIF() -ENDIF() +SET(INSTALL_LAYOUT "${DEFAULT_INSTALL_LAYOUT}" +CACHE STRING "Installation directory layout. Options are: STANDALONE (as in zip or tar.gz installer) or UNIX") IF(UNIX) - IF(INSTALL_LAYOUT MATCHES "UNIX") + IF(INSTALL_LAYOUT MATCHES "RPM") SET(default_prefix "/usr") + ELSEIF(INSTALL_LAYOUT MATCHES "DEB") + SET(default_prefix "/opt/${MYSQL_BASE_VERSION}") + # This is required to avoid "cpack -GDEB" default of prefix=/usr + SET(CPACK_SET_DESTDIR ON) + ELSEIF(INSTALL_LAYOUT MATCHES "SVR4") + SET(default_prefix "/opt/mysql/mysql") ELSE() SET(default_prefix "/usr/local/mysql") ENDIF() IF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) - SET(CMAKE_INSTALL_PREFIX ${default_prefix} + SET(CMAKE_INSTALL_PREFIX ${default_prefix} CACHE PATH "install prefix" FORCE) ENDIF() - SET(SYSCONFDIR "${CMAKE_INSTALL_PREFIX}/etc" + SET(SYSCONFDIR "${CMAKE_INSTALL_PREFIX}/etc" CACHE PATH "config directory (for my.cnf)") MARK_AS_ADVANCED(SYSCONFDIR) ENDIF() - - - # STANDALONE layout - SET(INSTALL_BINDIR_STANDALONE "bin") - SET(INSTALL_SBINDIR_STANDALONE "bin") - SET(INSTALL_LIBDIR_STANDALONE "lib") - SET(INSTALL_INCLUDEDIR_STANDALONE "include") - SET(INSTALL_PLUGINDIR_STANDALONE "lib/plugin") - SET(INSTALL_DOCDIR_STANDALONE "docs") - SET(INSTALL_MANDIR_STANDALONE "man") - SET(INSTALL_MYSQLSHAREDIR_STANDALONE "share") - SET(INSTALL_SHAREDIR_STANDALONE "share") - SET(INSTALL_SCRIPTDIR_STANDALONE "scripts") - SET(INSTALL_MYSQLTESTDIR_STANDALONE "mysql-test") - SET(INSTALL_SQLBENCHROOTDIR_STANDALONE ".") - SET(INSTALL_DOCREADMEDIR_STANDALONE ".") - SET(INSTALL_SUPPORTFILESDIR_STANDALONE "support-files") - SET(INSTALL_MYSQLDATADIR_STANDALONE "data") - - # UNIX layout - SET(INSTALL_BINDIR_UNIX "bin") - SET(INSTALL_SBINDIR_UNIX "sbin") - SET(INSTALL_LIBDIR_UNIX "lib/mysql") - SET(INSTALL_PLUGINDIR_UNIX "lib/mysql/plugin") - SET(INSTALL_DOCDIR_UNIX "share/mysql/doc/MySQL-server-${MYSQL_NO_DASH_VERSION}") - SET(INSTALL_MANDIR_UNIX "share/mysql/man") - SET(INSTALL_INCLUDEDIR_UNIX "include/mysql") - SET(INSTALL_MYSQLSHAREDIR_UNIX "share/mysql") - SET(INSTALL_SHAREDIR_UNIX "share") - SET(INSTALL_SCRIPTDIR_UNIX "bin") - SET(INSTALL_MYSQLTESTDIR_UNIX "mysql-test") - SET(INSTALL_SQLBENCHROOTDIR_UNIX "") - SET(INSTALL_DOCREADMEDIR_UNIX "share/mysql/doc/MySQL-server-${MYSQL_NO_DASH_VERSION}") - SET(INSTALL_SUPPORTFILESDIR_UNIX "") - SET(INSTALL_MYSQLDATADIR_UNIX "var") +# +# STANDALONE layout +# +SET(INSTALL_BINDIR_STANDALONE "bin") +SET(INSTALL_SBINDIR_STANDALONE "bin") +SET(INSTALL_SCRIPTDIR_STANDALONE "scripts") +# +SET(INSTALL_LIBDIR_STANDALONE "lib") +SET(INSTALL_PLUGINDIR_STANDALONE "lib/plugin") +# +SET(INSTALL_INCLUDEDIR_STANDALONE "include") +# +SET(INSTALL_DOCDIR_STANDALONE "docs") +SET(INSTALL_DOCREADMEDIR_STANDALONE ".") +SET(INSTALL_MANDIR_STANDALONE "man") +SET(INSTALL_INFODIR_STANDALONE "docs") +# +SET(INSTALL_SHAREDIR_STANDALONE "share") +SET(INSTALL_MYSQLSHAREDIR_STANDALONE "share") +SET(INSTALL_MYSQLTESTDIR_STANDALONE "mysql-test") +SET(INSTALL_SQLBENCHDIR_STANDALONE ".") +SET(INSTALL_SUPPORTFILESDIR_STANDALONE "support-files") +# +SET(INSTALL_MYSQLDATADIR_STANDALONE "data") + +# +# RPM layout +# +SET(INSTALL_BINDIR_RPM "bin") +SET(INSTALL_SBINDIR_RPM "sbin") +SET(INSTALL_SCRIPTDIR_RPM "bin") +# +IF(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64") + SET(INSTALL_LIBDIR_RPM "lib64") + SET(INSTALL_PLUGINDIR_RPM "lib64/mysql/plugin") +ELSE() + SET(INSTALL_LIBDIR_RPM "lib") + SET(INSTALL_PLUGINDIR_RPM "lib/mysql/plugin") +ENDIF() +# +SET(INSTALL_INCLUDEDIR_RPM "include/mysql") +# +#SET(INSTALL_DOCDIR_RPM unset - installed directly by RPM) +#SET(INSTALL_DOCREADMEDIR_RPM unset - installed directly by RPM) +SET(INSTALL_INFODIR_RPM "share/info") +SET(INSTALL_MANDIR_RPM "share/man") +# +SET(INSTALL_SHAREDIR_RPM "share") +SET(INSTALL_MYSQLSHAREDIR_RPM "share/mysql") +SET(INSTALL_MYSQLTESTDIR_RPM "share/mysql-test") +SET(INSTALL_SQLBENCHDIR_RPM "") +SET(INSTALL_SUPPORTFILESDIR_RPM "share/mysql") +# +SET(INSTALL_MYSQLDATADIR_RPM "/var/lib/mysql") + +# +# DEB layout +# +SET(INSTALL_BINDIR_DEB "bin") +SET(INSTALL_SBINDIR_DEB "bin") +SET(INSTALL_SCRIPTDIR_DEB "scripts") +# +SET(INSTALL_LIBDIR_DEB "lib") +SET(INSTALL_PLUGINDIR_DEB "lib/plugin") +# +SET(INSTALL_INCLUDEDIR_DEB "include") +# +SET(INSTALL_DOCDIR_DEB "docs") +SET(INSTALL_DOCREADMEDIR_DEB ".") +SET(INSTALL_MANDIR_DEB "man") +SET(INSTALL_INFODIR_DEB "docs") +# +SET(INSTALL_SHAREDIR_DEB "share") +SET(INSTALL_MYSQLSHAREDIR_DEB "share") +SET(INSTALL_MYSQLTESTDIR_DEB "mysql-test") +SET(INSTALL_SQLBENCHDIR_DEB ".") +SET(INSTALL_SUPPORTFILESDIR_DEB "support-files") +# +SET(INSTALL_MYSQLDATADIR_DEB "data") + +# +# SVR4 layout +# +SET(INSTALL_BINDIR_SVR4 "bin") +SET(INSTALL_SBINDIR_SVR4 "bin") +SET(INSTALL_SCRIPTDIR_SVR4 "scripts") +# +SET(INSTALL_LIBDIR_SVR4 "lib") +SET(INSTALL_PLUGINDIR_SVR4 "lib/plugin") +# +SET(INSTALL_INCLUDEDIR_SVR4 "include") +# +SET(INSTALL_DOCDIR_SVR4 "docs") +SET(INSTALL_DOCREADMEDIR_SVR4 ".") +SET(INSTALL_MANDIR_SVR4 "man") +SET(INSTALL_INFODIR_SVR4 "docs") +# +SET(INSTALL_SHAREDIR_SVR4 "share") +SET(INSTALL_MYSQLSHAREDIR_SVR4 "share") +SET(INSTALL_MYSQLTESTDIR_SVR4 "mysql-test") +SET(INSTALL_SQLBENCHDIR_SVR4 ".") +SET(INSTALL_SUPPORTFILESDIR_SVR4 "support-files") +# +SET(INSTALL_MYSQLDATADIR_SVR4 "/var/lib/mysql") # Clear cached variables if install layout was changed @@ -117,12 +202,12 @@ IF(OLD_INSTALL_LAYOUT) ENDIF() SET(OLD_INSTALL_LAYOUT ${INSTALL_LAYOUT} CACHE INTERNAL "") -# Set INSTALL_FOODIR variables for chosen layout -# (for example, INSTALL_BINDIR will be defined as -# ${INSTALL_BINDIR_STANDALONE} by default if STANDALONE layout is chosen) -FOREACH(var BIN SBIN LIB MYSQLSHARE SHARE PLUGIN INCLUDE SCRIPT DOC MAN - MYSQLTEST SQLBENCHROOT DOCREADME SUPPORTFILES MYSQLDATA) - SET(INSTALL_${var}DIR ${INSTALL_${var}DIR_${INSTALL_LAYOUT}} +# Set INSTALL_FOODIR variables for chosen layout (for example, INSTALL_BINDIR +# will be defined as ${INSTALL_BINDIR_STANDALONE} by default if STANDALONE +# layout is chosen) +FOREACH(var BIN SBIN LIB MYSQLSHARE SHARE PLUGIN INCLUDE SCRIPT DOC MAN + INFO MYSQLTEST SQLBENCH DOCREADME SUPPORTFILES MYSQLDATA) + SET(INSTALL_${var}DIR ${INSTALL_${var}DIR_${INSTALL_LAYOUT}} CACHE STRING "${var} installation directory" ${FORCE}) MARK_AS_ADVANCED(INSTALL_${var}DIR) ENDFOREACH() diff --git a/cmake/install_macros.cmake b/cmake/install_macros.cmake index 73da532ecf6..f049776b8f4 100644 --- a/cmake/install_macros.cmake +++ b/cmake/install_macros.cmake @@ -173,7 +173,7 @@ FUNCTION(INSTALL_DEBUG_TARGET target) "" ${ARGN} ) - GET_TARGET_PROPERTY(target_type ${target} TYPE) + GET_TARGET_PROPERTY(target_type ${target} TYPE) IF(ARG_RENAME) SET(RENAME_PARAM RENAME ${ARG_RENAME}${CMAKE_${target_type}_SUFFIX}) ELSE() @@ -189,9 +189,40 @@ FUNCTION(INSTALL_DEBUG_TARGET target) STRING(REPLACE "${CMAKE_CFG_INTDIR}" "Debug" debug_target_location "${target_location}" ) ENDIF() + # Define permissions + # For executable files + SET(PERMISSIONS_EXECUTABLE + PERMISSIONS + OWNER_READ OWNER_WRITE OWNER_EXECUTE + GROUP_READ GROUP_EXECUTE + WORLD_READ WORLD_EXECUTE) + + # Permissions for shared library (honors CMAKE_INSTALL_NO_EXE which is + # typically set on Debian) + IF(CMAKE_INSTALL_SO_NO_EXE) + SET(PERMISSIONS_SHARED_LIBRARY + PERMISSIONS + OWNER_READ OWNER_WRITE + GROUP_READ + WORLD_READ) + ELSE() + SET(PERMISSIONS_SHARED_LIBRARY ${PERMISSIONS_EXECUTABLE}) + ENDIF() + + # Shared modules get the same permissions as shared libraries + SET(PERMISSIONS_MODULE_LIBRARY ${PERMISSIONS_SHARED_LIBRARY}) + + # Define permissions for static library + SET(PERMISSIONS_STATIC_LIBRARY + PERMISSIONS + OWNER_READ OWNER_WRITE + GROUP_READ + WORLD_READ) + INSTALL(FILES ${debug_target_location} DESTINATION ${ARG_DESTINATION} ${RENAME_PARAM} + ${PERMISSIONS_${target_type}} CONFIGURATIONS Release RelWithDebInfo OPTIONAL) diff --git a/cmake/mysql_version.cmake b/cmake/mysql_version.cmake index 3a61bcf40ab..6adca2ccc2f 100644 --- a/cmake/mysql_version.cmake +++ b/cmake/mysql_version.cmake @@ -55,6 +55,7 @@ MACRO(GET_MYSQL_VERSION) 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}) @@ -106,6 +107,7 @@ ENDIF() IF(NOT CPACK_SOURCE_PACKAGE_FILE_NAME) SET(CPACK_SOURCE_PACKAGE_FILE_NAME "mysql-${VERSION}") ENDIF() +SET(CPACK_PACKAGE_CONTACT "MySQL Build Team <build@mysql.com>") SET(CPACK_PACKAGE_VENDOR "Sun Microsystems, Inc") SET(CPACK_SOURCE_GENERATOR "TGZ") INCLUDE(cpack_source_ignore_files) @@ -114,6 +116,16 @@ INCLUDE(cpack_source_ignore_files) SET(PRODUCTNAME "MySQL Server") SET(COMPANYNAME ${CPACK_PACKAGE_VENDOR}) +# Windows 'date' command has unpredictable output, so cannot rely on it to +# set MYSQL_COPYRIGHT_YEAR - if someone finds a portable way to do so then +# it might be useful +#IF (WIN32) +# EXECUTE_PROCESS(COMMAND "date" "/T" OUTPUT_VARIABLE TMP_DATE) +# STRING(REGEX REPLACE "(..)/(..)/..(..).*" "\\3\\2\\1" MYSQL_COPYRIGHT_YEAR ${TMP_DATE}) +IF(UNIX) + EXECUTE_PROCESS(COMMAND "date" "+%Y" OUTPUT_VARIABLE MYSQL_COPYRIGHT_YEAR OUTPUT_STRIP_TRAILING_WHITESPACE) +ENDIF() + # Add version information to the exe and dll files # Refer to http://msdn.microsoft.com/en-us/library/aa381058(VS.85).aspx # for more info. diff --git a/cmake/plugin.cmake b/cmake/plugin.cmake index 30a7932a0d7..896624996d3 100644 --- a/cmake/plugin.cmake +++ b/cmake/plugin.cmake @@ -174,6 +174,7 @@ MACRO(MYSQL_ADD_PLUGIN) OUTPUT_NAME "${ARG_MODULE_OUTPUT_NAME}") # Install dynamic library MYSQL_INSTALL_TARGETS(${target} DESTINATION ${INSTALL_PLUGINDIR}) + INSTALL_DEBUG_TARGET(${target} DESTINATION ${INSTALL_PLUGINDIR}/debug) ENDIF() ENDMACRO() |