diff options
-rw-r--r-- | cmake/build_configurations/mysql_release.cmake | 4 | ||||
-rwxr-xr-x | libmysql/CMakeLists.txt | 35 | ||||
-rw-r--r-- | libmysqld/examples/CMakeLists.txt | 4 | ||||
-rw-r--r-- | man/CMakeLists.txt | 4 | ||||
-rw-r--r-- | mysql-test/CMakeLists.txt | 1 | ||||
-rwxr-xr-x | scripts/CMakeLists.txt | 4 | ||||
-rw-r--r-- | sql-bench/CMakeLists.txt | 3 | ||||
-rw-r--r-- | support-files/mysql.spec.sh | 33 |
8 files changed, 61 insertions, 27 deletions
diff --git a/cmake/build_configurations/mysql_release.cmake b/cmake/build_configurations/mysql_release.cmake index de92544ada5..eeef9f04544 100644 --- a/cmake/build_configurations/mysql_release.cmake +++ b/cmake/build_configurations/mysql_release.cmake @@ -136,8 +136,8 @@ 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() diff --git a/libmysql/CMakeLists.txt b/libmysql/CMakeLists.txt index f207d3909f7..cf0f8f8ebde 100755 --- a/libmysql/CMakeLists.txt +++ b/libmysql/CMakeLists.txt @@ -177,10 +177,18 @@ ENDIF() IF(NOT DISABLE_SHARED) MERGE_LIBRARIES(libmysql SHARED ${LIBS} EXPORTS ${CLIENT_API_FUNCTIONS} COMPONENT SharedLibraries) IF(UNIX) + # libtool compatability + IF(CMAKE_SYSTEM_NAME MATCHES "FreeBSD" OR APPLE) + SET(OS_SHARED_LIB_VERSION "${SHARED_LIB_MAJOR_VERSION}") + ELSEIF(CMAKE_SYSTEM_NAME MATCHES "HP-UX") + SET(OS_SHARED_LIB_VERSION "${SHARED_LIB_MAJOR_VERSION}.0") + ELSE() + SET(OS_SHARED_LIB_VERSION "${SHARED_LIB_MAJOR_VERSION}.0.0") + ENDIF() # Name of shared library is mysqlclient on Unix SET_TARGET_PROPERTIES(libmysql PROPERTIES OUTPUT_NAME mysqlclient - VERSION "${SHARED_LIB_MAJOR_VERSION}.0.0" + VERSION "${OS_SHARED_LIB_VERSION}" SOVERSION "${SHARED_LIB_MAJOR_VERSION}") IF(LINK_FLAG_NO_UNDEFINED) GET_TARGET_PROPERTY(libmysql_link_flags libmysql LINK_FLAGS) @@ -195,15 +203,22 @@ IF(NOT DISABLE_SHARED) SET_TARGET_PROPERTIES(mysqlclient PROPERTIES CLEAN_DIRECT_OUTPUT 1) SET_TARGET_PROPERTIES(libmysql PROPERTIES CLEAN_DIRECT_OUTPUT 1) - # Install 3 links to libmysqlclient.so (client_r) - FOREACH(ver "" "${SHARED_LIB_MAJOR_VERSION}" - "${SHARED_LIB_MAJOR_VERSION}.0.0") - GET_VERSIONED_LIBNAME( - "${CMAKE_SHARED_LIBRARY_PREFIX}mysqlclient_r" - "${CMAKE_SHARED_LIBRARY_SUFFIX}" - "${ver}" - linkname) - INSTALL_SYMLINK(${linkname} libmysql ${INSTALL_LIBDIR} COMPONENT SharedLibraries) + # Install links to libmysqlclient.so (client_r) + GET_VERSIONED_LIBNAME( + "${CMAKE_SHARED_LIBRARY_PREFIX}mysqlclient_r" + "${CMAKE_SHARED_LIBRARY_SUFFIX}" + "" + linkname) + INSTALL_SYMLINK(${linkname} libmysql ${INSTALL_LIBDIR}) + SET(OS_SHARED_LIB_SYMLINKS "${SHARED_LIB_MAJOR_VERSION}" "${OS_SHARED_LIB_VERSION}") + LIST(REMOVE_DUPLICATES OS_SHARED_LIB_SYMLINKS) + FOREACH(ver ${OS_SHARED_LIB_SYMLINKS}) + GET_VERSIONED_LIBNAME( + "${CMAKE_SHARED_LIBRARY_PREFIX}mysqlclient_r" + "${CMAKE_SHARED_LIBRARY_SUFFIX}" + "${ver}" + linkname) + INSTALL_SYMLINK(${linkname} libmysql ${INSTALL_LIBDIR}) ENDFOREACH() ENDIF() ENDIF() diff --git a/libmysqld/examples/CMakeLists.txt b/libmysqld/examples/CMakeLists.txt index f8adae9c931..f98470a2047 100644 --- a/libmysqld/examples/CMakeLists.txt +++ b/libmysqld/examples/CMakeLists.txt @@ -23,7 +23,9 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ADD_DEFINITIONS(-DEMBEDDED_LIBRARY -UMYSQL_CLIENT) -MYSQL_ADD_EXECUTABLE(mysql_embedded ../../client/completion_hash.cc +# We never use "mysql_embedded", is more of a linktest, so we don't +# use MYSQL_ADD_EXECUTABLE as that would install it and package it +ADD_EXECUTABLE(mysql_embedded ../../client/completion_hash.cc ../../client/mysql.cc ../../client/readline.cc) TARGET_LINK_LIBRARIES(mysql_embedded mysqlserver) IF(UNIX) diff --git a/man/CMakeLists.txt b/man/CMakeLists.txt index 29de4432c0c..1113b73fd8d 100644 --- a/man/CMakeLists.txt +++ b/man/CMakeLists.txt @@ -15,8 +15,12 @@ # Copy man pages FILE(GLOB MAN1_FILES *.1) +FILE(GLOB MAN1_EXCLUDE make_win_bin_dist.1) FILE(GLOB MAN8_FILES *.8) IF(MAN1_FILES) + IF(MAN1_EXCLUDE) + LIST(REMOVE_ITEM MAN1_FILES ${MAN1_EXCLUDE}) + ENDIF() INSTALL(FILES ${MAN1_FILES} DESTINATION ${INSTALL_MANDIR}/man1) ENDIF() IF(MAN8_FILES) diff --git a/mysql-test/CMakeLists.txt b/mysql-test/CMakeLists.txt index 1e6adced6a9..2e279f554e3 100644 --- a/mysql-test/CMakeLists.txt +++ b/mysql-test/CMakeLists.txt @@ -19,6 +19,7 @@ INSTALL( COMPONENT Test PATTERN "var/" EXCLUDE PATTERN "lib/My/SafeProcess" EXCLUDE + PATTERN "lib/t*" EXCLUDE PATTERN "CPack" EXCLUDE PATTERN "CMake*" EXCLUDE PATTERN "mtr.out*" EXCLUDE diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index 6a6a6c9fbf8..483e4bcef65 100755 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -93,6 +93,10 @@ IF(CMAKE_GENERATOR MATCHES "Makefiles") # No multiconfig build - use CMAKE_C_FLAGS SET(CFLAGS "@CMAKE_C_FLAGS@") SET(CXXFLAGS "@CMAKE_CXX_FLAGS@") + FOREACH(ARCH ${CMAKE_OSX_ARCHITECTURES}) + SET(CFLAGS "${CFLAGS} -arch ${ARCH}") + SET(CXXFLAGS "${CXXFLAGS} -arch ${ARCH}") + ENDFOREACH() ELSE() # Multiconfig build - use CMAKE_C_FLAGS_RELWITHDEBINFO SET(CFLAGS "@CMAKE_C_FLAGS_RELWITHDEBINFO@") diff --git a/sql-bench/CMakeLists.txt b/sql-bench/CMakeLists.txt index 59dca2e84cc..4b7f9520cc1 100644 --- a/sql-bench/CMakeLists.txt +++ b/sql-bench/CMakeLists.txt @@ -18,7 +18,6 @@ FILE(GLOB all_files ${CMAKE_SOURCE_DIR}/sql-bench/* ${CMAKE_SOURCE_DIR}/sql-bench/Data/ATIS/* ${CMAKE_SOURCE_DIR}/sql-bench/Data/Wisconsin/* -${CMAKE_SOURCE_DIR}/sql-bench/Comments/* ${CMAKE_SOURCE_DIR}/sql-bench/limits/* ) @@ -34,7 +33,7 @@ ENDIF() GET_FILENAME_COMPONENT(basedir ${CMAKE_SOURCE_DIR} ABSOLUTE) FOREACH(file ${all_files}) - IF(NOT IS_DIRECTORY ${file} AND NOT ${file} MATCHES "Make" ) + IF(NOT IS_DIRECTORY ${file} AND NOT ${file} MATCHES "Make|as3ap|/example$" ) FILE(RELATIVE_PATH relpath ${basedir} ${file}) SET(target_relpath ${relpath}) GET_FILENAME_COMPONENT(ext ${file} EXT) diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh index b1fbc90d829..764c67b85c7 100644 --- a/support-files/mysql.spec.sh +++ b/support-files/mysql.spec.sh @@ -122,20 +122,20 @@ %endif %if %{distro_specific} %if %(test -f /etc/redhat-release && echo 1 || echo 0) - %define redhatver %(rpm -qf --qf '%%{version}\\n' /etc/redhat-release | sed -e 's/^\\([0-9]*\\).*/\\1/g') - %if "%redhatver" == "4" - %define distro_description Red Hat Enterprise Linux 4 - %define distro_releasetag rhel4 + %define elver %(rpm -qf --qf '%%{version}\\n' /etc/redhat-release | sed -e 's/^\\([0-9]*\\).*/\\1/g') + %if "%elver" == "4" + %define distro_description Enterprise Linux 4 + %define distro_releasetag el4 %define distro_buildreq gcc-c++ gperf ncurses-devel perl readline-devel time zlib-devel %define distro_requires chkconfig coreutils grep procps shadow-utils %else - %if "%redhatver" == "5" - %define distro_description Red Hat Enterprise Linux 5 - %define distro_releasetag rhel5 + %if "%elver" == "5" + %define distro_description Enterprise Linux 5 + %define distro_releasetag el5 %define distro_buildreq gcc-c++ gperf ncurses-devel perl readline-devel time zlib-devel %define distro_requires chkconfig coreutils grep procps shadow-utils %else - %{error:Red Hat %{redhatver} is unsupported} + %{error:Enterprise Linux %{elver} is unsupported} %endif %endif %else @@ -168,6 +168,13 @@ %define distro_requires coreutils grep procps /sbin/chkconfig /usr/sbin/useradd /usr/sbin/groupadd %endif +# Avoid debuginfo RPMs, leaves binaries unstripped +%define debug_package %{nil} + +# Hack to work around bug in RHEL5 __os_install_post macro, wrong inverted +# test for __debug_package +%define __strip /bin/true + # ---------------------------------------------------------------------------- # Support optional "tcmalloc" library (experimental) # ---------------------------------------------------------------------------- @@ -389,7 +396,7 @@ mkdir debug -DFEATURE_SET="%{feature_set}" \ -DCOMPILATION_COMMENT="%{compilation_comment_debug}" \ -DMYSQL_SERVER_SUFFIX="%{server_suffix}" - make VERBOSE=1 mysqld mysqlserver + make VERBOSE=1 ) # Build full release mkdir release @@ -570,7 +577,7 @@ if [ ! -d $mysql_datadir/test ] ; then mkdir $mysql_datadir/test; fi # use insserv for older SuSE Linux versions if [ -x /sbin/insserv ] ; then /sbin/insserv %{_sysconfdir}/init.d/mysql -# use chkconfig on Red Hat and newer SuSE releases +# use chkconfig on Enterprise Linux and newer SuSE releases elif [ -x /sbin/chkconfig ] ; then /sbin/chkconfig --add mysql fi @@ -631,7 +638,7 @@ if [ $1 = 0 ] ; then # For older SuSE Linux versions if [ -x /sbin/insserv ] ; then /sbin/insserv -r %{_sysconfdir}/init.d/mysql - # use chkconfig on Red Hat and newer SuSE releases + # use chkconfig on Enterprise Linux and newer SuSE releases elif [ -x /sbin/chkconfig ] ; then /sbin/chkconfig --del mysql fi @@ -723,6 +730,9 @@ fi %attr(755, root, root) %{_libdir}/mysql/plugin/mypluglib.so %attr(755, root, root) %{_libdir}/mysql/plugin/semisync_master.so* %attr(755, root, root) %{_libdir}/mysql/plugin/semisync_slave.so* +%attr(755, root, root) %{_libdir}/mysql/plugin/debug/mypluglib.so +%attr(755, root, root) %{_libdir}/mysql/plugin/debug/semisync_master.so* +%attr(755, root, root) %{_libdir}/mysql/plugin/debug/semisync_slave.so* %if %{WITH_TCMALLOC} %attr(755, root, root) %{_libdir}/mysql/%{malloc_lib_target} @@ -810,7 +820,6 @@ fi # ---------------------------------------------------------------------------- %files -n MySQL-embedded%{product_suffix} %defattr(-, root, root, 0755) -%attr(755, root, root) %{_bindir}/mysql_embedded %attr(644, root, root) %{_libdir}/mysql/libmysqld.a %attr(644, root, root) %{_libdir}/mysql/libmysqld-debug.a |