summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--BUGS6
-rw-r--r--ChangeLog6
-rw-r--r--NEWS2
-rw-r--r--THANKS1
-rw-r--r--acgeneral.m49
-rw-r--r--lib/autoconf/general.m49
-rw-r--r--tests/suite.at1
7 files changed, 25 insertions, 9 deletions
diff --git a/BUGS b/BUGS
index 6be4c71b..9f531d92 100644
--- 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).
diff --git a/ChangeLog b/ChangeLog
index 3b9b2db8..278a1cba 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
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.
* Makefile.am (.m4.m4f): Pass --fatal-warnings to m4.
diff --git a/NEWS b/NEWS
index f2a4e471..10fdd6ba 100644
--- 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.
* Major changes in Autoconf 2.50
diff --git a/THANKS b/THANKS
index 5707edda..bf34dc94 100644
--- 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
diff --git a/acgeneral.m4 b/acgeneral.m4
index 1ad2e7b1..6820acde 100644
--- a/acgeneral.m4
+++ b/acgeneral.m4
@@ -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"
diff --git a/lib/autoconf/general.m4 b/lib/autoconf/general.m4
index 1ad2e7b1..6820acde 100644
--- a/lib/autoconf/general.m4
+++ b/lib/autoconf/general.m4
@@ -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"
diff --git a/tests/suite.at b/tests/suite.at
index be137554..495c9139 100644
--- a/tests/suite.at
+++ b/tests/suite.at
@@ -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.