[prev in list] [next in list] [prev in thread] [next in thread] 

List:       squid-cvs
Subject:    /bzr/squid3/trunk/ r9405: Smart pthread library linkage
From:       Amos Jeffries <squid3 () treenet ! co ! nz>
Date:       2008-12-17 6:07:03
Message-ID: 20081217061505.38363.qmail () squid-cache ! org
[Download RAW message or body]

--===============0383883221==
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

------------------------------------------------------------
revno: 9405
committer: Amos Jeffries <squid3@treenet.co.nz>
branch nick: trunk
timestamp: Wed 2008-12-17 19:07:03 +1300
message:
  Smart pthread library linkage
  
  Fixes linkage errors caused on some systes by a clash between the
  DiskIO library not being in src/ directly and impicit linkage used
  previously used by the auto-tools chain.
  
  * Only link it to objects linking DiskIO which need it explicitly.
  
  * Produce a fatal error message if its required but missing.
modified:
  configure.in

--===============0383883221==
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"; name="r9405.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

=== modified file 'configure.in'
--- a/configure.in	2008-12-10 20:19:50 +0000
+++ b/configure.in	2008-12-17 06:07:03 +0000
@@ -692,6 +692,33 @@
     )
 fi
 
+dnl Check for pthreads
+dnl We use pthreads when doing ASYNC I/O
+if test "$with_pthreads" = "yes"; then
+    SQUID_CFLAGS="$SQUID_CFLAGS -D_REENTRANT"
+    SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_REENTRANT"
+    case "$host" in
+    i386-unknown-freebsd*)
+        if test "$GCC" = "yes" ; then
+            if test -z "$PRESET_LDFLAGS"; then
+                LDFLAGS="$LDFLAGS -pthread"
+            fi
+        fi
+    ;;
+    *-solaris2.*)
+        if test "$GCC" = "yes" ; then
+	    SQUID_CFLAGS="$SQUID_CFLAGS -pthreads"
+	    SQUID_CXXFLAGS="$SQUID_CXXFLAGS -pthreads"
+	else
+	    SQUID_CFLAGS="$SQUID_CFLAGS -mt"
+	    SQUID_CXXFLAGS="$SQUID_CXXFLAGS -mt"
+        fi
+    ;;
+    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)
 AC_SUBST(DISK_LIBS)
 AC_SUBST(DISK_PROGRAMS)
@@ -2687,32 +2714,6 @@
     AC_CHECK_LIB(dl, dlopen)
 fi
 
-dnl Check for pthreads
-dnl We use pthreads when doing ASYNC I/O
-if test "$with_pthreads" = "yes"; then
-    SQUID_CFLAGS="$SQUID_CFLAGS -D_REENTRANT"
-    SQUID_CXXFLAGS="$SQUID_CXXFLAGS -D_REENTRANT"
-    case "$host" in
-    i386-unknown-freebsd*)
-        if test "$GCC" = "yes" ; then
-            if test -z "$PRESET_LDFLAGS"; then
-                LDFLAGS="$LDFLAGS -pthread"
-            fi
-        fi
-    ;;
-    *-solaris2.*)
-        if test "$GCC" = "yes" ; then
-	    SQUID_CFLAGS="$SQUID_CFLAGS -pthreads"
-	    SQUID_CXXFLAGS="$SQUID_CXXFLAGS -pthreads"
-	else
-	    SQUID_CFLAGS="$SQUID_CFLAGS -mt"
-	    SQUID_CXXFLAGS="$SQUID_CXXFLAGS -mt"
-        fi
-    ;;
-    esac
-    AC_CHECK_LIB(pthread, main)
-fi
-
 dnl -lintl is needed on SCO version 3.2v4.2 for strftime()
 dnl Robert Side <rside@aiinc.bc.ca>
 dnl Mon, 18 Jan 1999 17:48:00 GMT


--===============0383883221==--
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic