mirror of
https://github.com/MariaDB/server.git
synced 2026-05-14 19:07:15 +02:00
Bug#19517 No simple way to detect wether server was compiled with libdbug
- Define DBUG_ON and DBUG_OFF in config.h configure.in: Define DBUG_ON and DBUG_OFF in config.h instead of in compiler flags dbug/dbug.c: Undef DBUG_OFF if defined when compiling dbug.c, this is done as we always compile dbug.c even when DBUG_OFF is selected.
This commit is contained in:
parent
2dd1dc6246
commit
d93ec9ee84
2 changed files with 13 additions and 7 deletions
15
configure.in
15
configure.in
|
|
@ -1651,17 +1651,20 @@ AC_ARG_WITH(debug,
|
||||||
if test "$with_debug" = "yes"
|
if test "$with_debug" = "yes"
|
||||||
then
|
then
|
||||||
# Medium debug.
|
# Medium debug.
|
||||||
CFLAGS="$DEBUG_CFLAGS $DEBUG_OPTIMIZE_CC -DDBUG_ON -DSAFE_MUTEX $CFLAGS"
|
AC_DEFINE([DBUG_ON], [1], [Use libdbug])
|
||||||
CXXFLAGS="$DEBUG_CXXFLAGS $DEBUG_OPTIMIZE_CXX -DDBUG_ON -DSAFE_MUTEX $CXXFLAGS"
|
CFLAGS="$DEBUG_CFLAGS $DEBUG_OPTIMIZE_CC -DSAFE_MUTEX $CFLAGS"
|
||||||
|
CXXFLAGS="$DEBUG_CXXFLAGS $DEBUG_OPTIMIZE_CXX -DSAFE_MUTEX $CXXFLAGS"
|
||||||
elif test "$with_debug" = "full"
|
elif test "$with_debug" = "full"
|
||||||
then
|
then
|
||||||
# Full debug. Very slow in some cases
|
# Full debug. Very slow in some cases
|
||||||
CFLAGS="$DEBUG_CFLAGS -DDBUG_ON -DSAFE_MUTEX -DSAFEMALLOC $CFLAGS"
|
AC_DEFINE([DBUG_ON], [1], [Use libdbug])
|
||||||
CXXFLAGS="$DEBUG_CXXFLAGS -DDBUG_ON -DSAFE_MUTEX -DSAFEMALLOC $CXXFLAGS"
|
CFLAGS="$DEBUG_CFLAGS -DSAFE_MUTEX -DSAFEMALLOC $CFLAGS"
|
||||||
|
CXXFLAGS="$DEBUG_CXXFLAGS -DSAFE_MUTEX -DSAFEMALLOC $CXXFLAGS"
|
||||||
else
|
else
|
||||||
# Optimized version. No debug
|
# Optimized version. No debug
|
||||||
CFLAGS="$OPTIMIZE_CFLAGS -DDBUG_OFF $CFLAGS"
|
AC_DEFINE([DBUG_OFF], [1], [Don't use libdbug])
|
||||||
CXXFLAGS="$OPTIMIZE_CXXFLAGS -DDBUG_OFF $CXXFLAGS"
|
CFLAGS="$OPTIMIZE_CFLAGS $CFLAGS"
|
||||||
|
CXXFLAGS="$OPTIMIZE_CXXFLAGS $CXXFLAGS"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Force static compilation to avoid linking problems/get more speed
|
# Force static compilation to avoid linking problems/get more speed
|
||||||
|
|
|
||||||
|
|
@ -66,10 +66,13 @@
|
||||||
* Check of malloc on entry/exit (option "S")
|
* Check of malloc on entry/exit (option "S")
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <my_global.h>
|
||||||
|
|
||||||
|
/* This file won't compile unless DBUG_OFF is undefined locally */
|
||||||
#ifdef DBUG_OFF
|
#ifdef DBUG_OFF
|
||||||
#undef DBUG_OFF
|
#undef DBUG_OFF
|
||||||
#endif
|
#endif
|
||||||
#include <my_global.h>
|
|
||||||
#include <m_string.h>
|
#include <m_string.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#if defined(MSDOS) || defined(__WIN__)
|
#if defined(MSDOS) || defined(__WIN__)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue