From 29f098f2d3b8cabe352bd255567c4eae4bcfea00 Mon Sep 17 00:00:00 2001 From: Daniel Fischer Date: Fri, 16 Apr 2010 10:27:18 +0200 Subject: [PATCH 01/19] Make the libraries we produce on Windows actually usable --- include/my_global.h | 17 +++++++++++++---- scripts/make_win_bin_dist | 1 + 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/include/my_global.h b/include/my_global.h index b4bc61e0a48..c0a55e0f4e4 100644 --- a/include/my_global.h +++ b/include/my_global.h @@ -18,6 +18,11 @@ #ifndef _global_h #define _global_h +/* Client library users on Windows need this macro defined here. */ +#if !defined(__WIN__) && defined(_WIN32) +#define __WIN__ +#endif + /* InnoDB depends on some MySQL internals which other plugins should not need. This is because of InnoDB's foreign key support, "safe" binlog @@ -1089,10 +1094,14 @@ typedef long long my_ptrdiff_t; #define HUGE_PTR #endif #endif -#if defined(__IBMC__) || defined(__IBMCPP__) -/* This was _System _Export but caused a lot of warnings on _AIX43 */ -#define STDCALL -#elif !defined( STDCALL) + +#ifdef STDCALL +#undef STDCALL +#endif + +#ifdef _WIN32 +#define STDCALL __stdcall +#else #define STDCALL #endif diff --git a/scripts/make_win_bin_dist b/scripts/make_win_bin_dist index 7e8428bfe5c..9af722f7afc 100755 --- a/scripts/make_win_bin_dist +++ b/scripts/make_win_bin_dist @@ -249,6 +249,7 @@ cp include/mysql.h \ include/decimal.h \ include/errmsg.h \ include/my_global.h \ + include/my_config.h \ include/my_net.h \ include/my_getopt.h \ include/sslopt-longopts.h \ From e32c25628793455b7537022d679f8a80913edd4f Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Tue, 4 May 2010 12:34:00 +0200 Subject: [PATCH 02/19] Put back SELinux files --- support-files/mysql.spec.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh index 764c67b85c7..0016c456b60 100644 --- a/support-files/mysql.spec.sh +++ b/support-files/mysql.spec.sh @@ -442,6 +442,7 @@ MBD=$RPM_BUILD_DIR/%{src_dir} install -d $RBR%{_sysconfdir}/{logrotate.d,init.d} install -d $RBR%{mysqldatadir}/mysql install -d $RBR%{_datadir}/mysql-test +install -d $RBR%{_datadir}/mysql/SELinux/RHEL4 install -d $RBR%{_includedir} install -d $RBR%{_libdir} install -d $RBR%{_mandir} @@ -470,6 +471,10 @@ ln -s %{_sysconfdir}/init.d/mysql $RBR%{_sbindir}/rcmysql # Just to make sure it's in the file list and marked as a config file touch $RBR%{_sysconfdir}/my.cnf +# Install SELinux files in datadir +install -m 600 $MBD/support-files/RHEL4-SElinux/mysql.{fc,te} \ + $RBR%{_datadir}/mysql/SELinux/RHEL4 + %if %{WITH_TCMALLOC} # Even though this is a shared library, put it under /usr/lib*/mysql, so it # doesn't conflict with possible shared lib by the same name in /usr/lib*. See From 0187562f0171f0eb411e384024b5dd73736a6a70 Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Tue, 4 May 2010 14:03:10 +0200 Subject: [PATCH 03/19] fix --- support-files/mysql.spec.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh index 0016c456b60..c8d34528a8b 100644 --- a/support-files/mysql.spec.sh +++ b/support-files/mysql.spec.sh @@ -472,7 +472,7 @@ ln -s %{_sysconfdir}/init.d/mysql $RBR%{_sbindir}/rcmysql touch $RBR%{_sysconfdir}/my.cnf # Install SELinux files in datadir -install -m 600 $MBD/support-files/RHEL4-SElinux/mysql.{fc,te} \ +install -m 600 $MBD/release/support-files/RHEL4-SElinux/mysql.{fc,te} \ $RBR%{_datadir}/mysql/SELinux/RHEL4 %if %{WITH_TCMALLOC} From 58b15f80581c2c7aef2ef568cffb88bba0c3dc93 Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Tue, 4 May 2010 15:41:42 +0200 Subject: [PATCH 04/19] Ok, let's try, one more time --- support-files/mysql.spec.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh index c8d34528a8b..6f033bc8546 100644 --- a/support-files/mysql.spec.sh +++ b/support-files/mysql.spec.sh @@ -472,7 +472,7 @@ ln -s %{_sysconfdir}/init.d/mysql $RBR%{_sbindir}/rcmysql touch $RBR%{_sysconfdir}/my.cnf # Install SELinux files in datadir -install -m 600 $MBD/release/support-files/RHEL4-SElinux/mysql.{fc,te} \ +install -m 600 $MBD/%{src_dir}/support-files/RHEL4-SElinux/mysql.{fc,te} \ $RBR%{_datadir}/mysql/SELinux/RHEL4 %if %{WITH_TCMALLOC} From 2c9803580f3495895b9ccd86bff1492105416340 Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Wed, 5 May 2010 13:49:03 +0200 Subject: [PATCH 05/19] Build all plugins. Try to fix ia64/icc builds. --- cmake/build_configurations/mysql_release.cmake | 3 --- config.h.cmake | 1 + plugin/audit_null/CMakeLists.txt | 3 ++- plugin/daemon_example/CMakeLists.txt | 3 ++- plugin/fulltext/CMakeLists.txt | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cmake/build_configurations/mysql_release.cmake b/cmake/build_configurations/mysql_release.cmake index eeef9f04544..dd1015ff9b9 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 "") diff --git a/config.h.cmake b/config.h.cmake index f0473c83af6..b3b234a153b 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -38,6 +38,7 @@ #cmakedefine HAVE_FPU_CONTROL_H 1 #cmakedefine HAVE_GRP_H 1 #cmakedefine HAVE_EXPLICIT_TEMPLATE_INSTANTIATION 1 +#cmakedefine HAVE_IA64INTRIN_H 1 #cmakedefine HAVE_IEEEFP_H 1 #cmakedefine HAVE_INTTYPES_H 1 #cmakedefine HAVE_LIMITS_H 1 diff --git a/plugin/audit_null/CMakeLists.txt b/plugin/audit_null/CMakeLists.txt index 9f32181a163..4baa1da35fe 100644 --- a/plugin/audit_null/CMakeLists.txt +++ b/plugin/audit_null/CMakeLists.txt @@ -13,4 +13,5 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -MYSQL_ADD_PLUGIN(audit_null audit_null.c) +MYSQL_ADD_PLUGIN(audit_null audit_null.c + MODULE_ONLY MODULE_OUTPUT_NAME "adt_null") diff --git a/plugin/daemon_example/CMakeLists.txt b/plugin/daemon_example/CMakeLists.txt index 1c21d57b326..abb9a0d49df 100644 --- a/plugin/daemon_example/CMakeLists.txt +++ b/plugin/daemon_example/CMakeLists.txt @@ -13,4 +13,5 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -MYSQL_ADD_PLUGIN(daemon_example daemon_example.cc MODULE_ONLY) +MYSQL_ADD_PLUGIN(daemon_example daemon_example.cc + MODULE_ONLY MODULE_NAME "libdaemon_example") diff --git a/plugin/fulltext/CMakeLists.txt b/plugin/fulltext/CMakeLists.txt index ea71552a37a..394cb8dc51d 100644 --- a/plugin/fulltext/CMakeLists.txt +++ b/plugin/fulltext/CMakeLists.txt @@ -13,5 +13,5 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -MYSQL_ADD_PLUGIN(ftexample plugin_example.c MODULE_ONLY MODULE_OUTPUT_NAME mypluglib) +MYSQL_ADD_PLUGIN(ftexample plugin_example.c + MODULE_ONLY MODULE_OUTPUT_NAME "mypluglib") From 9f282523859643a1c0b3c9825bd661e4a603aa5a Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Wed, 5 May 2010 14:28:02 +0200 Subject: [PATCH 06/19] fix syntax error --- plugin/daemon_example/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/daemon_example/CMakeLists.txt b/plugin/daemon_example/CMakeLists.txt index abb9a0d49df..de4310b0244 100644 --- a/plugin/daemon_example/CMakeLists.txt +++ b/plugin/daemon_example/CMakeLists.txt @@ -14,4 +14,4 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA MYSQL_ADD_PLUGIN(daemon_example daemon_example.cc - MODULE_ONLY MODULE_NAME "libdaemon_example") + MODULE_ONLY MODULE_OUTPUT_NAME "libdaemon_example") From f9d9388527f51825d6f81bf804b2f705533115dd Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Wed, 5 May 2010 15:23:34 +0200 Subject: [PATCH 07/19] Add all plugins --- support-files/mysql.spec.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh index 6f033bc8546..3ad9eebd657 100644 --- a/support-files/mysql.spec.sh +++ b/support-files/mysql.spec.sh @@ -732,12 +732,16 @@ fi %attr(755, root, root) %{_sbindir}/mysqld %attr(755, root, root) %{_sbindir}/mysqld-debug %attr(755, root, root) %{_sbindir}/rcmysql +%attr(755, root, root) %{_libdir}/mysql/plugin/adt_null.so +%attr(755, root, root) %{_libdir}/mysql/plugin/libdaemon_example.so %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/semisync_master.so +%attr(755, root, root) %{_libdir}/mysql/plugin/semisync_slave.so +%attr(755, root, root) %{_libdir}/mysql/plugin/debug/adt_null.so +%attr(755, root, root) %{_libdir}/mysql/plugin/debug/libdaemon_example.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* +%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} From 63fbe9cce8bafbbb65a54294c958f5ce9c5f05ee Mon Sep 17 00:00:00 2001 From: Kent Boortz Date: Wed, 5 May 2010 17:50:22 +0200 Subject: [PATCH 08/19] Output the config.h defines to stdout --- support-files/mysql.spec.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh index 3ad9eebd657..e3944805368 100644 --- a/support-files/mysql.spec.sh +++ b/support-files/mysql.spec.sh @@ -396,6 +396,7 @@ mkdir debug -DFEATURE_SET="%{feature_set}" \ -DCOMPILATION_COMMENT="%{compilation_comment_debug}" \ -DMYSQL_SERVER_SUFFIX="%{server_suffix}" + echo BEGIN_DEBUG_CONFIG ; egrep '^#define' include/config.h ; echo END_DEBUG_CONFIG make VERBOSE=1 ) # Build full release @@ -410,6 +411,7 @@ mkdir release -DFEATURE_SET="%{feature_set}" \ -DCOMPILATION_COMMENT="%{compilation_comment_release}" \ -DMYSQL_SERVER_SUFFIX="%{server_suffix}" + echo BEGIN_NORMAL_CONFIG ; egrep '^#define' include/config.h ; echo END_NORMAL_CONFIG make VERBOSE=1 ) From c8432bfbcc6dcdc5c1bc106b6132d0814e739a1b Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Wed, 5 May 2010 19:27:21 +0200 Subject: [PATCH 09/19] Try an ia64 fix --- support-files/mysql.spec.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh index e3944805368..540fef6def6 100644 --- a/support-files/mysql.spec.sh +++ b/support-files/mysql.spec.sh @@ -363,6 +363,9 @@ touch optional-files-devel # not require C++ features such as exceptions, and may need to be removed at # a later date. # +%if "%{_arch}" == "ia64" +RPM_OPT_FLAGS= +%endif export PATH=${MYSQL_BUILD_PATH:-$PATH} export CC=${MYSQL_BUILD_CC:-${CC:-gcc}} export CXX=${MYSQL_BUILD_CXX:-${CXX:-gcc}} From af941670abbb84b32cdb80a4c87e95a5d5594895 Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Wed, 5 May 2010 23:03:38 +0200 Subject: [PATCH 10/19] Update comment --- support-files/mysql.spec.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh index 540fef6def6..fcdcb096d01 100644 --- a/support-files/mysql.spec.sh +++ b/support-files/mysql.spec.sh @@ -363,9 +363,14 @@ touch optional-files-devel # not require C++ features such as exceptions, and may need to be removed at # a later date. # + +# This is a hack, $RPM_OPT_FLAGS on ia64 hosts contains flags which break +# the compile in cmd-line-utils/readline - needs investigation, but for now +# we simply unset it and use those specified directly in cmake. %if "%{_arch}" == "ia64" RPM_OPT_FLAGS= %endif + export PATH=${MYSQL_BUILD_PATH:-$PATH} export CC=${MYSQL_BUILD_CC:-${CC:-gcc}} export CXX=${MYSQL_BUILD_CXX:-${CXX:-gcc}} From e31887f2ed9a5dd58345f8fd6d28e0729710ac96 Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Thu, 6 May 2010 15:20:14 +0200 Subject: [PATCH 11/19] Tidy install layout. Remove 'ROOT' from sql-bench dir variable, it's unnecessary. --- cmake/install_layout.cmake | 195 +++++++++++++++++++++---------------- sql-bench/CMakeLists.txt | 6 +- 2 files changed, 113 insertions(+), 88 deletions(-) diff --git a/cmake/install_layout.cmake b/cmake/install_layout.cmake index 296bebd3bb0..ade6cdb747f 100755 --- a/cmake/install_layout.cmake +++ b/cmake/install_layout.cmake @@ -40,18 +40,25 @@ # # - 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_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) +# - 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) IF(NOT INSTALL_LAYOUT) SET(DEFAULT_INSTALL_LAYOUT "STANDALONE") @@ -60,15 +67,6 @@ 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") -# # XXX not keen on this, how many more will we need? prefer to just bail... -# IF(NOT INSTALL_LAYOUT MATCHES "SVR4") -# SET(INSTALL_LAYOUT "${DEFAULT_INSTALL_LAYOUT}") -# ENDIF() -# ENDIF() -#ENDIF() - IF(UNIX) IF(INSTALL_LAYOUT MATCHES "RPM") SET(default_prefix "/usr") @@ -90,84 +88,111 @@ IF(UNIX) 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_INFODIR_STANDALONE "docs") -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") +# +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_INCLUDEDIR_RPM "include/mysql") -IF(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64") - SET(INSTALL_LIBDIR_RPM "lib64") -ELSE() - SET(INSTALL_LIBDIR_RPM "lib") -ENDIF() -SET(INSTALL_SBINDIR_RPM "sbin") -SET(INSTALL_SHAREDIR_RPM "share") +SET(INSTALL_BINDIR_RPM "bin") +SET(INSTALL_SBINDIR_RPM "sbin") +SET(INSTALL_SCRIPTDIR_RPM "bin") # -#SET(INSTALL_DOCDIR_RPM "XXXunset") -#SET(INSTALL_DOCREADMEDIR_RPM "${INSTALL_DOCDIR_RPM}") -SET(INSTALL_INFODIR_RPM "${INSTALL_SHAREDIR_RPM}/info") -SET(INSTALL_MANDIR_RPM "${INSTALL_SHAREDIR_RPM}/man") -SET(INSTALL_MYSQLDATADIR_RPM "/var/lib/mysql") -SET(INSTALL_MYSQLSHAREDIR_RPM "${INSTALL_SHAREDIR_RPM}/mysql") -SET(INSTALL_MYSQLTESTDIR_RPM "${INSTALL_SHAREDIR_RPM}/mysql-test") -SET(INSTALL_PLUGINDIR_RPM "${INSTALL_LIBDIR_RPM}/mysql/plugin") -SET(INSTALL_SCRIPTDIR_RPM "${INSTALL_BINDIR_RPM}") -SET(INSTALL_SQLBENCHROOTDIR_RPM "") -SET(INSTALL_SUPPORTFILESDIR_RPM "${INSTALL_SHAREDIR_RPM}/mysql") +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_LIBDIR_DEB "lib") -SET(INSTALL_INCLUDEDIR_DEB "include") -SET(INSTALL_PLUGINDIR_DEB "lib/plugin") -SET(INSTALL_DOCDIR_DEB "docs") -SET(INSTALL_MANDIR_DEB "man") -SET(INSTALL_INFODIR_DEB "docs") -SET(INSTALL_MYSQLSHAREDIR_DEB "share") -SET(INSTALL_SHAREDIR_DEB "share") -SET(INSTALL_SCRIPTDIR_DEB "scripts") -SET(INSTALL_MYSQLTESTDIR_DEB "mysql-test") -SET(INSTALL_SQLBENCHROOTDIR_DEB ".") -SET(INSTALL_DOCREADMEDIR_DEB ".") -SET(INSTALL_SUPPORTFILESDIR_DEB "support-files") -SET(INSTALL_MYSQLDATADIR_DEB "data") +# +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_LIBDIR_SVR4 "lib") -SET(INSTALL_INCLUDEDIR_SVR4 "include") -SET(INSTALL_PLUGINDIR_SVR4 "lib/plugin") -SET(INSTALL_DOCDIR_SVR4 "docs") -SET(INSTALL_MANDIR_SVR4 "man") -SET(INSTALL_INFODIR_SVR4 "docs") -SET(INSTALL_MYSQLSHAREDIR_SVR4 "share") -SET(INSTALL_SHAREDIR_SVR4 "share") -SET(INSTALL_SCRIPTDIR_SVR4 "scripts") -SET(INSTALL_MYSQLTESTDIR_SVR4 "mysql-test") -SET(INSTALL_SQLBENCHROOTDIR_SVR4 ".") -SET(INSTALL_DOCREADMEDIR_SVR4 ".") -SET(INSTALL_SUPPORTFILESDIR_SVR4 "support-files") -SET(INSTALL_MYSQLDATADIR_SVR4 "/var/lib/mysql") +# +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 IF(OLD_INSTALL_LAYOUT) @@ -181,7 +206,7 @@ SET(OLD_INSTALL_LAYOUT ${INSTALL_LAYOUT} CACHE INTERNAL "") # 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 SQLBENCHROOT DOCREADME SUPPORTFILES MYSQLDATA) + 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) diff --git a/sql-bench/CMakeLists.txt b/sql-bench/CMakeLists.txt index 4b7f9520cc1..be0aeca70b0 100644 --- a/sql-bench/CMakeLists.txt +++ b/sql-bench/CMakeLists.txt @@ -21,14 +21,14 @@ ${CMAKE_SOURCE_DIR}/sql-bench/Data/Wisconsin/* ${CMAKE_SOURCE_DIR}/sql-bench/limits/* ) -IF(NOT INSTALL_SQLBENCHROOTDIR) +IF(NOT INSTALL_SQLBENCHDIR) RETURN() ENDIF() -IF(INSTALL_SQLBENCHROOTDIR STREQUAL ".") +IF(INSTALL_SQLBENCHDIR STREQUAL ".") SET(prefix) ELSE() - SET(prefix ${INSTALL_SQLBENCHROOTDIR}/) + SET(prefix ${INSTALL_SQLBENCHDIR}/) ENDIF() GET_FILENAME_COMPONENT(basedir ${CMAKE_SOURCE_DIR} ABSOLUTE) From 5230aa7a5e7275c4b9da3b612ddad8f3370e10b5 Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Fri, 7 May 2010 12:11:09 +0200 Subject: [PATCH 12/19] Explicitly set OSX flags, to match current release. --- cmake/build_configurations/mysql_release.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/build_configurations/mysql_release.cmake b/cmake/build_configurations/mysql_release.cmake index dd1015ff9b9..97de0965f6b 100644 --- a/cmake/build_configurations/mysql_release.cmake +++ b/cmake/build_configurations/mysql_release.cmake @@ -141,8 +141,8 @@ IF(UNIX) # 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 From b5164c140178132018a1d4bdff95048b4d8ff4dc Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Wed, 12 May 2010 14:12:20 +0200 Subject: [PATCH 13/19] Pointless commit to avoid unnecessary diffs and to trigger a new build --- support-files/mysql.spec.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh index fcdcb096d01..2ed3b1ff788 100644 --- a/support-files/mysql.spec.sh +++ b/support-files/mysql.spec.sh @@ -10,7 +10,7 @@ # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program; see the file COPYING. If not, write to the +# along with this program; see the file COPYING. If not, write to the # Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston # MA 02110-1301 USA. From 08e457cc52d52c8d43b3e38e69254ee01b09db8b Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Fri, 14 May 2010 13:00:37 +0200 Subject: [PATCH 14/19] Null commit to test changes. From bb6c611314e6fef51fb31e797b7c61598f33f671 Mon Sep 17 00:00:00 2001 From: Kent Boortz Date: Tue, 18 May 2010 14:25:02 +0200 Subject: [PATCH 15/19] config.h.cmake - Added missing HAVE_SYS_TIMES_H, HAVE_SYS_TIME_H, HAVE_TIME_H, HAVE_TIME and HAVE_TIMES - Removed most #if constructs, keep logic in "configure.cmake" - Use space after # if inside #if, for consistency configure.cmake - Added MY_CHECK_TYPE_SIZE function that sets both SIZEOF_* and HAVE_* - If "sys/stream.h" exists, include it before "sys/ptem.h" in test - Set VOID_SIGHANDLER if RETSIGTYPE is set to "void" --- config.h.cmake | 127 ++++++++++++++---------------------------------- configure.cmake | 82 ++++++++++++++++--------------- 2 files changed, 78 insertions(+), 131 deletions(-) diff --git a/config.h.cmake b/config.h.cmake index b3b234a153b..cd9305e2b4f 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -81,6 +81,8 @@ #cmakedefine HAVE_SYS_STREAM_H 1 #cmakedefine HAVE_SYS_TERMCAP_H 1 #cmakedefine HAVE_SYS_TIMEB_H 1 +#cmakedefine HAVE_SYS_TIMES_H 1 +#cmakedefine HAVE_SYS_TIME_H 1 #cmakedefine HAVE_SYS_TYPES_H 1 #cmakedefine HAVE_SYS_UN_H 1 #cmakedefine HAVE_SYS_VADVISE_H 1 @@ -88,6 +90,7 @@ #cmakedefine HAVE_TERMIOS_H 1 #cmakedefine HAVE_TERMIO_H 1 #cmakedefine HAVE_TERMCAP_H 1 +#cmakedefine HAVE_TIME_H 1 #cmakedefine HAVE_UNISTD_H 1 #cmakedefine HAVE_UTIME_H 1 #cmakedefine HAVE_VARARGS_H 1 @@ -261,6 +264,8 @@ #cmakedefine HAVE_TEMPNAM 1 #cmakedefine HAVE_THR_SETCONCURRENCY 1 #cmakedefine HAVE_THR_YIELD 1 +#cmakedefine HAVE_TIME 1 +#cmakedefine HAVE_TIMES 1 #cmakedefine HAVE_VALLOC 1 #define HAVE_VIO_READ_BUFF 1 #cmakedefine HAVE_VASPRINTF 1 @@ -293,11 +298,6 @@ /* Types we may use */ -#cmakedefine SIZEOF_CHAR @SIZEOF_CHAR@ -#if SIZEOF_CHAR -# define HAVE_CHAR 1 -#endif - #ifdef __APPLE__ /* Special handling required for OSX to support universal binaries that @@ -316,119 +316,64 @@ #cmakedefine SIZEOF_SIZE_T @SIZEOF_CHARP@ #endif -#if SIZEOF_LONG -# define HAVE_LONG 1 -#endif - - +#cmakedefine SIZEOF_CHAR @SIZEOF_CHAR@ +#cmakedefine HAVE_CHAR 1 +#cmakedefine HAVE_LONG 1 +#cmakedefine HAVE_CHARP 1 #if SIZEOF_CHARP -#define HAVE_CHARP 1 -#define SIZEOF_VOIDP SIZEOF_CHARP +# define SIZEOF_VOIDP SIZEOF_CHARP #endif - #cmakedefine SIZEOF_SHORT @SIZEOF_SHORT@ -#if SIZEOF_SHORT -# define HAVE_SHORT 1 -#endif - +#cmakedefine HAVE_SHORT 1 #cmakedefine SIZEOF_INT @SIZEOF_INT@ -#if SIZEOF_INT -# define HAVE_INT 1 -#endif - - +#cmakedefine HAVE_INT 1 #cmakedefine SIZEOF_LONG_LONG @SIZEOF_LONG_LONG@ -#if SIZEOF_LONG_LONG -# define HAVE_LONG_LONG 1 -#endif - +#cmakedefine HAVE_LONG_LONG 1 #cmakedefine SIZEOF_OFF_T @SIZEOF_OFF_T@ -#if SIZEOF_OFF_T -#define HAVE_OFF_T 1 -#endif - +#cmakedefine HAVE_OFF_T 1 #cmakedefine SIZEOF_SIGSET_T @SIZEOF_SIGSET_T@ -#if SIZEOF_SIGSET_T -#define HAVE_SIGSET_T 1 -#endif - -#if SIZEOF_SIZE_T -#define HAVE_SIZE_T 1 -#endif - +#cmakedefine HAVE_SIGSET_T 1 +#cmakedefine SIZEOF_SIZE_T @SIZEOF_SIZE_T@ +#cmakedefine HAVE_SIZE_T 1 #cmakedefine SIZEOF_UCHAR @SIZEOF_UCHAR@ -#if SIZEOF_UCHAR -#define HAVE_UCHAR 1 -#endif - +#cmakedefine HAVE_UCHAR 1 #cmakedefine SIZEOF_UINT @SIZEOF_UINT@ -#if SIZEOF_UINT -#define HAVE_UINT 1 -#endif - +#cmakedefine HAVE_UINT 1 #cmakedefine SIZEOF_ULONG @SIZEOF_ULONG@ -#if SIZEOF_ULONG -#define HAVE_ULONG 1 -#endif - +#cmakedefine HAVE_ULONG 1 #cmakedefine SIZEOF_INT8 @SIZEOF_INT8@ -#if SIZEOF_INT8 -#define HAVE_INT8 1 -#endif +#cmakedefine HAVE_INT8 1 #cmakedefine SIZEOF_UINT8 @SIZEOF_UINT8@ -#if SIZEOF_UINT8 -#define HAVE_UINT8 1 -#endif - +#cmakedefine HAVE_UINT8 1 #cmakedefine SIZEOF_INT16 @SIZEOF_INT16@ -#if SIZEOF_INT16 -# define HAVE_INT16 1 -#endif +#cmakedefine HAVE_INT16 1 #cmakedefine SIZEOF_UINT16 @SIZEOF_UINT16@ -#if SIZEOF_UINT16 -#define HAVE_UINT16 1 -#endif - +#cmakedefine HAVE_UINT16 1 #cmakedefine SIZEOF_INT32 @SIZEOF_INT32@ -#if SIZEOF_INT32 -#define HAVE_INT32 1 -#endif +#cmakedefine HAVE_INT32 1 #cmakedefine SIZEOF_UINT32 @SIZEOF_UINT32@ -#if SIZEOF_UINT32 -#define HAVE_UINT32 1 -#endif +#cmakedefine HAVE_UINT32 1 #cmakedefine SIZEOF_U_INT32_T @SIZEOF_U_INT32_T@ -#if SIZEOF_U_INT32_T -#define HAVE_U_INT32_T 1 -#endif - +#cmakedefine HAVE_U_INT32_T 1 #cmakedefine SIZEOF_INT64 @SIZEOF_INT64@ -#if SIZEOF_INT64 -#define HAVE_INT64 1 -#endif +#cmakedefine HAVE_INT64 1 #cmakedefine SIZEOF_UINT64 @SIZEOF_UINT64@ -#if SIZEOF_UINT64 -#define HAVE_UINT64 1 -#endif +#cmakedefine HAVE_UINT64 1 +#cmakedefine SIZEOF_BOOL @SIZEOF_BOOL@ +#cmakedefine HAVE_BOOL 1 #cmakedefine SOCKET_SIZE_TYPE @SOCKET_SIZE_TYPE@ -#cmakedefine SIZEOF_BOOL @SIZEOF_BOOL@ -#if SIZEOF_BOOL -#define HAVE_BOOL 1 -#endif #cmakedefine HAVE_MBSTATE_T #define MAX_INDEXES 64 #cmakedefine QSORT_TYPE_IS_VOID 1 -#define RETQSORTTYPE void +#cmakedefine RETQSORTTYPE @RETQSORTTYPE@ #cmakedefine SIGNAL_RETURN_TYPE_IS_VOID 1 -#define RETSIGTYPE void -#if SIGNAL_RETURN_TYPE_IS_VOID -#define VOID_SIGHANDLER 1 -#endif +#cmakedefine RETSIGTYPE @RETSIGTYPE@ +#cmakedefine VOID_SIGHANDLER 1 #define STRUCT_RLIMIT struct rlimit #ifdef __APPLE__ @@ -545,7 +490,7 @@ #cmakedefine strtoull @strtoull@ #cmakedefine vsnprintf @vsnprintf@ #if (_MSC_VER > 1310) -#define HAVE_SETENV +# define HAVE_SETENV #define setenv(a,b,c) _putenv_s(a,b) #endif @@ -635,7 +580,7 @@ #cmakedefine WITH_PERFSCHEMA_STORAGE_ENGINE 1 #cmakedefine WITH_NDBCLUSTER_STORAGE_ENGINE 1 #if (WITH_NDBCLUSTER_STORAGE_ENGINE) && !defined(EMBEDDED_LIBRARY) -#define HAVE_NDB_BINLOG 1 +# define HAVE_NDB_BINLOG 1 #endif #cmakedefine DEFAULT_MYSQL_HOME "@DEFAULT_MYSQL_HOME@" diff --git a/configure.cmake b/configure.cmake index 31e38aaa2cd..0dc32b08226 100644 --- a/configure.cmake +++ b/configure.cmake @@ -81,6 +81,13 @@ ENDIF(WITHOUT_DYNAMIC_PLUGINS) # Large files, common flag SET(_LARGEFILE_SOURCE 1) +# If finds the size of a type, set SIZEOF_ and HAVE_ +FUNCTION(MY_CHECK_TYPE_SIZE type defbase) + CHECK_TYPE_SIZE("${type}" SIZEOF_${defbase}) + IF(SIZEOF_${defbase}) + SET(HAVE_${defbase} 1 PARENT_SCOPE) + ENDIF() +ENDFUNCTION() # Searches function in libraries # if function is found, sets output parameter result to the name of the library @@ -186,7 +193,6 @@ CHECK_INCLUDE_FILES (select.h HAVE_SELECT_H) CHECK_INCLUDE_FILES (semaphore.h HAVE_SEMAPHORE_H) CHECK_INCLUDE_FILES (sys/dir.h HAVE_SYS_DIR_H) CHECK_INCLUDE_FILES (sys/pte.h HAVE_SYS_PTE_H) -CHECK_INCLUDE_FILES (sys/ptem.h HAVE_SYS_PTEM_H) CHECK_INCLUDE_FILES (stddef.h HAVE_STDDEF_H) CHECK_INCLUDE_FILES (stdint.h HAVE_STDINT_H) CHECK_INCLUDE_FILES (stdlib.h HAVE_STDLIB_H) @@ -226,6 +232,13 @@ CHECK_INCLUDE_FILES (fnmatch.h HAVE_FNMATCH_H) CHECK_INCLUDE_FILES (stdarg.h HAVE_STDARG_H) CHECK_INCLUDE_FILES("stdlib.h;sys/un.h" HAVE_SYS_UN_H) +IF(HAVE_SYS_STREAM_H) + # Needs sys/stream.h on Solaris + CHECK_INCLUDE_FILES (sys/stream.h sys/ptem.h HAVE_SYS_PTEM_H) +ELSE() + CHECK_INCLUDE_FILES (sys/ptem.h HAVE_SYS_PTEM_H) +ENDIF() + # Figure out threading library # FIND_PACKAGE (Threads) @@ -449,14 +462,11 @@ set(CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} -D_LARGEFILE_SOURCE -D_LARGE_FILES -D_FILE_OFFSET_BITS=64 -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS) SET(CMAKE_EXTRA_INCLUDE_FILES signal.h) -CHECK_TYPE_SIZE(sigset_t SIZEOF_SIGSET_T) -IF(SIZEOF_SIGSET_T) - SET(HAVE_SIGSET_T 1) -ENDIF() +MY_CHECK_TYPE_SIZE(sigset_t SIGSET_T) IF(NOT SIZEOF_SIGSET_T) SET(sigset_t int) ENDIF() -CHECK_TYPE_SIZE(mode_t SIZEOF_MODE_T) +MY_CHECK_TYPE_SIZE(mode_t MODE_T) IF(NOT SIZEOF_MODE_T) SET(mode_t int) ENDIF() @@ -469,43 +479,40 @@ ENDIF(HAVE_STDINT_H) IF(NOT APPLE) # Prevent some checks on OSX, they return ambigious results # on universal 32/64 bit binariess - CHECK_TYPE_SIZE("char *" SIZEOF_CHARP) - CHECK_TYPE_SIZE(long SIZEOF_LONG) - CHECK_TYPE_SIZE(size_t SIZEOF_SIZE_T) + MY_CHECK_TYPE_SIZE("char *" CHARP) + MY_CHECK_TYPE_SIZE(long LONG) + MY_CHECK_TYPE_SIZE(size_t SIZE_T) ENDIF() -CHECK_TYPE_SIZE(char SIZEOF_CHAR) -CHECK_TYPE_SIZE(short SIZEOF_SHORT) -CHECK_TYPE_SIZE(int SIZEOF_INT) -CHECK_TYPE_SIZE("long long" SIZEOF_LONG_LONG) +MY_CHECK_TYPE_SIZE(char CHAR) +MY_CHECK_TYPE_SIZE(short SHORT) +MY_CHECK_TYPE_SIZE(int INT) +MY_CHECK_TYPE_SIZE("long long" LONG_LONG) SET(CMAKE_EXTRA_INCLUDE_FILES stdio.h sys/types.h) -CHECK_TYPE_SIZE(off_t SIZEOF_OFF_T) -CHECK_TYPE_SIZE(uchar SIZEOF_UCHAR) -CHECK_TYPE_SIZE(uint SIZEOF_UINT) -CHECK_TYPE_SIZE(ulong SIZEOF_ULONG) -CHECK_TYPE_SIZE(int8 SIZEOF_INT8) -CHECK_TYPE_SIZE(uint8 SIZEOF_UINT8) -CHECK_TYPE_SIZE(int16 SIZEOF_INT16) -CHECK_TYPE_SIZE(uint16 SIZEOF_UINT16) -CHECK_TYPE_SIZE(int32 SIZEOF_INT32) -CHECK_TYPE_SIZE(uint32 SIZEOF_UINT32) -CHECK_TYPE_SIZE(u_int32_t SIZEOF_U_INT32_T) -CHECK_TYPE_SIZE(int64 SIZEOF_INT64) -CHECK_TYPE_SIZE(uint64 SIZEOF_UINT64) +MY_CHECK_TYPE_SIZE(off_t OFF_T) +MY_CHECK_TYPE_SIZE(uchar UCHAR) +MY_CHECK_TYPE_SIZE(uint UINT) +MY_CHECK_TYPE_SIZE(ulong ULONG) +MY_CHECK_TYPE_SIZE(int8 INT8) +MY_CHECK_TYPE_SIZE(uint8 UINT8) +MY_CHECK_TYPE_SIZE(int16 INT16) +MY_CHECK_TYPE_SIZE(uint16 UINT16) +MY_CHECK_TYPE_SIZE(int32 INT32) +MY_CHECK_TYPE_SIZE(uint32 UINT32) +MY_CHECK_TYPE_SIZE(u_int32_t U_INT32_T) +MY_CHECK_TYPE_SIZE(int64 INT64) +MY_CHECK_TYPE_SIZE(uint64 UINT64) SET (CMAKE_EXTRA_INCLUDE_FILES sys/types.h) -CHECK_TYPE_SIZE(bool SIZEOF_BOOL) +MY_CHECK_TYPE_SIZE(bool BOOL) SET(CMAKE_EXTRA_INCLUDE_FILES) IF(HAVE_SYS_SOCKET_H) SET(CMAKE_EXTRA_INCLUDE_FILES sys/socket.h) ENDIF(HAVE_SYS_SOCKET_H) -CHECK_TYPE_SIZE(socklen_t SIZEOF_SOCKLEN_T) +MY_CHECK_TYPE_SIZE(socklen_t SOCKLEN_T) SET(CMAKE_EXTRA_INCLUDE_FILES) IF(HAVE_IEEEFP_H) SET(CMAKE_EXTRA_INCLUDE_FILES ieeefp.h) - CHECK_TYPE_SIZE(fp_except SIZEOF_FP_EXCEPT) - IF(SIZEOF_FP_EXCEPT) - SET(HAVE_FP_EXCEPT TRUE) - ENDIF() + MY_CHECK_TYPE_SIZE(fp_except FP_EXCEPT) ENDIF() @@ -669,6 +676,7 @@ int main(int ac, char **av) {} " SIGNAL_RETURN_TYPE_IS_VOID) IF(SIGNAL_RETURN_TYPE_IS_VOID) SET(RETSIGTYPE void) + SET(VOID_SIGHANDLER 1) ELSE(SIGNAL_RETURN_TYPE_IS_VOID) SET(RETSIGTYPE int) ENDIF(SIGNAL_RETURN_TYPE_IS_VOID) @@ -973,14 +981,8 @@ ELSEIF(WIN32) SET(CMAKE_EXTRA_INCLUDE_FILES ${CMAKE_EXTRA_INCLUDE_FILES} winsock2.h ws2ipdef.h) ENDIF() -CHECK_TYPE_SIZE("struct sockaddr_in6" SIZEOF_SOCKADDR_IN6) -CHECK_TYPE_SIZE("struct in6_addr" SIZEOF_IN6_ADDR) -IF(SIZEOF_SOCKADDR_IN6) - SET(HAVE_STRUCT_SOCKADDR_IN6 1) -ENDIF() -IF(SIZEOF_IN6_ADDR) - SET(HAVE_STRUCT_IN6_ADDR 1) -ENDIF() +MY_CHECK_TYPE_SIZE("struct sockaddr_in6" SOCKADDR_IN6) +MY_CHECK_TYPE_SIZE("struct in6_addr" IN6_ADDR) IF(HAVE_STRUCT_SOCKADDR_IN6 OR HAVE_STRUCT_IN6_ADDR) SET(HAVE_IPV6 TRUE CACHE INTERNAL "") From 497abee8f31732367ee3c7d74c0cd56313535609 Mon Sep 17 00:00:00 2001 From: Kent Boortz Date: Fri, 21 May 2010 01:40:12 +0200 Subject: [PATCH 16/19] config.h.cmake - Set SIZEOF_VOIDP the same way as others - Unindent the no Mac OS settings, to let the checker scripts find the lines - Removed duplicate SIZEOF_SIZE_T setting - Added missing value for HAVE_CHARSET_ascii configure.cmake - Added HAVE_ prefix to library names, like HAVE_LIBM - Set HAVE_CXXABI_H if header is found, HAVE_ABI_CXA_DEMANGLE controls if useful - Set SIZEOF_VOIDP the same way as others --- config.h.cmake | 15 +++++++-------- configure.cmake | 9 ++++----- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/config.h.cmake b/config.h.cmake index cd9305e2b4f..f93cc18a0bc 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -308,21 +308,21 @@ #else #define SIZEOF_LONG 4 #endif + #define SIZEOF_VOIDP SIZEOF_LONG #define SIZEOF_CHARP SIZEOF_LONG #define SIZEOF_SIZE_T SIZEOF_LONG #else - #cmakedefine SIZEOF_LONG @SIZEOF_LONG@ - #cmakedefine SIZEOF_CHARP @SIZEOF_CHARP@ - #cmakedefine SIZEOF_SIZE_T @SIZEOF_CHARP@ +# No indentation, to fetch the lines from verification scripts +#cmakedefine SIZEOF_LONG @SIZEOF_LONG@ +#cmakedefine SIZEOF_VOIDP @SIZEOF_VOIDP@ +#cmakedefine SIZEOF_CHARP @SIZEOF_CHARP@ +#cmakedefine SIZEOF_SIZE_T @SIZEOF_CHARP@ #endif #cmakedefine SIZEOF_CHAR @SIZEOF_CHAR@ #cmakedefine HAVE_CHAR 1 #cmakedefine HAVE_LONG 1 #cmakedefine HAVE_CHARP 1 -#if SIZEOF_CHARP -# define SIZEOF_VOIDP SIZEOF_CHARP -#endif #cmakedefine SIZEOF_SHORT @SIZEOF_SHORT@ #cmakedefine HAVE_SHORT 1 #cmakedefine SIZEOF_INT @SIZEOF_INT@ @@ -333,7 +333,6 @@ #cmakedefine HAVE_OFF_T 1 #cmakedefine SIZEOF_SIGSET_T @SIZEOF_SIGSET_T@ #cmakedefine HAVE_SIGSET_T 1 -#cmakedefine SIZEOF_SIZE_T @SIZEOF_SIZE_T@ #cmakedefine HAVE_SIZE_T 1 #cmakedefine SIZEOF_UCHAR @SIZEOF_UCHAR@ #cmakedefine HAVE_UCHAR 1 @@ -518,7 +517,7 @@ #cmakedefine FN_NO_CASE_SENSE 1 #cmakedefine HAVE_CHARSET_armscii8 1 -#cmakedefine HAVE_CHARSET_ascii +#cmakedefine HAVE_CHARSET_ascii 1 #cmakedefine HAVE_CHARSET_big5 1 #cmakedefine HAVE_CHARSET_cp1250 1 #cmakedefine HAVE_CHARSET_cp1251 1 diff --git a/configure.cmake b/configure.cmake index 0dc32b08226..6734b652676 100644 --- a/configure.cmake +++ b/configure.cmake @@ -105,7 +105,7 @@ FUNCTION(MY_SEARCH_LIBS func libs result) FOREACH(lib ${libs}) CHECK_LIBRARY_EXISTS(${lib} ${func} "" HAVE_${func}_IN_${lib}) IF(HAVE_${func}_IN_${lib}) - SET(${result} ${lib} PARENT_SCOPE) + SET(${result} HAVE_${lib} PARENT_SCOPE) RETURN() ENDIF() ENDFOREACH() @@ -167,6 +167,7 @@ CHECK_INCLUDE_FILES (alloca.h HAVE_ALLOCA_H) CHECK_INCLUDE_FILES (aio.h HAVE_AIO_H) CHECK_INCLUDE_FILES (arpa/inet.h HAVE_ARPA_INET_H) CHECK_INCLUDE_FILES (crypt.h HAVE_CRYPT_H) +CHECK_INCLUDE_FILES (cxxabi.h HAVE_CXXABI_H) CHECK_INCLUDE_FILES (dirent.h HAVE_DIRENT_H) CHECK_INCLUDE_FILES (dlfcn.h HAVE_DLFCN_H) CHECK_INCLUDE_FILES (execinfo.h HAVE_EXECINFO_H) @@ -479,6 +480,7 @@ ENDIF(HAVE_STDINT_H) IF(NOT APPLE) # Prevent some checks on OSX, they return ambigious results # on universal 32/64 bit binariess + MY_CHECK_TYPE_SIZE("void *" VOIDP) MY_CHECK_TYPE_SIZE("char *" CHARP) MY_CHECK_TYPE_SIZE(long LONG) MY_CHECK_TYPE_SIZE(size_t SIZE_T) @@ -776,7 +778,7 @@ ENDIF(NOT HAVE_POSIX_SIGNALS) # Assume regular sprintf SET(SPRINTFS_RETURNS_INT 1) -IF(CMAKE_COMPILER_IS_GNUXX) +IF(CMAKE_COMPILER_IS_GNUXX AND HAVE_CXXABI_H) CHECK_CXX_SOURCE_COMPILES(" #include int main(int argc, char **argv) @@ -786,9 +788,6 @@ CHECK_CXX_SOURCE_COMPILES(" return 0; }" HAVE_ABI_CXA_DEMANGLE) -IF(HAVE_ABI_CXA_DEMANGLE) - SET(HAVE_CXXABI_H 1) -ENDIF() ENDIF() CHECK_C_SOURCE_COMPILES(" From 447846cf3c96c1e729b32a240acfb3e3caa2618b Mon Sep 17 00:00:00 2001 From: Joerg Bruehe Date: Fri, 21 May 2010 19:31:55 +0200 Subject: [PATCH 17/19] Get rid ot the "net retry count" difference which is not needed any more with current versions of FreeBSD. (Entries 52410 and 52412 in the Bug DB) That change is based on Dan Nelson replying on the FreeBSD mailing list, freebsd-questions@freebsd.org in a thread running from 2010-Apr-29 to 2010-May-1 titled "Need info about FreeBSD and interrupted system calls for MySQL code" Also, ensure the cmake settings correspond to the autotools ones: Add "HAVE_BROKEN_REALPATH" to cmake. --- cmake/os/FreeBSD.cmake | 9 ++++++--- configure.in | 14 +++++++++++--- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/cmake/os/FreeBSD.cmake b/cmake/os/FreeBSD.cmake index 0b958c61315..be7af778e93 100644 --- a/cmake/os/FreeBSD.cmake +++ b/cmake/os/FreeBSD.cmake @@ -1,5 +1,5 @@ -# Copyright (C) 2010 Sun Microsystems, Inc +# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -15,6 +15,9 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # This file includes FreeBSD specific options and quirks, related to system checks -#Legacy option, maybe not needed anymore , taken as is from autotools build -ADD_DEFINITIONS(-DNET_RETRY_COUNT=1000000) +# Should not be needed any more, but kept for easy resurrection if needed +# #Legacy option, maybe not needed anymore , taken as is from autotools build +# ADD_DEFINITIONS(-DNET_RETRY_COUNT=1000000) + +ADD_DEFINITIONS(-DHAVE_BROKEN_REALPATH) diff --git a/configure.in b/configure.in index 0a040cc60ee..1d95c11bd5b 100644 --- a/configure.in +++ b/configure.in @@ -1,7 +1,7 @@ dnl -*- ksh -*- dnl Process this file with autoconf to produce a configure script. -# Copyright (C) 2008-2009 Sun Microsystems, Inc +# Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -1235,14 +1235,22 @@ case $SYSTEM_TYPE in fi ;; *freebsd*|*dragonfly*) - AC_MSG_WARN([Adding fix for interrupted reads]) + dnl These dependencies have not really been checked for some time OSVERSION=`sysctl -a | grep osreldate | awk '{ print $2 }'` - if test "$OSVERSION" -gt "480100" && \ + if test "$OSVERSION" -gt "600000" + then + # Post user-level threads, MYSQLD_NET_RETRY_COUNT is not needed any more + AC_MSG_WARN([Adding fix for broken realpath]) + CFLAGS="$CFLAGS -DHAVE_BROKEN_REALPATH" + CXXFLAGS="$CXXFLAGS -DHAVE_BROKEN_REALPATH" + elif test "$OSVERSION" -gt "480100" && \ test "$OSVERSION" -lt "500000" || \ test "$OSVERSION" -gt "500109" then + AC_MSG_WARN([Adding fix for interrupted reads]) CXXFLAGS="$CXXFLAGS -DMYSQLD_NET_RETRY_COUNT=1000000" else + AC_MSG_WARN([Adding fix for interrupted reads and broken realpath]) CFLAGS="$CFLAGS -DHAVE_BROKEN_REALPATH" CXXFLAGS="$CXXFLAGS -DMYSQLD_NET_RETRY_COUNT=1000000 -DHAVE_BROKEN_REALPATH" fi From 3dec34f4f71f721652c49e612cb6bc9c53cebefe Mon Sep 17 00:00:00 2001 From: Kent Boortz Date: Tue, 25 May 2010 10:14:07 +0200 Subject: [PATCH 18/19] configure.cmake - Reverted a faulty change of MY_SEARCH_LIBS - Added the proper change for MY_SEARCH_LIBS and HAVE_ --- config.h.cmake | 2 +- configure.cmake | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/config.h.cmake b/config.h.cmake index f93cc18a0bc..3adc7b1e3f5 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -312,7 +312,7 @@ #define SIZEOF_CHARP SIZEOF_LONG #define SIZEOF_SIZE_T SIZEOF_LONG #else -# No indentation, to fetch the lines from verification scripts +/* No indentation, to fetch the lines from verification scripts */ #cmakedefine SIZEOF_LONG @SIZEOF_LONG@ #cmakedefine SIZEOF_VOIDP @SIZEOF_VOIDP@ #cmakedefine SIZEOF_CHARP @SIZEOF_CHARP@ diff --git a/configure.cmake b/configure.cmake index 6734b652676..eeefa054de0 100644 --- a/configure.cmake +++ b/configure.cmake @@ -105,7 +105,8 @@ FUNCTION(MY_SEARCH_LIBS func libs result) FOREACH(lib ${libs}) CHECK_LIBRARY_EXISTS(${lib} ${func} "" HAVE_${func}_IN_${lib}) IF(HAVE_${func}_IN_${lib}) - SET(${result} HAVE_${lib} PARENT_SCOPE) + SET(${result} ${lib} PARENT_SCOPE) + SET(HAVE_${result} 1 PARENT_SCOPE) RETURN() ENDIF() ENDFOREACH() From ce34f3d8093f131f5713437c299a72046753868f Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Thu, 27 May 2010 12:51:26 +0200 Subject: [PATCH 19/19] Split OEL/RHEL --- support-files/mysql.spec.sh | 65 ++++++++++++++++++++++++------------- 1 file changed, 42 insertions(+), 23 deletions(-) diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh index 2ed3b1ff788..c0edd3718bb 100644 --- a/support-files/mysql.spec.sh +++ b/support-files/mysql.spec.sh @@ -121,43 +121,62 @@ %define distro_specific 0 %endif %if %{distro_specific} - %if %(test -f /etc/redhat-release && echo 1 || echo 0) - %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 + %if %(test -f /etc/enterprise-release && echo 1 || echo 0) + %define oelver %(rpm -qf --qf '%%{version}\\n' /etc/enterprise-release | sed -e 's/^\\([0-9]*\\).*/\\1/g') + %if "%oelver" == "4" + %define distro_description Oracle Enterprise Linux 4 + %define distro_releasetag oel4 %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 "%elver" == "5" - %define distro_description Enterprise Linux 5 - %define distro_releasetag el5 + %if "%oelver" == "5" + %define distro_description Oracle Enterprise Linux 5 + %define distro_releasetag oel5 %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:Enterprise Linux %{elver} is unsupported} + %{error:Oracle Enterprise Linux %{oelver} is unsupported} %endif %endif %else - %if %(test -f /etc/SuSE-release && echo 1 || echo 0) - %define susever %(rpm -qf --qf '%%{version}\\n' /etc/SuSE-release) - %if "%susever" == "10" - %define distro_description SUSE Linux Enterprise Server 10 - %define distro_releasetag sles10 - %define distro_buildreq gcc-c++ gdbm-devel gperf ncurses-devel openldap2-client readline-devel zlib-devel - %define distro_requires aaa_base coreutils grep procps pwdutils + %if %(test -f /etc/redhat-release && echo 1 || echo 0) + %define rhelver %(rpm -qf --qf '%%{version}\\n' /etc/redhat-release | sed -e 's/^\\([0-9]*\\).*/\\1/g') + %if "%rhelver" == "4" + %define distro_description Red Hat Enterprise Linux 4 + %define distro_releasetag rhel4 + %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 "%susever" == "11" - %define distro_description SUSE Linux Enterprise Server 11 - %define distro_releasetag sles11 - %define distro_buildreq gcc-c++ gdbm-devel gperf ncurses-devel openldap2-client procps pwdutils readline-devel zlib-devel - %define distro_requires aaa_base coreutils grep procps pwdutils + %if "%rhelver" == "5" + %define distro_description Red Hat Enterprise Linux 5 + %define distro_releasetag rhel5 + %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:SuSE %{susever} is unsupported} + %{error:Red Hat Enterprise Linux %{rhelver} is unsupported} %endif %endif %else - %{error:Unsupported distribution} + %if %(test -f /etc/SuSE-release && echo 1 || echo 0) + %define susever %(rpm -qf --qf '%%{version}\\n' /etc/SuSE-release) + %if "%susever" == "10" + %define distro_description SUSE Linux Enterprise Server 10 + %define distro_releasetag sles10 + %define distro_buildreq gcc-c++ gdbm-devel gperf ncurses-devel openldap2-client readline-devel zlib-devel + %define distro_requires aaa_base coreutils grep procps pwdutils + %else + %if "%susever" == "11" + %define distro_description SUSE Linux Enterprise Server 11 + %define distro_releasetag sles11 + %define distro_buildreq gcc-c++ gdbm-devel gperf ncurses-devel openldap2-client procps pwdutils readline-devel zlib-devel + %define distro_requires aaa_base coreutils grep procps pwdutils + %else + %{error:SuSE %{susever} is unsupported} + %endif + %endif + %else + %{error:Unsupported distribution} + %endif %endif %endif %else