From: wessels <> Date: Sat, 9 May 1998 04:06:52 +0000 (+0000) Subject: clean up checking -lcrypt and -lpthread X-Git-Tag: SQUID_3_0_PRE1~3363 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0f5a16f8116f8392c9745023e95bef5f82cb2f62;p=thirdparty%2Fsquid.git clean up checking -lcrypt and -lpthread --- diff --git a/configure b/configure index 68e8adcbe7..5614dabdbd 100755 --- a/configure +++ b/configure @@ -566,7 +566,7 @@ fi -# From configure.in Revision: 1.125 +# From configure.in Revision: 1.126 ac_aux_dir= for ac_dir in cfgaux $srcdir/cfgaux; do if test -f $ac_dir/install-sh; then @@ -3397,15 +3397,25 @@ LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 - CRYPTLIB="-lcrypt" + ac_tr_lib=HAVE_LIB`echo crypt | sed -e 's/[^a-zA-Z0-9_]/_/g' \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` + cat >> confdefs.h <&6 fi +if test $ac_cv_lib_crypt_crypt = "yes"; then + CRYPTLIB="-lcrypt" +fi echo $ac_n "checking for main in -lpthread""... $ac_c" 1>&6 -echo "configure:3409: checking for main in -lpthread" >&5 +echo "configure:3419: checking for main in -lpthread" >&5 ac_lib_var=`echo pthread'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3413,14 +3423,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lpthread $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3434: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3435,11 +3445,21 @@ LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 - PTHREADLIB="-lpthread" + ac_tr_lib=HAVE_LIB`echo pthread | sed -e 's/[^a-zA-Z0-9_]/_/g' \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` + cat >> confdefs.h <&6 fi +if test $ac_cv_lib_pthread_main = "yes"; then + PTHREADLIB="-lpthread" +fi case "$host" in @@ -3524,12 +3544,12 @@ for ac_func in \ do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3528: checking for $ac_func" >&5 +echo "configure:3548: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3576: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3590,12 +3610,12 @@ case "$host" in ;; *) echo $ac_n "checking for poll""... $ac_c" 1>&6 -echo "configure:3594: checking for poll" >&5 +echo "configure:3614: checking for poll" >&5 if eval "test \"`echo '$''{'ac_cv_func_poll'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3642: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_poll=yes" else @@ -3641,7 +3661,7 @@ fi esac echo $ac_n "checking if setresuid is implemented""... $ac_c" 1>&6 -echo "configure:3645: checking if setresuid is implemented" >&5 +echo "configure:3665: checking if setresuid is implemented" >&5 if eval "test \"`echo '$''{'ac_cv_func_setresuid'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3649,7 +3669,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < @@ -3662,7 +3682,7 @@ else } EOF -if { (eval echo configure:3666: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3686: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_func_setresuid="yes" else @@ -3696,20 +3716,20 @@ if test -z "$USE_GNUREGEX" ; then esac fi echo $ac_n "checking if GNUregex needs to be compiled""... $ac_c" 1>&6 -echo "configure:3700: checking if GNUregex needs to be compiled" >&5 +echo "configure:3720: checking if GNUregex needs to be compiled" >&5 if test -z "$USE_GNUREGEX"; then if test "$ac_cv_func_regcomp" = "no" || test "$USE_GNUREGEX" = "yes" ; then USE_GNUREGEX="yes" else cat > conftest.$ac_ext < int main() { regex_t t; regcomp(&t,"",0); ; return 0; } EOF -if { (eval echo configure:3713: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3733: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* USE_GNUREGEX="no" else @@ -3739,12 +3759,12 @@ for ac_func in \ do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3743: checking for $ac_func" >&5 +echo "configure:3763: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3791: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3795,12 +3815,12 @@ done echo $ac_n "checking Default FD_SETSIZE value""... $ac_c" 1>&6 -echo "configure:3799: checking Default FD_SETSIZE value" >&5 +echo "configure:3819: checking Default FD_SETSIZE value" >&5 if test "$cross_compiling" = yes; then DEFAULT_FD_SETSIZE=256 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3848: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then DEFAULT_FD_SETSIZE=`cat conftestval` else @@ -3843,12 +3863,12 @@ EOF echo $ac_n "checking Maximum number of filedescriptors we can open""... $ac_c" 1>&6 -echo "configure:3847: checking Maximum number of filedescriptors we can open" >&5 +echo "configure:3867: checking Maximum number of filedescriptors we can open" >&5 if test "$cross_compiling" = yes; then SQUID_MAXFD=256 else cat > conftest.$ac_ext < @@ -3907,7 +3927,7 @@ main() { } EOF -if { (eval echo configure:3911: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3931: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then SQUID_MAXFD=`cat conftestval` else @@ -3933,12 +3953,12 @@ if test "$SQUID_MAXFD" -lt 512 ; then fi echo $ac_n "checking Default UDP send buffer size""... $ac_c" 1>&6 -echo "configure:3937: checking Default UDP send buffer size" >&5 +echo "configure:3957: checking Default UDP send buffer size" >&5 if test "$cross_compiling" = yes; then SQUID_UDP_SO_SNDBUF=16384 else cat > conftest.$ac_ext < @@ -3957,7 +3977,7 @@ main () } EOF -if { (eval echo configure:3961: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3981: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then SQUID_UDP_SO_SNDBUF=`cat conftestval` else @@ -3976,12 +3996,12 @@ EOF echo $ac_n "checking Default UDP receive buffer size""... $ac_c" 1>&6 -echo "configure:3980: checking Default UDP receive buffer size" >&5 +echo "configure:4000: checking Default UDP receive buffer size" >&5 if test "$cross_compiling" = yes; then SQUID_UDP_SO_RCVBUF=16384 else cat > conftest.$ac_ext < @@ -4000,7 +4020,7 @@ main () } EOF -if { (eval echo configure:4004: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4024: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then SQUID_UDP_SO_RCVBUF=`cat conftestval` else @@ -4019,12 +4039,12 @@ EOF echo $ac_n "checking Default TCP send buffer size""... $ac_c" 1>&6 -echo "configure:4023: checking Default TCP send buffer size" >&5 +echo "configure:4043: checking Default TCP send buffer size" >&5 if test "$cross_compiling" = yes; then SQUID_TCP_SO_SNDBUF=16384 else cat > conftest.$ac_ext < @@ -4043,7 +4063,7 @@ main () } EOF -if { (eval echo configure:4047: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4067: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then SQUID_TCP_SO_SNDBUF=`cat conftestval` else @@ -4062,12 +4082,12 @@ EOF echo $ac_n "checking Default TCP receive buffer size""... $ac_c" 1>&6 -echo "configure:4066: checking Default TCP receive buffer size" >&5 +echo "configure:4086: checking Default TCP receive buffer size" >&5 if test "$cross_compiling" = yes; then SQUID_TCP_SO_RCVBUF=16384 else cat > conftest.$ac_ext < @@ -4086,7 +4106,7 @@ main () } EOF -if { (eval echo configure:4090: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4110: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then SQUID_TCP_SO_RCVBUF=`cat conftestval` else @@ -4105,19 +4125,19 @@ EOF echo $ac_n "checking if sys_errlist is already defined""... $ac_c" 1>&6 -echo "configure:4109: checking if sys_errlist is already defined" >&5 +echo "configure:4129: checking if sys_errlist is already defined" >&5 if eval "test \"`echo '$''{'ac_cv_needs_sys_errlist'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { char *s = sys_errlist0; ; return 0; } EOF -if { (eval echo configure:4121: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4141: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_needs_sys_errlist="no" else @@ -4139,16 +4159,16 @@ EOF fi echo $ac_n "checking for libresolv _dns_ttl_ hack""... $ac_c" 1>&6 -echo "configure:4143: checking for libresolv _dns_ttl_ hack" >&5 +echo "configure:4163: checking for libresolv _dns_ttl_ hack" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4172: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* echo "$ac_t""yes" 1>&6 cat >> confdefs.h <<\EOF @@ -4177,6 +4197,9 @@ fi if test -z "$XTRA_LIBS"; then XTRA_LIBS="$LIBS" + XTRA_LIBS=`echo $XTRA_LIBS | sed -e "s/-lcrypt//"` + XTRA_LIBS=`echo $XTRA_LIBS | sed -e "s/-lpthread//"` + XTRA_LIBS=`echo $XTRA_LIBS | sed -e "s/ */ /g"` LIBS='' fi diff --git a/configure.in b/configure.in index 932b9a0f58..b7be2e27c7 100644 --- a/configure.in +++ b/configure.in @@ -3,13 +3,13 @@ dnl Configuration input file for Squid dnl dnl Duane Wessels, wessels@nlanr.net, February 1996 (autoconf v2.9) dnl -dnl $Id: configure.in,v 1.126 1998/04/27 19:48:01 wessels Exp $ +dnl $Id: configure.in,v 1.127 1998/05/08 22:06:52 wessels Exp $ dnl dnl dnl AC_INIT(src/main.c) AC_CONFIG_HEADER(include/autoconf.h) -AC_REVISION($Revision: 1.126 $)dnl +AC_REVISION($Revision: 1.127 $)dnl AC_PREFIX_DEFAULT(/usr/local/squid) AC_CONFIG_AUX_DIR(cfgaux) @@ -584,12 +584,18 @@ AC_CHECK_LIB(m, main) dnl Check for libcrypt dnl We use crypt(3) which may be in libc, or in libcrypt (eg FreeBSD) -AC_CHECK_LIB(crypt, crypt, [CRYPTLIB="-lcrypt"]) +AC_CHECK_LIB(crypt, crypt) +if test $ac_cv_lib_crypt_crypt = "yes"; then + CRYPTLIB="-lcrypt" +fi AC_SUBST(CRYPTLIB) dnl Check for pthreads dnl We use pthreads when doing ASYNC I/O -AC_CHECK_LIB(pthread, main, [PTHREADLIB="-lpthread"]) +AC_CHECK_LIB(pthread, main) +if test $ac_cv_lib_pthread_main = "yes"; then + PTHREADLIB="-lpthread" +fi AC_SUBST(PTHREADLIB) dnl System-specific library modifications @@ -970,6 +976,12 @@ AC_SUBST(XTRA_OBJS) if test -z "$XTRA_LIBS"; then XTRA_LIBS="$LIBS" + dnl -lcrypt is set in CRYPTLIB + XTRA_LIBS=`echo $XTRA_LIBS | sed -e "s/-lcrypt//"` + dnl -lpthread is set in PTHREADLIB + XTRA_LIBS=`echo $XTRA_LIBS | sed -e "s/-lpthread//"` + dnl minor cleanup + XTRA_LIBS=`echo $XTRA_LIBS | sed -e "s/ */ /g"` LIBS='' fi AC_SUBST(XTRA_LIBS) diff --git a/include/autoconf.h.in b/include/autoconf.h.in index be24794bfb..59a6f32272 100644 --- a/include/autoconf.h.in +++ b/include/autoconf.h.in @@ -485,6 +485,9 @@ /* Define if you have the bsd library (-lbsd). */ #undef HAVE_LIBBSD +/* Define if you have the crypt library (-lcrypt). */ +#undef HAVE_LIBCRYPT + /* Define if you have the gnumalloc library (-lgnumalloc). */ #undef HAVE_LIBGNUMALLOC @@ -497,6 +500,9 @@ /* Define if you have the nsl library (-lnsl). */ #undef HAVE_LIBNSL +/* Define if you have the pthread library (-lpthread). */ +#undef HAVE_LIBPTHREAD + /* Define if you have the resolv library (-lresolv). */ #undef HAVE_LIBRESOLV