From: Amos Jeffries Date: Wed, 17 Dec 2008 06:07:03 +0000 (+1300) Subject: Smart pthread library linkage X-Git-Tag: SQUID_3_2_0_1~1291 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5a3a3a6c0008a8604fa985d1545fd03da7cfc825;p=thirdparty%2Fsquid.git 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. --- diff --git a/configure.in b/configure.in index 5817385591..239cdaee2c 100644 --- a/configure.in +++ b/configure.in @@ -692,6 +692,33 @@ if test "$with_aio" = "yes"; then ) 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 @@ if test "$with_dl" = "yes"; then 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 dnl Mon, 18 Jan 1999 17:48:00 GMT