diff options
author | joerg@mysql.com <> | 2005-04-20 20:38:57 +0200 |
---|---|---|
committer | joerg@mysql.com <> | 2005-04-20 20:38:57 +0200 |
commit | eaa79cb45234f4a675919cb4565adac45601e971 (patch) | |
tree | b82b278a25646c3778f5067f40248a6aa21d3700 | |
parent | 48ba5e495666fd5db051c1a1aa9d4d61a85f07c0 (diff) | |
download | mariadb-git-eaa79cb45234f4a675919cb4565adac45601e971.tar.gz |
Step 2 of the switch to support configuration with NPTL:
Define a new CPP symbol that the target OS is Linux, and use it where only the OS matters and not the threads Library.
Until now, 'HAVE_LINUXTHREADS' was used to indicate "Target is Linux" in many places.
When we support configuration with NPTL but no Linuxthreads, this misuse must cease.
-rw-r--r-- | configure.in | 1 | ||||
-rw-r--r-- | include/my_global.h | 8 | ||||
-rw-r--r-- | mysys/thr_mutex.c | 2 | ||||
-rw-r--r-- | sql/stacktrace.c | 4 | ||||
-rw-r--r-- | sql/stacktrace.h | 4 | ||||
-rw-r--r-- | tools/mysqlmanager.c | 2 |
6 files changed, 11 insertions, 10 deletions
diff --git a/configure.in b/configure.in index 6650c0fc64a..f7a266eebec 100644 --- a/configure.in +++ b/configure.in @@ -412,6 +412,7 @@ then MYSQLD_DEFAULT_SWITCHES="--skip-locking" TARGET_LINUX="true" AC_MSG_RESULT("yes"); + AC_DEFINE([TARGET_OS_LINUX], [1], [Whether we build for Linux]) else MYSQLD_DEFAULT_SWITCHES="" TARGET_LINUX="false" diff --git a/include/my_global.h b/include/my_global.h index 23cf0d54824..a027bf9d2bb 100644 --- a/include/my_global.h +++ b/include/my_global.h @@ -97,7 +97,7 @@ /* Fix problem with S_ISLNK() on Linux */ -#if defined(HAVE_LINUXTHREADS) +#if defined(TARGET_OS_LINUX) #undef _GNU_SOURCE #define _GNU_SOURCE 1 #endif @@ -214,13 +214,13 @@ C_MODE_START int __cxa_pure_virtual() {\ #endif /* In Linux-alpha we have atomic.h if we are using gcc */ -#if defined(HAVE_LINUXTHREADS) && defined(__GNUC__) && defined(__alpha__) && (__GNUC__ > 2 || ( __GNUC__ == 2 && __GNUC_MINOR__ >= 95)) && !defined(HAVE_ATOMIC_ADD) +#if defined(TARGET_OS_LINUX) && defined(__GNUC__) && defined(__alpha__) && (__GNUC__ > 2 || ( __GNUC__ == 2 && __GNUC_MINOR__ >= 95)) && !defined(HAVE_ATOMIC_ADD) #define HAVE_ATOMIC_ADD #define HAVE_ATOMIC_SUB #endif /* In Linux-ia64 including atomic.h will give us an error */ -#if (defined(HAVE_LINUXTHREADS) && defined(__GNUC__) && (defined(__ia64__)||defined(__powerpc64__))) || !defined(THREAD) +#if (defined(TARGET_OS_LINUX) && defined(__GNUC__) && (defined(__ia64__)||defined(__powerpc64__))) || !defined(THREAD) #undef HAVE_ATOMIC_ADD #undef HAVE_ATOMIC_SUB #endif @@ -755,7 +755,7 @@ typedef unsigned long uint32; /* Short for unsigned integer >= 32 bits */ error "Neither int or long is of 4 bytes width" #endif -#if !defined(HAVE_ULONG) && !defined(HAVE_LINUXTHREADS) && !defined(__USE_MISC) +#if !defined(HAVE_ULONG) && !defined(TARGET_OS_LINUX) && !defined(__USE_MISC) typedef unsigned long ulong; /* Short for unsigned long */ #endif #ifndef longlong_defined diff --git a/mysys/thr_mutex.c b/mysys/thr_mutex.c index bbcfaa8bba6..2facb4e18cf 100644 --- a/mysys/thr_mutex.c +++ b/mysys/thr_mutex.c @@ -17,7 +17,7 @@ /* This makes a wrapper for mutex handling to make it easier to debug mutex */ #include <my_global.h> -#if defined(HAVE_LINUXTHREADS) && !defined (__USE_UNIX98) +#if defined(TARGET_OS_LINUX) && !defined (__USE_UNIX98) #define __USE_UNIX98 /* To get rw locks under Linux */ #endif #if defined(THREAD) && defined(SAFE_MUTEX) diff --git a/sql/stacktrace.c b/sql/stacktrace.c index 322d647e741..838f547dc02 100644 --- a/sql/stacktrace.c +++ b/sql/stacktrace.c @@ -43,7 +43,7 @@ void safe_print_str(const char* name, const char* val, int max_len) fputc('\n', stderr); } -#ifdef HAVE_LINUXTHREADS +#ifdef TARGET_OS_LINUX #define SIGRETURN_FRAME_COUNT 2 #if defined(__alpha__) && defined(__GNUC__) @@ -201,7 +201,7 @@ end: stack trace is much more helpful in diagnosing the problem, so please do \n\ resolve it\n"); } -#endif /* HAVE_LINUXTHREADS */ +#endif /* TARGET_OS_LINUX */ #endif /* HAVE_STACKTRACE */ /* Produce a core for the thread */ diff --git a/sql/stacktrace.h b/sql/stacktrace.h index 980e1ea07eb..d5d1e05ef0e 100644 --- a/sql/stacktrace.h +++ b/sql/stacktrace.h @@ -18,7 +18,7 @@ extern "C" { #endif -#ifdef HAVE_LINUXTHREADS +#ifdef TARGET_OS_LINUX #if defined(HAVE_STACKTRACE) || (defined (__i386__) || (defined(__alpha__) && defined(__GNUC__))) #undef HAVE_STACKTRACE #define HAVE_STACKTRACE @@ -30,7 +30,7 @@ extern char* heap_start; void print_stacktrace(gptr stack_bottom, ulong thread_stack); void safe_print_str(const char* name, const char* val, int max_len); #endif /* (defined (__i386__) || (defined(__alpha__) && defined(__GNUC__))) */ -#endif /* HAVE_LINUXTHREADS */ +#endif /* TARGET_OS_LINUX */ /* Define empty prototypes for functions that are not implemented */ #ifndef HAVE_STACKTRACE diff --git a/tools/mysqlmanager.c b/tools/mysqlmanager.c index bb0a76d6c49..27caa1e0255 100644 --- a/tools/mysqlmanager.c +++ b/tools/mysqlmanager.c @@ -101,7 +101,7 @@ static CHARSET_INFO *cs= &my_charset_latin1; set by the user */ -#if defined(__i386__) && defined(HAVE_LINUXTHREADS) +#if defined(__i386__) && defined(TARGET_OS_LINUX) #define DO_STACKTRACE 1 #endif |