diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2020-07-02 22:23:59 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2020-07-02 22:24:38 -0700 |
commit | d0acdabdeca8a396ae2d0877d3b802581ccef83d (patch) | |
tree | 89c1e001191234a66bdafcc5d9188f1abbeeaabb | |
parent | ff47b2ea8d53dd4dc7536775e4a222dc18837fcb (diff) | |
download | autoconf-d0acdabdeca8a396ae2d0877d3b802581ccef83d.tar.gz |
Fix AC_CHECK_LIB quoting bug
Problem reported by Bert Wesarg in:
https://lists.gnu.org/archive/html/autoconf/2016-04/msg00020.html
* lib/autoconf/libs.m4 (AC_CHECK_LIB): Fix quoting bug.
* tests/semantics.at (AC_CHECK_LIB): Add a test for the bug.
-rw-r--r-- | lib/autoconf/libs.m4 | 2 | ||||
-rw-r--r-- | tests/semantics.at | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/lib/autoconf/libs.m4 b/lib/autoconf/libs.m4 index f5828e40..becb2231 100644 --- a/lib/autoconf/libs.m4 +++ b/lib/autoconf/libs.m4 @@ -101,7 +101,7 @@ AC_DEFUN([AC_CHECK_LIB], [m4_ifval([$3], , [AH_CHECK_LIB([$1])])dnl AS_LITERAL_WORD_IF([$1], [AS_VAR_PUSHDEF([ac_Lib], [ac_cv_lib_$1_$2])], - [AS_VAR_PUSHDEF([ac_Lib], [ac_cv_lib_$1''_$2])])dnl + [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/semantics.at b/tests/semantics.at index 3324a230..f10a0b53 100644 --- a/tests/semantics.at +++ b/tests/semantics.at @@ -42,9 +42,13 @@ ac_sin=sin AC_CHECK_LIB(m, $ac_sin,, [AC_MSG_ERROR([cannot find `\$ac_sin' (= `$ac_sin') in `libm'])]) +AS_UNSET([ac_cv_lib_m_acos]) ac_m=m AC_CHECK_LIB($ac_m, acos,, [AC_MSG_ERROR([cannot find `acos' in `\$ac_m' (= `$ac_m')])]) +if test "${ac_cv_lib_m_acos+set}" != set; then + AC_MSG_ERROR([ac_cv_lib_m_acos not set]) +fi ac_asin=asin AC_CHECK_LIB($ac_m, $ac_asin,, |