Commit eaa79cb4 authored by joerg@mysql.com's avatar joerg@mysql.com

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.
parent 48ba5e49
......@@ -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"
......
......@@ -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
......
......@@ -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)
......
......@@ -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 @@ terribly wrong...\n");
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 */
......
......@@ -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
......
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment