maria-developers team mailing list archive
-
maria-developers team
-
Mailing list archive
-
Message #00072
bzr commit into MariaDB 5.1, with Maria 1.5:maria branch (monty:2687)
#At lp:maria based on revid:monty@xxxxxxxxxxxx-20090320114554-e6kokfmsmyr4as9g
2687 Michael Widenius 2009-03-22
Apply patch by Antony Dovgal:
- Move SAFE_MUTEX to be stored in config.h by configure.in (not as a flag used with compiler command line)
- Generate my_config.h in configure
modified:
BUILD/SETUP.sh
BUILD/compile-ia64-debug-max
configure.in
dbug/dbug.c
include/Makefile.am
mysys/my_wincond.c
mysys/my_winthread.c
per-file messages:
BUILD/SETUP.sh
Remove -DSAFE_MUTEX as the following --with-debug flag will automaticly add it
BUILD/compile-ia64-debug-max
Remove -DSAFE_MUTEX as the following --with-debug flag will automaticly add it
configure.in
Move SAFE_MUTEX and SAFE_MALLOC to [my_] config.h
Generate my_config.h as part of configure process
dbug/dbug.c
Include my_global.h before we undef SAFE_MUTEX
include/Makefile.am
Update comment. For now, lets generate my_config.h if someone deletes it after configure
mysys/my_wincond.c
Include my_global.h before we undef SAFE_MUTEX
mysys/my_winthread.c
Include my_global.h before we undef SAFE_MUTEX
=== modified file 'BUILD/SETUP.sh'
--- a/BUILD/SETUP.sh 2009-03-12 22:27:35 +0000
+++ b/BUILD/SETUP.sh 2009-03-22 12:16:09 +0000
@@ -124,7 +124,7 @@ valgrind_flags="$valgrind_flags -DMYSQL_
#
# Used in -debug builds
debug_cflags="-DUNIV_MUST_NOT_INLINE -DEXTRA_DEBUG -DFORCE_INIT_OF_VARS "
-debug_cflags="$debug_cflags -DSAFEMALLOC -DPEDANTIC_SAFEMALLOC -DSAFE_MUTEX"
+debug_cflags="$debug_cflags -DSAFEMALLOC -DPEDANTIC_SAFEMALLOC"
error_inject="--with-error-inject "
#
# Base C++ flags for all builds
=== modified file 'BUILD/compile-ia64-debug-max'
--- a/BUILD/compile-ia64-debug-max 2007-01-28 20:09:54 +0000
+++ b/BUILD/compile-ia64-debug-max 2009-03-22 12:16:09 +0000
@@ -4,5 +4,5 @@ gmake -k maintainer-clean || true
path=`dirname $0`
. "$path/autorun.sh"
-CC=ecc CFLAGS="-w1 -DEXTRA_DEBUG -DSAFEMALLOC -DSAFE_MUTEX -O2" CXX=ecc CXXFLAGS="-w1 -DEXTRA_DEBUG -DSAFEMALLOC -DSAFE_MUTEX -O2" ./configure --prefix=/usr/local/mysql --with-extra-charsets=complex --enable-thread-safe-client --with-mysqld-ldflags=-all-static --with-client-ldflags=-all-static --with-debug --with-innodb --with-embedded-server --with-archive-storage-engine
+CC=ecc CFLAGS="-w1 -DEXTRA_DEBUG -DSAFEMALLOC -O2" CXX=ecc CXXFLAGS="-w1 -DEXTRA_DEBUG -DSAFEMALLOC -O2" ./configure --prefix=/usr/local/mysql --with-extra-charsets=complex --enable-thread-safe-client --with-mysqld-ldflags=-all-static --with-client-ldflags=-all-static --with-debug --with-innodb --with-embedded-server --with-archive-storage-engine
gmake
=== modified file 'configure.in'
--- a/configure.in 2009-03-12 22:27:35 +0000
+++ b/configure.in 2009-03-22 12:16:09 +0000
@@ -1677,14 +1677,17 @@ if test "$with_debug" = "yes"
then
# Medium debug.
AC_DEFINE([DBUG_ON], [1], [Use libdbug])
- CFLAGS="$DEBUG_CFLAGS $DEBUG_OPTIMIZE_CC -DSAFE_MUTEX $CFLAGS"
- CXXFLAGS="$DEBUG_CXXFLAGS $DEBUG_OPTIMIZE_CXX -DSAFE_MUTEX $CXXFLAGS"
+ AC_DEFINE([SAFE_MUTEX], [1], [Use safe mutexes])
+ CFLAGS="$DEBUG_CFLAGS $DEBUG_OPTIMIZE_CC $CFLAGS"
+ CXXFLAGS="$DEBUG_CXXFLAGS $DEBUG_OPTIMIZE_CXX $CXXFLAGS"
elif test "$with_debug" = "full"
then
# Full debug. Very slow in some cases
AC_DEFINE([DBUG_ON], [1], [Use libdbug])
- CFLAGS="$DEBUG_CFLAGS -DSAFE_MUTEX -DSAFEMALLOC $CFLAGS"
- CXXFLAGS="$DEBUG_CXXFLAGS -DSAFE_MUTEX -DSAFEMALLOC $CXXFLAGS"
+ AC_DEFINE([SAFE_MUTEX], [1], [Use safe mutexes])
+ AC_DEFINE([SAFEMALLOC], [1], [Use safe malloc])
+ CFLAGS="$DEBUG_CFLAGS $CFLAGS"
+ CXXFLAGS="$DEBUG_CXXFLAGS $CXXFLAGS"
else
# Optimized version. No debug
AC_DEFINE([DBUG_OFF], [1], [Don't use libdbug])
@@ -2812,6 +2815,7 @@ AC_CONFIG_FILES(Makefile extra/Makefile
include/mysql_version.h plugin/Makefile win/Makefile)
AC_CONFIG_COMMANDS([default], , test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h)
+AC_CONFIG_COMMANDS([my_config.h], cp include/config.h include/my_config.h)
# Ensure that table handlers gets all modifications to CFLAGS/CXXFLAGS
AC_CONFIG_COMMANDS_POST(ac_configure_args="$ac_configure_args CFLAGS='$CFLAGS' CXXFLAGS='$CXXFLAGS'")
=== modified file 'dbug/dbug.c'
--- a/dbug/dbug.c 2009-03-12 22:27:35 +0000
+++ b/dbug/dbug.c 2009-03-22 12:16:09 +0000
@@ -84,8 +84,8 @@
in pthread_mutex_lock
*/
-#undef SAFE_MUTEX
#include <my_global.h>
+#undef SAFE_MUTEX
#include <m_string.h>
#include <errno.h>
=== modified file 'include/Makefile.am'
--- a/include/Makefile.am 2008-11-21 14:21:50 +0000
+++ b/include/Makefile.am 2009-03-22 12:16:09 +0000
@@ -59,6 +59,8 @@ link_sources:
# We want both "my_config.h" and "config.h" that are identical, as
# MySQL sources assumes the name "my_config.h", and 3rd party sources
# assumes the name "config.h".
+# Normally this is generated by configure; This rule is left here in case
+# someone deletes my_config.h and expect it to be generated by make
my_config.h: config.h
$(CP) config.h my_config.h
=== modified file 'mysys/my_wincond.c'
--- a/mysys/my_wincond.c 2008-10-21 14:10:04 +0000
+++ b/mysys/my_wincond.c 2009-03-22 12:16:09 +0000
@@ -17,6 +17,7 @@
** The following is a simple implementation of posix conditions
*****************************************************************************/
+#include <my_global.h>
#undef SAFE_MUTEX /* Avoid safe_mutex redefinitions */
#include "mysys_priv.h"
#if defined(THREAD) && defined(__WIN__)
=== modified file 'mysys/my_winthread.c'
--- a/mysys/my_winthread.c 2008-01-10 12:21:53 +0000
+++ b/mysys/my_winthread.c 2009-03-22 12:16:09 +0000
@@ -18,6 +18,7 @@
*****************************************************************************/
/* SAFE_MUTEX will not work until the thread structure is up to date */
+#include <my_global.h>
#undef SAFE_MUTEX
#include "mysys_priv.h"