From: Amos Jeffries Date: Tue, 3 Mar 2009 13:02:21 +0000 (+1300) Subject: Experimental Solaris 10 pthreads Support X-Git-Tag: SQUID_3_2_0_1~1141 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e52ad5bb01b557c59b97f2e91971635f9e7288c5;p=thirdparty%2Fsquid.git Experimental Solaris 10 pthreads Support 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. --- diff --git a/configure.in b/configure.in index 8fb385d12a..0fd7ef57f0 100644 --- a/configure.in +++ b/configure.in @@ -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)