r11375: Update to the latest config.guess and config.sub files.
[kai/samba.git] / source3 / aclocal.m4
index 6de11953b44ce12243c63fe12930763ef40ce8f2..af93aa236851e4c358678b9851921370cec18769 100644 (file)
@@ -102,16 +102,22 @@ AC_DEFUN(AC_HAVE_DECL,
 ])
 
 
-dnl check for a function in a library, but don't
+dnl Check for a function in a library, but don't
 dnl keep adding the same library to the LIBS variable.
+dnl Check whether the function is available in the current
+dnl LIBS before adding the library. This prevents us spuriously
+dnl finding symbols that are in libc.
 dnl AC_LIBTESTFUNC(lib,func)
 AC_DEFUN(AC_LIBTESTFUNC,
-[case "$LIBS" in
-  *-l$1*) AC_CHECK_FUNCS($2) ;;
-  *) AC_CHECK_LIB($1, $2) 
-     AC_CHECK_FUNCS($2)
-  ;;
-  esac
+[
+  AC_CHECK_FUNCS($2, [],
+      [ case "$LIBS" in
+          *-l$1*) AC_CHECK_FUNCS($2) ;;
+          *) AC_CHECK_LIB($1, $2) 
+             AC_CHECK_FUNCS($2)
+          ;;
+        esac
+      ])
 ])
 
 # AC_CHECK_LIB_EXT(LIBRARY, [EXT_LIBS], [FUNCTION],
@@ -564,17 +570,6 @@ AC_DEFUN(jm_ICONV,
     jm_cv_lib_iconv=""
     jm_cv_giconv=no
     jm_save_LIBS="$LIBS"
-    LIBS="$LIBS -lbiconv"
-    AC_TRY_LINK([#include <stdlib.h>
-#include <biconv.h>],
-        [iconv_t cd = iconv_open("","");
-         iconv(cd,NULL,NULL,NULL,NULL);
-         iconv_close(cd);],
-      jm_cv_func_iconv=yes
-      jm_cv_biconv=yes
-      jm_cv_include="biconv.h"
-      jm_cv_lib_iconv="biconv")
-      LIBS="$jm_save_LIBS"
 
     dnl Check for include in funny place but no lib needed
     if test "$jm_cv_func_iconv" != yes; then