bug-autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

BUG: autoconf 2.59 problem in macro AC_SEARCH_LIBS in libs.m4


From: Thomas Steudten
Subject: BUG: autoconf 2.59 problem in macro AC_SEARCH_LIBS in libs.m4
Date: Sun, 20 Jun 2004 23:35:26 +0200

Hello

The AC_SEARCH_LIBS() macro in libs/autoconf/libs.m4 for autoconf-2.59 produce a 
problem, if
no library is required.

The coreutils package use the macro like this:
 AC_SEARCH_LIBS(nanosleep, [rt posix4], [LIB_NANOSLEEP=$ac_cv_search_nanosleep])

So, if no library is required, the variable $ac_cv_search_nanosleep
contains the string "none required". With the substitution
of @LIB_NANOSLEEP@ eg. in the Makefile.in, the string is inserted
as a library name and so the linker fails.

Workaround:
Set the ac_ variable to the empty string "", if no library is required.
See patch:

--- lib/autoconf/libs.orig      2003-05-22 14:05:13.000000000 +0200
+++ lib/autoconf/libs.m4        2004-06-20 16:50:22.000000000 +0200
@@ -66,6 +66,8 @@
 #                [OTHER-LIBRARIES])
 # --------------------------------------------------------
 # Search for a library defining FUNC, if it's not already available.
+# Fix version 2.59: If "none required" ->  set to empty string.
+# Thomas Steudten <thomas at steudten dot com> 06/20/2004
 AC_DEFUN([AC_SEARCH_LIBS],
 [AC_CACHE_CHECK([for library containing $1], [ac_cv_search_$1],
 [ac_func_search_save_LIBS=$LIBS
@@ -82,7 +84,7 @@
 fi
 LIBS=$ac_func_search_save_LIBS])
 AS_IF([test "$ac_cv_search_$1" != no],
-  [test "$ac_cv_search_$1" = "none required" || LIBS="$ac_cv_search_$1 $LIBS"
+ [test "$ac_cv_search_$1" = "none required" && ac_cv_search_$1="" || LIBS="$ac_cv_search_$1 $LIBS"
   $3],
       [$4])dnl
 ])


--
Tom

LINUX user since kernel 0.99.x 1994.
RPM Alpha packages at http://alpha.steudten.com/packages
Want to know what S.u.S.E 1995 cdrom-set contains?






reply via email to

[Prev in Thread] Current Thread [Next in Thread]