]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Experimental Solaris 10 pthreads Support
authorAmos Jeffries <squid3@treenet.co.nz>
Tue, 3 Mar 2009 13:02:21 +0000 (02:02 +1300)
committerAmos Jeffries <squid3@treenet.co.nz>
Tue, 3 Mar 2009 13:02:21 +0000 (02:02 +1300)
Why is it going in since its experimental?
 - we need a snapshot to test the configure code with.
 - side testing indicates this new option is best and does work under
   some conditions with only Solaris native compiler to build with.

configure.in

index 8fb385d12a65ecf9b0fd57f34ec0a0154caf3a32..0fd7ef57f00729b198fd1fe6bf50a5de1144c9eb 100644 (file)
@@ -668,6 +668,10 @@ fi
 
 dnl Check for pthreads
 dnl We use pthreads when doing ASYNC I/O
+dnl
+dnl TODO: this needs to be re-coded to handle more systems and better
+dnl REF: http://www.openldap.org/lists/openldap-bugs/200006/msg00070.html
+dnl REF: http://autoconf-archive.cryp.to/acx_pthread.html
 if test "$with_pthreads" = "yes"; then
     SQUID_CFLAGS="$SQUID_CFLAGS -D_REENTRANT"
     SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_REENTRANT"
@@ -683,14 +687,25 @@ if test "$with_pthreads" = "yes"; then
         if test "$GCC" = "yes" ; then
            SQUID_CFLAGS="$SQUID_CFLAGS -pthreads"
            SQUID_CXXFLAGS="$SQUID_CXXFLAGS -pthreads"
+            AC_CHECK_LIB(pthread, main,[DISK_LIBS="$DISK_LIBS -lpthread"],
+              [ AC_MSG_ERROR(pthread library required but cannot be found.) ])
        else
-           SQUID_CFLAGS="$SQUID_CFLAGS -mt"
-           SQUID_CXXFLAGS="$SQUID_CXXFLAGS -mt"
+dnl test for -lpthread first. libc version is a stub apparently on Solaris.
+           SQUID_CFLAGS="$SQUID_CFLAGS -lpthread"
+           SQUID_CXXFLAGS="$SQUID_CXXFLAGS -lpthread"
+            AC_CHECK_LIB(pthread, main,[DISK_LIBS="$DISK_LIBS -lpthread"],
+              [ SQUID_CFLAGS="$SQUID_CFLAGS -lpthread -mt"
+               SQUID_CXXFLAGS="$SQUID_CXXFLAGS -lpthread -mt"
+                AC_CHECK_LIB(pthread, main,[DISK_LIBS="$DISK_LIBS -lpthread"],
+                  [ AC_MSG_ERROR(pthread library required but cannot be found.) ])
+            ])
         fi
     ;;
+    *)
+      AC_CHECK_LIB(pthread, main,[DISK_LIBS="$DISK_LIBS -lpthread"],
+        [ AC_MSG_ERROR(pthread library required but cannot be found.) ])
+    ;;
     esac
-    AC_CHECK_LIB(pthread, main,[DISK_LIBS="$DISK_LIBS -lpthread"],
-      [ AC_MSG_ERROR(pthread library required but cannot be found.) ])
 fi
 
 AC_SUBST(DISK_MODULES)