diff options
author | unknown <monty@donna.mysql.fi> | 2001-04-19 14:43:32 +0300 |
---|---|---|
committer | unknown <monty@donna.mysql.fi> | 2001-04-19 14:43:32 +0300 |
commit | efa4fdf044fe175b6e777ae1cdea0aa716b14945 (patch) | |
tree | fcdeec62c24b863cfe8fe65bb23158d45002f726 /innobase | |
parent | e0d42da39112930c6bcb4fe8571dd1f823671cb9 (diff) | |
download | mariadb-git-efa4fdf044fe175b6e777ae1cdea0aa716b14945.tar.gz |
Portability fixes
Docs/manual.texi:
Updated mysqld-max section
configure.in:
Version change
innobase/configure.in:
Don't compile with -g when not using debugging (No optimization on Linux-Alpha)
innobase/ib_config.h.in:
config file
innobase/ib_config.h:
config file
innobase/include/que0que.h:
Can't inline this on SCO
innobase/include/que0que.ic:
Can't inline this on SCO
innobase/include/sync0sync.h:
Fix for Mac OS X
innobase/que/que0que.c:
Added functions that can't be inlined on SCO
Diffstat (limited to 'innobase')
-rw-r--r-- | innobase/configure.in | 44 | ||||
-rw-r--r-- | innobase/ib_config.h | 6 | ||||
-rw-r--r-- | innobase/ib_config.h.in | 6 | ||||
-rw-r--r-- | innobase/include/que0que.h | 2 | ||||
-rw-r--r-- | innobase/include/que0que.ic | 46 | ||||
-rw-r--r-- | innobase/include/sync0sync.h | 1 | ||||
-rw-r--r-- | innobase/que/que0que.c | 45 |
7 files changed, 102 insertions, 48 deletions
diff --git a/innobase/configure.in b/innobase/configure.in index 0bcc53cc05b..15f45a5d49d 100644 --- a/innobase/configure.in +++ b/innobase/configure.in @@ -13,9 +13,53 @@ AC_CHECK_FUNCS(sched_yield) AC_C_INLINE AC_C_BIGENDIAN +# Build optimized or debug version ? +# First check for gcc and g++ +if test "$ac_cv_prog_gcc" = "yes" +then + DEBUG_CFLAGS="-g" + DEBUG_OPTIMIZE_CC="-O" + OPTIMIZE_CFLAGS="$MAX_C_OPTIMIZE" +else + DEBUG_CFLAGS="-g" + DEBUG_OPTIMIZE_CC="" + OPTIMIZE_CFLAGS="-O" +fi +if test "$ac_cv_prog_cxx_g" = "yes" +then + DEBUG_CXXFLAGS="-g" + DEBUG_OPTIMIZE_CXX="-O" + OPTIMIZE_CXXFLAGS="-O3" +else + DEBUG_CXXFLAGS="-g" + DEBUG_OPTIMIZE_CXX="" + OPTIMIZE_CXXFLAGS="-O" +fi +AC_ARG_WITH(debug, + [ --without-debug Build a production version without debugging code], + [with_debug=$withval], + [with_debug=no]) +if test "$with_debug" = "yes" +then + # Medium debug. + CFLAGS="$DEBUG_CFLAGS $DEBUG_OPTIMIZE_CC -DDBUG_ON -DSAFE_MUTEX $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $DEBUG_OPTIMIZE_CXX -DSAFE_MUTEX $CXXFLAGS" +elif test "$with_debug" = "full" +then + # Full debug. Very slow in some cases + CFLAGS="$DEBUG_CFLAGS -DDBUG_ON -DSAFE_MUTEX -DSAFEMALLOC $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS -DSAFE_MUTEX -DSAFEMALLOC $CXXFLAGS" +else + # Optimized version. No debug + CFLAGS="$OPTIMIZE_CFLAGS -DDBUG_OFF $CFLAGS" + CXXFLAGS="$OPTIMIZE_CXXFLAGS -DDBUG_OFF $CXXFLAGS" +fi + case "$target_os" in hp*) AC_DEFINE(UNIV_MUST_NOT_INLINE, 1, No inlining because gcc broken on HP-UX);; + *sgi-irix*) AC_DEFINE(UNIV_MUST_NOT_INLINE, 1, + No inlining because cc broken on irix);; esac AC_OUTPUT(Makefile os/Makefile ut/Makefile btr/Makefile diff --git a/innobase/ib_config.h b/innobase/ib_config.h index a2276199abd..972d85e6eb9 100644 --- a/innobase/ib_config.h +++ b/innobase/ib_config.h @@ -11,9 +11,15 @@ /* The number of bytes in a int. */ #define SIZEOF_INT 4 +/* Define if you have the sched_yield function. */ +#define HAVE_SCHED_YIELD 1 + /* Define if you have the <aio.h> header file. */ #define HAVE_AIO_H 1 +/* Define if you have the <sched.h> header file. */ +#define HAVE_SCHED_H 1 + /* Name of package */ #define PACKAGE "ib" diff --git a/innobase/ib_config.h.in b/innobase/ib_config.h.in index 1ea07f5c0c3..967b422fb29 100644 --- a/innobase/ib_config.h.in +++ b/innobase/ib_config.h.in @@ -10,9 +10,15 @@ /* The number of bytes in a int. */ #undef SIZEOF_INT +/* Define if you have the sched_yield function. */ +#undef HAVE_SCHED_YIELD + /* Define if you have the <aio.h> header file. */ #undef HAVE_AIO_H +/* Define if you have the <sched.h> header file. */ +#undef HAVE_SCHED_H + /* Name of package */ #undef PACKAGE diff --git a/innobase/include/que0que.h b/innobase/include/que0que.h index bd21a9801aa..4cbd888ba1d 100644 --- a/innobase/include/que0que.h +++ b/innobase/include/que0que.h @@ -117,7 +117,6 @@ que_thr_stop( /************************************************************************** Moves a thread from another state to the QUE_THR_RUNNING state. Increments the n_active_thrs counters of the query graph and transaction. */ -UNIV_INLINE void que_thr_move_to_run_state_for_mysql( /*================================*/ @@ -126,7 +125,6 @@ que_thr_move_to_run_state_for_mysql( /************************************************************************** A patch for MySQL used to 'stop' a dummy query thread used in MySQL select, when there is no error or lock wait. */ -UNIV_INLINE void que_thr_stop_for_mysql_no_error( /*============================*/ diff --git a/innobase/include/que0que.ic b/innobase/include/que0que.ic index e19198aad0e..ae4ed10560f 100644 --- a/innobase/include/que0que.ic +++ b/innobase/include/que0que.ic @@ -256,49 +256,3 @@ que_graph_is_select( return(FALSE); } - -/************************************************************************** -Moves a thread from another state to the QUE_THR_RUNNING state. Increments -the n_active_thrs counters of the query graph and transaction if thr was -not active. */ -UNIV_INLINE -void -que_thr_move_to_run_state_for_mysql( -/*================================*/ - que_thr_t* thr, /* in: an query thread */ - trx_t* trx) /* in: transaction */ -{ - if (!thr->is_active) { - - (thr->graph)->n_active_thrs++; - - trx->n_active_thrs++; - - thr->is_active = TRUE; - - ut_ad((thr->graph)->n_active_thrs == 1); - ut_ad(trx->n_active_thrs == 1); - } - - thr->state = QUE_THR_RUNNING; -} - -/************************************************************************** -A patch for MySQL used to 'stop' a dummy query thread used in MySQL -select, when there is no error or lock wait. */ -UNIV_INLINE -void -que_thr_stop_for_mysql_no_error( -/*============================*/ - que_thr_t* thr, /* in: query thread */ - trx_t* trx) /* in: transaction */ -{ - ut_ad(thr->state == QUE_THR_RUNNING); - - thr->state = QUE_THR_COMPLETED; - - thr->is_active = FALSE; - (thr->graph)->n_active_thrs--; - - trx->n_active_thrs--; -} diff --git a/innobase/include/sync0sync.h b/innobase/include/sync0sync.h index f22cce17a1a..03dd45816aa 100644 --- a/innobase/include/sync0sync.h +++ b/innobase/include/sync0sync.h @@ -55,6 +55,7 @@ Calling this function is obligatory only if the memory buffer containing the mutex is freed. Removes a mutex object from the mutex list. The mutex is checked to be in the reset state. */ +#undef mutex_free /* Fix for MacOS X */ void mutex_free( /*=======*/ diff --git a/innobase/que/que0que.c b/innobase/que/que0que.c index b2c7e3ceea8..ddf8c8ebc43 100644 --- a/innobase/que/que0que.c +++ b/innobase/que/que0que.c @@ -1068,6 +1068,51 @@ que_thr_stop_for_mysql( mutex_exit(&kernel_mutex); } + +/************************************************************************** +Moves a thread from another state to the QUE_THR_RUNNING state. Increments +the n_active_thrs counters of the query graph and transaction if thr was +not active. */ +void +que_thr_move_to_run_state_for_mysql( +/*================================*/ + que_thr_t* thr, /* in: an query thread */ + trx_t* trx) /* in: transaction */ +{ + if (!thr->is_active) { + + (thr->graph)->n_active_thrs++; + + trx->n_active_thrs++; + + thr->is_active = TRUE; + + ut_ad((thr->graph)->n_active_thrs == 1); + ut_ad(trx->n_active_thrs == 1); + } + + thr->state = QUE_THR_RUNNING; +} + +/************************************************************************** +A patch for MySQL used to 'stop' a dummy query thread used in MySQL +select, when there is no error or lock wait. */ +void +que_thr_stop_for_mysql_no_error( +/*============================*/ + que_thr_t* thr, /* in: query thread */ + trx_t* trx) /* in: transaction */ +{ + ut_ad(thr->state == QUE_THR_RUNNING); + + thr->state = QUE_THR_COMPLETED; + + thr->is_active = FALSE; + (thr->graph)->n_active_thrs--; + + trx->n_active_thrs--; +} + /************************************************************************** Prints info of an SQL query graph node. */ |