]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* acgeneral.m4 (AC_CHECK_LIB): Fix the cache var name to work
authorAkim Demaille <akim@epita.fr>
Wed, 6 Jun 2001 15:03:29 +0000 (15:03 +0000)
committerAkim Demaille <akim@epita.fr>
Wed, 6 Jun 2001 15:03:29 +0000 (15:03 +0000)
properly when $1 is not a literal.
Fixes PR Autoconf/187, reported by Bram Moolenaar.

BUGS
ChangeLog
NEWS
THANKS
acgeneral.m4
lib/autoconf/general.m4
tests/suite.at

diff --git a/BUGS b/BUGS
index 6be4c71bf8c8eb9a6da4c06591f495efa2c15591..9f531d92af9ba0abec839306360dbacce7d7795b 100644 (file)
--- a/BUGS
+++ b/BUGS
@@ -18,9 +18,3 @@ address them.
        /*--------------------------.
        | Good for production use.  |
        `--------------------------*/
-
-* Important bugs
-
-** AC_CHECK_LIB
-Does not work properly when given variables instead of literals, e.g.,
-AC_CHECK_LIB($foo, $bar).
index 3b9b2db82bfdffef0d15c0fa74d886028173a4ed..278a1cba56fbdbdc8a76f25153e2d9af6ae618dd 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2001-06-06  Akim Demaille  <akim@epita.fr>
+
+       * acgeneral.m4 (AC_CHECK_LIB): Fix the cache var name to work
+       properly when $1 is not a literal.
+       Fixes PR Autoconf/187, reported by Bram Moolenaar.
+
 2001-06-06  Akim Demaille  <akim@epita.fr>
 
        Invoking AC_COPYRIGHT before AC_INIT fails.
diff --git a/NEWS b/NEWS
index f2a4e471c62bd40d276d9b983734e571a2e7196b..10fdd6ba724b417efd88b523eea68bad0e6fa0ce 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -6,6 +6,8 @@ Now include stdint.h.
 - Mostly in the test suite.
 - Invocation of GNU M4 now robust to POSIXLY_CORRECT.
 - configure accepts --prefix='' again.
+- AC_CHECK_LIB works properly when its first argument is not a
+  literal.
 \f
 * Major changes in Autoconf 2.50
 
diff --git a/THANKS b/THANKS
index 5707edda4ccb50aa528cce7c836b5257399ca865..bf34dc94eeb5d1aba51e724bc4886324abe36b93 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -18,6 +18,7 @@ Ben Elliston                bje@redhat.com
 Bill Sommerfeld             sommerfeld@apollo.hp.com
 Bob Friesenhahn             bfriesen@simple.dallas.tx.us
 Bob Wilson                  bwilson@tensilica.com
+Bram Moolenaar              bram@vim.org
 Bruno Haible                haible@ilog.fr
 Carl Edman                  cedman@princeton.edu
 Chad R. Larson              chad@anasazi.com
index 1ad2e7b1f5d41bc8ba176200b64179f27fcc7325..6820acded61b9f65edff0493bb87b6c5fc4b923a 100644 (file)
@@ -2523,6 +2523,11 @@ AS_IF([test "$ac_cv_search_$1" != no],
 # just for library $1.  Separate tests with the same $1 and different $2s
 # may have different results.
 #
+# Note that using directly AS_VAR_PUSHDEF([ac_Lib], [ac_cv_lib_$1_$2])
+# is asking for troubles, since AC_CHECK_LIB($lib, fun) would give
+# ac_cv_lib_$lib_fun, which is definitely not what was meant.  Hence
+# the AS_LITERAL_IF indirection.
+#
 # FIXME: This macro is extremely suspicious.  It DEFINEs unconditionnally,
 # whatever the FUNCTION, in addition to not being a *S macro.  Note
 # that the cache does depend upon the function we are looking for.
@@ -2534,7 +2539,9 @@ AS_IF([test "$ac_cv_search_$1" != no],
 # freedom.
 AC_DEFUN([AC_CHECK_LIB],
 [m4_ifval([$3], , [AH_CHECK_LIB([$1])])dnl
-AS_VAR_PUSHDEF([ac_Lib], [ac_cv_lib_$1_$2])dnl
+AS_LITERAL_IF([$1],
+              [AS_VAR_PUSHDEF([ac_Lib], [ac_cv_lib_$1_$2])],
+              [AS_VAR_PUSHDEF([ac_Lib], [ac_cv_lib_$1''_$2])])dnl
 AC_CACHE_CHECK([for $2 in -l$1], ac_Lib,
 [ac_check_lib_save_LIBS=$LIBS
 LIBS="-l$1 $5 $LIBS"
index 1ad2e7b1f5d41bc8ba176200b64179f27fcc7325..6820acded61b9f65edff0493bb87b6c5fc4b923a 100644 (file)
@@ -2523,6 +2523,11 @@ AS_IF([test "$ac_cv_search_$1" != no],
 # just for library $1.  Separate tests with the same $1 and different $2s
 # may have different results.
 #
+# Note that using directly AS_VAR_PUSHDEF([ac_Lib], [ac_cv_lib_$1_$2])
+# is asking for troubles, since AC_CHECK_LIB($lib, fun) would give
+# ac_cv_lib_$lib_fun, which is definitely not what was meant.  Hence
+# the AS_LITERAL_IF indirection.
+#
 # FIXME: This macro is extremely suspicious.  It DEFINEs unconditionnally,
 # whatever the FUNCTION, in addition to not being a *S macro.  Note
 # that the cache does depend upon the function we are looking for.
@@ -2534,7 +2539,9 @@ AS_IF([test "$ac_cv_search_$1" != no],
 # freedom.
 AC_DEFUN([AC_CHECK_LIB],
 [m4_ifval([$3], , [AH_CHECK_LIB([$1])])dnl
-AS_VAR_PUSHDEF([ac_Lib], [ac_cv_lib_$1_$2])dnl
+AS_LITERAL_IF([$1],
+              [AS_VAR_PUSHDEF([ac_Lib], [ac_cv_lib_$1_$2])],
+              [AS_VAR_PUSHDEF([ac_Lib], [ac_cv_lib_$1''_$2])])dnl
 AC_CACHE_CHECK([for $2 in -l$1], ac_Lib,
 [ac_check_lib_save_LIBS=$LIBS
 LIBS="-l$1 $5 $LIBS"
index be137554195097459c9b4afe75d758202f5eeecd..495c9139845ee70757985f1579297f1dccdc6615 100644 (file)
@@ -39,7 +39,6 @@ m4_include([torture.at])
 m4_include([compile.at])
 
 # Checking that AC_CHECK_FOO macros work properly.
-AT_BANNER([FIXME: AC_CHECK_TYPE is a known failure.])
 m4_include([semantics.at])
 
 # Blind testing the macros.