[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
FYI: AC_CHECK_LIB($var,...) (Was: autoconf/187: AC_CHECK_LIB() cannot ha
From: |
Akim Demaille |
Subject: |
FYI: AC_CHECK_LIB($var,...) (Was: autoconf/187: AC_CHECK_LIB() cannot handle variable name argument) |
Date: |
06 Jun 2001 17:04:06 +0200 |
User-agent: |
Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.1 (GTK) |
Well, no need to discuss about this, it's clearly the right fix.
2001-06-06 Akim Demaille <address@hidden>
* 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.
Index: BUGS
===================================================================
RCS file: /cvs/autoconf/BUGS,v
retrieving revision 1.13
diff -u -u -r1.13 BUGS
--- BUGS 2001/06/06 08:25:00 1.13
+++ BUGS 2001/06/06 14:55:08
@@ -18,9 +18,3 @@
/*--------------------------.
| 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: NEWS
===================================================================
RCS file: /cvs/autoconf/NEWS,v
retrieving revision 1.149
diff -u -u -r1.149 NEWS
--- NEWS 2001/06/05 12:44:13 1.149
+++ NEWS 2001/06/06 14:55:08
@@ -6,6 +6,8 @@
- 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
Index: THANKS
===================================================================
RCS file: /cvs/autoconf/THANKS,v
retrieving revision 1.62
diff -u -u -r1.62 THANKS
--- THANKS 2001/06/05 12:44:13 1.62
+++ THANKS 2001/06/06 14:55:08
@@ -18,6 +18,7 @@
Bill Sommerfeld address@hidden
Bob Friesenhahn address@hidden
Bob Wilson address@hidden
+Bram Moolenaar address@hidden
Bruno Haible address@hidden
Carl Edman address@hidden
Chad R. Larson address@hidden
Index: acgeneral.m4
===================================================================
RCS file: /cvs/autoconf/acgeneral.m4,v
retrieving revision 1.729
diff -u -u -r1.729 acgeneral.m4
--- acgeneral.m4 2001/06/06 08:49:33 1.729
+++ acgeneral.m4 2001/06/06 14:55:08
@@ -2523,6 +2523,11 @@
# 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 @@
# 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: tests/suite.at
===================================================================
RCS file: /cvs/autoconf/tests/suite.at,v
retrieving revision 1.12
diff -u -u -r1.12 suite.at
--- tests/suite.at 2001/06/06 08:25:00 1.12
+++ tests/suite.at 2001/06/06 14:55:08
@@ -39,7 +39,6 @@
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.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- FYI: AC_CHECK_LIB($var,...) (Was: autoconf/187: AC_CHECK_LIB() cannot handle variable name argument),
Akim Demaille <=