From 9a6c50f5525c0eba739a4e3f500e91ef407e69b6 Mon Sep 17 00:00:00 2001 From: James Peach Date: Sat, 13 Aug 2005 09:43:12 +0000 Subject: r9302: Change AC_LIBTESTFUNC to check in the current $LIBS before adding the new library. This stop us adding spurious libraries when the symbol we are looking for is in libc. Bugzilla bug #2471. (This used to be commit e1fee059e8de782bc9de671dc8757dbaa3e3e091) --- source3/aclocal.m4 | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'source3/aclocal.m4') diff --git a/source3/aclocal.m4 b/source3/aclocal.m4 index 6acd14e19f..af93aa2368 100644 --- a/source3/aclocal.m4 +++ b/source3/aclocal.m4 @@ -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], -- cgit