From: hno <> Date: Tue, 23 May 2006 06:28:14 +0000 (+0000) Subject: Do the dbopen compile test proper to see if -ldb is needed X-Git-Tag: SQUID_3_0_PRE4~106 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=32d0bbd76846571ae7644161ae8d21eaa1df452c;p=thirdparty%2Fsquid.git Do the dbopen compile test proper to see if -ldb is needed --- diff --git a/configure b/configure index 35f85fef79..5752bc4d94 100755 --- a/configure +++ b/configure @@ -39009,6 +39009,7 @@ if test "${ac_cv_dbopen_libdb+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else +SAVED_LIBS="$LIBS"; LIBS="$LIBS -ldb" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -39035,9 +39036,9 @@ dbopen((void *)0L, 0, 0, DB_HASH, (void *)0L) return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -39051,25 +39052,29 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - LIB_DB="-ldb" - ac_cv_dbopen_libdb="yes" + ac_cv_dbopen_libdb="yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_dbopen_libdb="no" fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS="$SAVED_LIBS" fi echo "$as_me:$LINENO: result: $ac_cv_dbopen_libdb" >&5 echo "${ECHO_T}$ac_cv_dbopen_libdb" >&6 +if test ac_cv_dbopen_libdb = yes; then + LIB_DB="-ldb" +fi case "$host" in diff --git a/configure.in b/configure.in index a0fca20cb5..0cb06fb26d 100644 --- a/configure.in +++ b/configure.in @@ -3,7 +3,7 @@ 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.412 2006/05/22 21:22:06 hno Exp $ +dnl $Id: configure.in,v 1.413 2006/05/23 00:28:15 hno Exp $ dnl dnl dnl @@ -13,7 +13,7 @@ AC_CONFIG_SRCDIR([src/main.cc]) AC_CONFIG_AUX_DIR(cfgaux) AM_INIT_AUTOMAKE([tar-ustar]) AM_CONFIG_HEADER(include/autoconf.h) -AC_REVISION($Revision: 1.412 $)dnl +AC_REVISION($Revision: 1.413 $)dnl AC_PREFIX_DEFAULT(/usr/local/squid) AM_MAINTAINER_MODE @@ -2290,7 +2290,8 @@ dnl Check for libdb DBLIB= dnl 1.85 AC_CACHE_CHECK(if dbopen needs -ldb,ac_cv_dbopen_libdb, [ - AC_TRY_COMPILE([ +SAVED_LIBS="$LIBS"; LIBS="$LIBS -ldb" + AC_TRY_LINK([ #if HAVE_SYS_TYPES_H #include #endif @@ -2303,10 +2304,13 @@ AC_CACHE_CHECK(if dbopen needs -ldb,ac_cv_dbopen_libdb, [ #include #endif], [dbopen((void *)0L, 0, 0, DB_HASH, (void *)0L)], - LIB_DB="-ldb" ac_cv_dbopen_libdb="yes", ac_cv_dbopen_libdb="no") +LIBS="$SAVED_LIBS" ]) +if test ac_cv_dbopen_libdb = yes; then + LIB_DB="-ldb" +fi AC_SUBST(LIB_DB) dnl System-specific library modifications