Patch to look for dbm functions in std libs
authoraland <aland>
Fri, 20 Dec 2002 15:31:26 +0000 (15:31 +0000)
committeraland <aland>
Fri, 20 Dec 2002 15:31:26 +0000 (15:31 +0000)
from Andrei Koulik

src/modules/rlm_dbm/configure
src/modules/rlm_dbm/configure.in

index f415ddd..7b10843 100755 (executable)
@@ -525,7 +525,7 @@ else
 fi
 
 
-# From configure.in Revision: 1.8 
+# From configure.in Revision: 1.9 
 
 
 if test x$with_rlm_dbm != xno; then
@@ -1178,14 +1178,35 @@ fi
                        fi
                fi
        fi
-
-       smart_try_dir=$rlm_dbm_lib_dir
-       
+       echo $ac_n "checking for dbm in default lib""... $ac_c" 1>&6
+echo "configure:1183: checking for dbm in default lib" >&5
+       cat > conftest.$ac_ext <<EOF
+#line 1185 "configure"
+#include "confdefs.h"
+extern void* dbm_open();
+int main() {
+dbm_open()
+; return 0; }
+EOF
+if { (eval echo configure:1192: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  ac_cv_lib_default_dbm_open=yes
+               echo "$ac_t""yes" 1>&6
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  echo "$ac_t""no" 1>&6
+fi
+rm -f conftest*
+       if test "x$ac_cv_lib_default_dbm_open" != "xyes"; then
+               smart_try_dir=$rlm_dbm_lib_dir
+               
 
 sm_lib_safe=`echo "ndbm" | sed 'y%./+-%__p_%'`
 sm_func_safe=`echo "dbm_open" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for dbm_open in -lndbm""... $ac_c" 1>&6
-echo "configure:1189: checking for dbm_open in -lndbm" >&5
+echo "configure:1210: checking for dbm_open in -lndbm" >&5
 
 smart_lib=
 smart_lib_dir=
@@ -1193,14 +1214,14 @@ smart_lib_dir=
   old_LIBS="$LIBS"
   LIBS="$LIBS -lndbm"
   cat > conftest.$ac_ext <<EOF
-#line 1197 "configure"
+#line 1218 "configure"
 #include "confdefs.h"
 extern char dbm_open();
 int main() {
  dbm_open()
 ; return 0; }
 EOF
-if { (eval echo configure:1204: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1225: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   smart_lib="-lndbm"
 else
@@ -1269,14 +1290,14 @@ eval "smart_lib_dir=\"\$smart_lib_dir $DIRS\""
       LIBS="$old_LIBS -L$try -lndbm"
 
       cat > conftest.$ac_ext <<EOF
-#line 1273 "configure"
+#line 1294 "configure"
 #include "confdefs.h"
 extern char dbm_open();
 int main() {
  dbm_open()
 ; return 0; }
 EOF
-if { (eval echo configure:1280: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1301: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   smart_lib="-L$try -lndbm"
 else
@@ -1300,13 +1321,13 @@ rm -f conftest*
     echo "$ac_t""no" 1>&6 
 fi
 
-       if test "x$ac_cv_lib_ndbm_dbm_open" != "xyes"; then
-               
+               if test "x$ac_cv_lib_ndbm_dbm_open" != "xyes"; then
+                       
 
 sm_lib_safe=`echo "gdbm" | sed 'y%./+-%__p_%'`
 sm_func_safe=`echo "dbm_open" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for dbm_open in -lgdbm""... $ac_c" 1>&6
-echo "configure:1310: checking for dbm_open in -lgdbm" >&5
+echo "configure:1331: checking for dbm_open in -lgdbm" >&5
 
 smart_lib=
 smart_lib_dir=
@@ -1314,14 +1335,14 @@ smart_lib_dir=
   old_LIBS="$LIBS"
   LIBS="$LIBS -lgdbm"
   cat > conftest.$ac_ext <<EOF
-#line 1318 "configure"
+#line 1339 "configure"
 #include "confdefs.h"
 extern char dbm_open();
 int main() {
  dbm_open()
 ; return 0; }
 EOF
-if { (eval echo configure:1325: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1346: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   smart_lib="-lgdbm"
 else
@@ -1390,14 +1411,14 @@ eval "smart_lib_dir=\"\$smart_lib_dir $DIRS\""
       LIBS="$old_LIBS -L$try -lgdbm"
 
       cat > conftest.$ac_ext <<EOF
-#line 1394 "configure"
+#line 1415 "configure"
 #include "confdefs.h"
 extern char dbm_open();
 int main() {
  dbm_open()
 ; return 0; }
 EOF
-if { (eval echo configure:1401: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1422: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   smart_lib="-L$try -lgdbm"
 else
@@ -1421,8 +1442,9 @@ rm -f conftest*
     echo "$ac_t""no" 1>&6 
 fi
 
-               if test "x$ac_cv_lib_gdbm_dbm_open" != "xyes"; then
-                       fail="$fail (libndbm or libgdm)"
+                       if test "x$ac_cv_lib_gdbm_dbm_open" != "xyes"; then
+                               fail="$fail (libndbm or libgdm)"
+                       fi
                fi
        fi
 
index 4195a0e..64bff70 100644 (file)
@@ -57,13 +57,17 @@ if test x$with_[]modname != xno; then
                        fi
                fi
        fi
-
-       smart_try_dir=$rlm_dbm_lib_dir
-       AC_SMART_CHECK_LIB(ndbm, dbm_open)
-       if test "x$ac_cv_lib_ndbm_dbm_open" != "xyes"; then
-               AC_SMART_CHECK_LIB(gdbm, dbm_open)
-               if test "x$ac_cv_lib_gdbm_dbm_open" != "xyes"; then
-                       fail="$fail (libndbm or libgdm)"
+       AC_MSG_CHECKING([for dbm in default lib])
+       AC_TRY_LINK([extern void* dbm_open();],dbm_open(),[ac_cv_lib_default_dbm_open=yes
+               AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no)])
+       if test "x$ac_cv_lib_default_dbm_open" != "xyes"; then
+               smart_try_dir=$rlm_dbm_lib_dir
+               AC_SMART_CHECK_LIB(ndbm, dbm_open)
+               if test "x$ac_cv_lib_ndbm_dbm_open" != "xyes"; then
+                       AC_SMART_CHECK_LIB(gdbm, dbm_open)
+                       if test "x$ac_cv_lib_gdbm_dbm_open" != "xyes"; then
+                               fail="$fail (libndbm or libgdm)"
+                       fi
                fi
        fi