List:Commits« Previous MessageNext Message »
From:Chad MILLER Date:July 7 2006 12:32pm
Subject:bk commit into 4.0 tree (cmiller:1.2185)
View as plain text  
Below is the list of changes that have just been committed into a local
4.0 repository of cmiller. When cmiller does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet
  1.2185 06/07/07 08:32:15 cmiller@zippy.(none) +1 -0
  Backport autoconf thread test that uses 'getconf' instead of only 'grep'.

  configure.in
    1.336 06/07/07 08:32:10 cmiller@zippy.(none) +82 -48
    Backport autoconf thread test that uses 'getconf' instead of only 'grep'.

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	cmiller
# Host:	zippy.(none)
# Root:	/home/cmiller/work/mysql/mysql-4.0__bug19006

--- 1.335/configure.in	2006-05-11 13:48:23 -04:00
+++ 1.336/configure.in	2006-07-07 08:32:10 -04:00
@@ -1236,58 +1236,92 @@ esac
 # We have to check libc last because else it fails on Solaris 2.6
 
 with_posix_threads="no"
-# Hack for DEC-UNIX (OSF1)
+# Search thread lib on Linux
+if test "$with_named_thread" = "no"
+then
+    AC_MSG_CHECKING("Linux threads")
+    if test "$TARGET_LINUX" = "true"
+    then
+        AC_MSG_RESULT("starting")
+        # use getconf to check glibc contents
+        AC_MSG_CHECKING("getconf GNU_LIBPTHREAD_VERSION")
+        case `getconf GNU_LIBPTHREAD_VERSION | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ` in
+        NPTL* )
+                AC_MSG_RESULT("NPTL")
+                AC_DEFINE([HAVE_NPTL], [1], [NPTL threads implementation])
+                with_named_thread="-lpthread"
+                ;;
+        LINUXTHREADS* )
+                AC_MSG_RESULT("Linuxthreads")
+                AC_DEFINE([HAVE_LINUXTHREADS], [1], 
+                      [Whether we are using Xavier Leroy's LinuxThreads])
+                with_named_thread="-lpthread"
+                ;;
+        * )
+                AC_MSG_RESULT("unknown")
+                ;;
+        esac
+        if test "$with_named_thread" = "no"
+        then
+          # old method, check headers
+          # Look for LinuxThreads.
+          AC_MSG_CHECKING("LinuxThreads in header file comment")
+          res=`grep Linuxthreads /usr/include/pthread.h 2>/dev/null | wc -l`
+          if test "$res" -gt 0
+          then
+            AC_MSG_RESULT("Found")
+            AC_DEFINE([HAVE_LINUXTHREADS], [1],
+                  [Whether we are using Xavier Leroy's LinuxThreads])
+            # Linux 2.0 sanity check
+            AC_TRY_COMPILE([#include <sched.h>], [int a = sched_get_priority_min(1);], ,
+                  AC_MSG_ERROR([Syntax error in sched.h. Change _P to __P in the /usr/include/sched.h file. See the Installation chapter in the Reference Manual]))
+            # RedHat 5.0 does not work with dynamic linking of this. -static also
+            # gives a speed increase in linux so it does not hurt on other systems.
+            with_named_thread="-lpthread"
+          else
+            AC_MSG_RESULT("Not found")
+            # If this is a linux machine we should barf
+            AC_MSG_ERROR([This is a Linux system without a working getconf, 
+and Linuxthreads was not found. Please install it (or a new glibc) and try again.  
+See the Installation chapter in the Reference Manual for more information.])
+          fi
+        else
+            AC_MSG_RESULT("no need to check headers")
+        fi
+        
+        AC_MSG_CHECKING("for pthread_create in -lpthread");
+        ac_save_LIBS="$LIBS"
+        LIBS="$LIBS -lpthread"
+        AC_TRY_LINK( [#include <pthread.h>],
+              [ (void) pthread_create((pthread_t*) 0,(pthread_attr_t*) 0, 0, 0); ],
+              AC_MSG_RESULT("yes"),
+              [ AC_MSG_RESULT("no")
+                AC_MSG_ERROR([
+This is a Linux system claiming to support threads, either Linuxthreads or NPTL, but linking a test program failed.  
+Please install one of these (or a new glibc) and try again.  
+See the Installation chapter in the Reference Manual for more information.]) ]
+              )
+        LIBS="$ac_save_LIBS"
+    else
+        AC_MSG_RESULT("no")
+    fi  # "$TARGET_LINUX" 
+fi  # "$with_named_thread" = "no" -a "$with_mit_threads" = "no"
+
+# Hack for DEC-UNIX (OSF1 -> Tru64)
 if test "$with_named_thread" = "no" -a "$with_mit_threads" = "no"
 then
-  # Look for LinuxThreads.
-  AC_MSG_CHECKING("LinuxThreads")
-    res=`grep Linuxthreads /usr/include/pthread.h 2>/dev/null | wc -l`
-    if test "$res" -gt 0
+    AC_MSG_CHECKING("DEC threads post OSF/1 3.2")
+    if test -f /usr/shlib/libpthread.so -a -f /usr/lib/libmach.a -a -f /usr/ccs/lib/cmplrs/cc/libexc.a
     then
-      AC_MSG_RESULT("Found")
-      AC_DEFINE(HAVE_LINUXTHREADS)
-      # Linux 2.0 sanity check
-      AC_TRY_COMPILE([#include <sched.h>], [int a = sched_get_priority_min(1);], ,
-      AC_MSG_ERROR([Syntax error in sched.h. Change _P to __P in the /usr/include/sched.h file. See the Installation chapter in the Reference Manual]))
-      # RedHat 5.0 does not work with dynamic linking of this. -static also
-      # gives a speed increase in linux so it does not hurt on other systems.
-      with_named_thread="-lpthread"
+      with_named_thread="-lpthread -lmach -lexc"
+      CFLAGS="$CFLAGS -D_REENTRANT"
+      CXXFLAGS="$CXXFLAGS -D_REENTRANT"
+      AC_DEFINE(HAVE_DEC_THREADS, [1], [Whether we are using DEC threads])
+      AC_MSG_RESULT("yes")
     else
-      AC_MSG_RESULT("Not found")
-      # If this is a linux machine we should barf
-      if test "$IS_LINUX" = "true"
-      then
-	AC_MSG_ERROR([This is a linux system and Linuxthreads was not
-found. On linux Linuxthreads should be used.  Please install Linuxthreads
-(or a new glibc) and try again.  See the Installation chapter in the
-Reference Manual for more information.])
-      else
-	AC_MSG_CHECKING("DEC threads")
-        if test -f /usr/shlib/libpthread.so -a -f /usr/lib/libmach.a -a -f /usr/ccs/lib/cmplrs/cc/libexc.a
-	then
-	  with_named_thread="-lpthread -lmach -lexc"
-	  CFLAGS="$CFLAGS -D_REENTRANT"
-	  CXXFLAGS="$CXXFLAGS -D_REENTRANT"
-	  AC_DEFINE(HAVE_DEC_THREADS)
-	  AC_MSG_RESULT("yes")
-	else
-	  AC_MSG_RESULT("no")
-	  AC_MSG_CHECKING("DEC 3.2 threads")
-          if test -f /usr/shlib/libpthreads.so -a -f /usr/lib/libmach.a -a -f /usr/ccs/lib/cmplrs/cc/libexc.a
-	  then
-	    with_named_thread="-lpthreads -lmach -lc_r"
-	    AC_DEFINE(HAVE_DEC_THREADS)
-	    AC_DEFINE(HAVE_DEC_3_2_THREADS)
-            with_osf32_threads="yes"
-            MYSQLD_DEFAULT_SWITCHES="--skip-thread-priority"
-	    AC_MSG_RESULT("yes")
-	  else
-	    AC_MSG_RESULT("no")
-          fi
-	fi
-     fi
-   fi
-fi
+      AC_MSG_RESULT("no")
+    fi  # DEC threads
+fi  # "$with_named_thread" = "no" -a "$with_mit_threads" = "no"
 
 
 dnl This is needed because -lsocket has to come after the thread
Thread
bk commit into 4.0 tree (cmiller:1.2185)Chad MILLER7 Jul