From 1758bf199db045a75291a4730f51a0ab84ff6861 Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Mon, 28 Jun 2010 14:59:15 +0100 Subject: Expand some variables for mysqlbug. --- scripts/CMakeLists.txt | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'scripts') diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index 84472c3a5c3..af8c214503f 100755 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -140,6 +140,19 @@ ENDIF() SET(HOSTNAME "hostname") +# Required for mysqlbug until autotools are deprecated, once done remove these +# and expand default cmake variables +SET(CC ${CMAKE_C_COMPILER}) +SET(CXX ${CMAKE_CXX_COMPILER}) +#XXX don't set CFLAGS, has already been done earlier +#XXX don't set CXXFLAGS, has already been done earlier +SET(SAVE_CC ${CMAKE_C_COMPILER}) +SET(SAVE_CXX ${CMAKE_CXX_COMPILER}) +SET(SAVE_CFLAGS ${CFLAGS}) +SET(SAVE_CXXFLAGS ${CXXFLAGS}) +# XXX no cmake equivalent for this, just make one up +SET(CONFIGURE_LINE "Built using CMake") + ENDIF(UNIX) # Really ugly, one script, "mysql_install_db", needs prefix set to ".", -- cgit v1.2.1 From 829cd2446d59b34ae5a53268fcf09e30d4779040 Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Mon, 28 Jun 2010 17:44:12 +0100 Subject: Try to fix more mysqlbug problems. --- scripts/CMakeLists.txt | 47 ++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 42 insertions(+), 5 deletions(-) (limited to 'scripts') diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index af8c214503f..97ba9f93f13 100755 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -144,17 +144,55 @@ SET(HOSTNAME "hostname") # and expand default cmake variables SET(CC ${CMAKE_C_COMPILER}) SET(CXX ${CMAKE_CXX_COMPILER}) -#XXX don't set CFLAGS, has already been done earlier -#XXX don't set CXXFLAGS, has already been done earlier +# Override CFLAGS for mysqlbug then reset +SET(BACKUP_CFLAGS ${CFLAGS}) +SET(BACKUP_CXXFLAGS ${CXXFLAGS}) +SET(CFLAGS ${CMAKE_C_FLAGS_RELWITHDEBINFO}) +SET(CXXFLAGS ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}) +# SET(SAVE_CC ${CMAKE_C_COMPILER}) SET(SAVE_CXX ${CMAKE_CXX_COMPILER}) -SET(SAVE_CFLAGS ${CFLAGS}) -SET(SAVE_CXXFLAGS ${CXXFLAGS}) +SET(SAVE_CFLAGS ${CMAKE_C_FLAGS_RELWITHDEBINFO}) +SET(SAVE_CXXFLAGS ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}) # XXX no cmake equivalent for this, just make one up SET(CONFIGURE_LINE "Built using CMake") +# Also required for mysqlbug, autoconf only supports --version so for now we +# just explicitly require GNU +IF(CMAKE_COMPILER_IS_GNUCC) + EXECUTE_PROCESS( + COMMAND ${CMAKE_C_COMPILER} ${CMAKE_C_COMPILER_ARG1} --version + COMMAND grep -i version + OUTPUT_VARIABLE CC_VERSION) +ELSE() + SET(CC_VERSION "") +ENDIF() +IF(CMAKE_COMPILER_IS_GNUCXX) + EXECUTE_PROCESS( + COMMAND ${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_ARG1} --version + COMMAND grep -i version + OUTPUT_VARIABLE CXX_VERSION) +ELSE() + SET(CXX_VERSION "") +ENDIF() ENDIF(UNIX) +IF(UNIX) + CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/mysqlbug.sh + ${CMAKE_CURRENT_BINARY_DIR}/mysqlbug ESCAPE_QUOTES @ONLY) + SET(DEST ${INSTALL_SCRIPTDIR}) +ENDIF() + +INSTALL_SCRIPT( + "${CMAKE_CURRENT_BINARY_DIR}/mysqlbug" + DESTINATION ${DEST} + COMPONENT Server + ) + +# Reset CFLAGS/CXXFLAGS back +SET(CFLAGS ${BACKUP_CFLAGS}) +SET(CXXFLAGS ${BACKUP_CXXFLAGS}) + # Really ugly, one script, "mysql_install_db", needs prefix set to ".", # i.e. makes access relative the current directory. This matches # the documentation, so better not change this. @@ -305,7 +343,6 @@ ELSE() mysql_zap mysqlaccess mysqlaccess.conf - mysqlbug mysql_convert_table_format mysql_find_rows mysqlhotcopy -- cgit v1.2.1 From c72dec21843af3cdd0387a738ef5c75213565897 Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Mon, 28 Jun 2010 18:30:53 +0100 Subject: mysqlbug is Unix-only. --- scripts/CMakeLists.txt | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index 97ba9f93f13..90261501452 100755 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -175,13 +175,10 @@ IF(CMAKE_COMPILER_IS_GNUCXX) ELSE() SET(CXX_VERSION "") ENDIF() -ENDIF(UNIX) -IF(UNIX) - CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/mysqlbug.sh +CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/mysqlbug.sh ${CMAKE_CURRENT_BINARY_DIR}/mysqlbug ESCAPE_QUOTES @ONLY) SET(DEST ${INSTALL_SCRIPTDIR}) -ENDIF() INSTALL_SCRIPT( "${CMAKE_CURRENT_BINARY_DIR}/mysqlbug" @@ -193,6 +190,8 @@ INSTALL_SCRIPT( SET(CFLAGS ${BACKUP_CFLAGS}) SET(CXXFLAGS ${BACKUP_CXXFLAGS}) +ENDIF(UNIX) + # Really ugly, one script, "mysql_install_db", needs prefix set to ".", # i.e. makes access relative the current directory. This matches # the documentation, so better not change this. -- cgit v1.2.1 From c49335e8a7a980c7838322cd86c5c86c42a76d0b Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Tue, 29 Jun 2010 19:21:59 +0100 Subject: Copy-pasted the wrong line from configure.in, fix gcc detection. --- scripts/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index 90261501452..e2a39dcf814 100755 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -162,7 +162,7 @@ SET(CONFIGURE_LINE "Built using CMake") IF(CMAKE_COMPILER_IS_GNUCC) EXECUTE_PROCESS( COMMAND ${CMAKE_C_COMPILER} ${CMAKE_C_COMPILER_ARG1} --version - COMMAND grep -i version + COMMAND sed 1q OUTPUT_VARIABLE CC_VERSION) ELSE() SET(CC_VERSION "") @@ -170,7 +170,7 @@ ENDIF() IF(CMAKE_COMPILER_IS_GNUCXX) EXECUTE_PROCESS( COMMAND ${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_ARG1} --version - COMMAND grep -i version + COMMAND sed 1q OUTPUT_VARIABLE CXX_VERSION) ELSE() SET(CXX_VERSION "") -- cgit v1.2.1 From 12fc3a9f38e44e1fa9571ce7a2bb95c86105f2a5 Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Wed, 30 Jun 2010 12:19:54 +0100 Subject: bug#52737 plugin_dir is set to /usr/local/mysql/lib/plugin while starting via mysqld_safe Rather than hardcode the plugin directory, enhance mysql_config to fix plugin path when running a relocated install, and use it to provide the plugin directory to mysqld_safe. --- scripts/mysql_config.sh | 2 ++ scripts/mysqld_safe.sh | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_config.sh b/scripts/mysql_config.sh index d2699726a25..593d19fb91c 100644 --- a/scripts/mysql_config.sh +++ b/scripts/mysql_config.sh @@ -88,6 +88,8 @@ pkglibdir_rel=`echo $pkglibdir | sed -e "s;^$basedir/;;"` fix_path pkglibdir $pkglibdir_rel lib/mysql lib plugindir='@pkgplugindir@' +plugindir_rel=`echo $plugindir | sed -e "s;^$basedir/;;"` +fix_path plugindir $plugindir_rel lib/mysql/plugin lib/plugin pkgincludedir='@pkgincludedir@' fix_path pkgincludedir include/mysql include diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index 562732e7387..d96091b685a 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -704,7 +704,7 @@ fi cmd="`mysqld_ld_preload_text`$NOHUP_NICENESS" -plugin_dir="${PLUGIN_DIR:-$MY_BASEDIR_VERSION/lib/mysql/plugin}${PLUGIN_VARIANT}" +plugin_dir="${PLUGIN_DIR:-`get_mysql_config --variable=plugindir`}${PLUGIN_VARIANT}" for i in "$ledir/$MYSQLD" "$defaults" "--basedir=$MY_BASEDIR_VERSION" \ "--datadir=$DATADIR" "--plugin-dir=$plugin_dir" "$USER_OPTION" -- cgit v1.2.1 From b72c99a157f0f87d78722be33d5072b03e01846d Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Wed, 30 Jun 2010 18:47:42 +0100 Subject: Put mysqlbug back into bin/ --- scripts/CMakeLists.txt | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'scripts') diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index e2a39dcf814..025bce0bbcf 100755 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -178,11 +178,8 @@ ENDIF() CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/mysqlbug.sh ${CMAKE_CURRENT_BINARY_DIR}/mysqlbug ESCAPE_QUOTES @ONLY) - SET(DEST ${INSTALL_SCRIPTDIR}) - -INSTALL_SCRIPT( - "${CMAKE_CURRENT_BINARY_DIR}/mysqlbug" - DESTINATION ${DEST} +INSTALL_SCRIPT(${CMAKE_CURRENT_BINARY_DIR}/mysqlbug + DESTINATION ${INSTALL_BINDIR} COMPONENT Server ) -- cgit v1.2.1 From 596440455f781a3e8e7ca046b888eb2f6d57ef97 Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Mon, 5 Jul 2010 12:53:03 +0100 Subject: bug#54991: mysqld_safe reports syntax error and skips part of logic while restarting server TARGET_LINUX must be 'true' or 'false'. --- scripts/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index 025bce0bbcf..4513b4619f8 100755 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -243,9 +243,9 @@ SET(localstatedir ${MYSQL_DATADIR}) # some scripts use @TARGET_LINUX@ IF(CMAKE_SYSTEM_NAME MATCHES "Linux") - SET(TARGET_LINUX 1) + SET(TARGET_LINUX "true") ELSE() - SET(TARGET_LINUX 0) + SET(TARGET_LINUX "false") ENDIF() # Use cmake variables to inspect dependencies for -- cgit v1.2.1 From 271fcfaf11265465482849efe2f3413864bb471c Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Mon, 5 Jul 2010 15:44:40 +0100 Subject: No need to save/restore C*FLAGS, they are only used for one script. Use CMAKE_*_FLAGS_RELWITHDEBINFO for C*FLAGS expansion, they are the most likely to contain the flags we need. --- scripts/CMakeLists.txt | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) (limited to 'scripts') diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index 4513b4619f8..6ea81d8a484 100755 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -90,15 +90,13 @@ IF(MALLOC_LIB) ENDIF() IF(CMAKE_GENERATOR MATCHES "Makefiles") - # No multiconfig build - use CMAKE_C_FLAGS - SET(CFLAGS "@CMAKE_C_FLAGS@") - SET(CXXFLAGS "@CMAKE_CXX_FLAGS@") + SET(CFLAGS "@CMAKE_C_FLAGS_RELWITHDEBINFO@") + SET(CXXFLAGS "@CMAKE_CXX_FLAGS_RELWITHDEBINFO@") 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@") SET(CXXFLAGS "@CMAKE_CXX_FLAGS_RELWITHDEBINFO@") ENDIF() @@ -144,16 +142,10 @@ SET(HOSTNAME "hostname") # and expand default cmake variables SET(CC ${CMAKE_C_COMPILER}) SET(CXX ${CMAKE_CXX_COMPILER}) -# Override CFLAGS for mysqlbug then reset -SET(BACKUP_CFLAGS ${CFLAGS}) -SET(BACKUP_CXXFLAGS ${CXXFLAGS}) -SET(CFLAGS ${CMAKE_C_FLAGS_RELWITHDEBINFO}) -SET(CXXFLAGS ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}) -# SET(SAVE_CC ${CMAKE_C_COMPILER}) SET(SAVE_CXX ${CMAKE_CXX_COMPILER}) -SET(SAVE_CFLAGS ${CMAKE_C_FLAGS_RELWITHDEBINFO}) -SET(SAVE_CXXFLAGS ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}) +SET(SAVE_CFLAGS ${CFLAGS}) +SET(SAVE_CXXFLAGS ${CXXFLAGS}) # XXX no cmake equivalent for this, just make one up SET(CONFIGURE_LINE "Built using CMake") @@ -183,10 +175,6 @@ INSTALL_SCRIPT(${CMAKE_CURRENT_BINARY_DIR}/mysqlbug COMPONENT Server ) -# Reset CFLAGS/CXXFLAGS back -SET(CFLAGS ${BACKUP_CFLAGS}) -SET(CXXFLAGS ${BACKUP_CXXFLAGS}) - ENDIF(UNIX) # Really ugly, one script, "mysql_install_db", needs prefix set to ".", -- cgit v1.2.1 From 2c4588acc6e423c18746a819b3994713fd6b408a Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Mon, 5 Jul 2010 19:32:46 +0100 Subject: Include CMAKE_{C,CXX}_FLAGS. --- scripts/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index 6ea81d8a484..dfe0090eaca 100755 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -90,8 +90,8 @@ IF(MALLOC_LIB) ENDIF() IF(CMAKE_GENERATOR MATCHES "Makefiles") - SET(CFLAGS "@CMAKE_C_FLAGS_RELWITHDEBINFO@") - SET(CXXFLAGS "@CMAKE_CXX_FLAGS_RELWITHDEBINFO@") + SET(CFLAGS "@CMAKE_C_FLAGS@ @CMAKE_C_FLAGS_RELWITHDEBINFO@") + SET(CXXFLAGS "@CMAKE_CXX_FLAGS@ @CMAKE_CXX_FLAGS_RELWITHDEBINFO@") FOREACH(ARCH ${CMAKE_OSX_ARCHITECTURES}) SET(CFLAGS "${CFLAGS} -arch ${ARCH}") SET(CXXFLAGS "${CXXFLAGS} -arch ${ARCH}") -- cgit v1.2.1 From c0d2440565bc34f41528e01ebe4d652b330861c1 Mon Sep 17 00:00:00 2001 From: Jonathan Perkin Date: Mon, 5 Jul 2010 22:19:14 +0100 Subject: We can't rely on mysql_config for core functionality like plugins as it may be part of a separate package. Work out the likliest plugin directory using similar logic to the data directory, and avoid the dependancy. --- scripts/mysqld_safe.sh | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index d96091b685a..a537bf27aad 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -413,6 +413,29 @@ else DATADIR=@localstatedir@ fi +# +# Try to find the plugin directory +# + +# Use user-supplied argument +if [ -n "${PLUGIN_DIR}" ]; then + plugin_dir="${PLUGIN_DIR}" +else + # Try to find plugin dir relative to basedir + for dir in lib/mysql/plugin lib/plugin + do + if [ -d "${MY_BASEDIR_VERSION}/${dir}" ]; then + plugin_dir="${MY_BASEDIR_VERSION}/${dir}" + break + fi + done + # Give up and use compiled-in default + if [ -z "${plugin_dir}" ]; then + plugin_dir='@pkgplugindir@' + fi +fi +plugin_dir="${plugin_dir}${PLUGIN_VARIANT}" + if test -z "$MYSQL_HOME" then if test -r "$MY_BASEDIR_VERSION/my.cnf" && test -r "$DATADIR/my.cnf" @@ -704,8 +727,6 @@ fi cmd="`mysqld_ld_preload_text`$NOHUP_NICENESS" -plugin_dir="${PLUGIN_DIR:-`get_mysql_config --variable=plugindir`}${PLUGIN_VARIANT}" - for i in "$ledir/$MYSQLD" "$defaults" "--basedir=$MY_BASEDIR_VERSION" \ "--datadir=$DATADIR" "--plugin-dir=$plugin_dir" "$USER_OPTION" do -- cgit v1.2.1