]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fix the SQUID_CC_REQUIRE_ARGUMENT autoconf function (#478)
authorDimitry Andric <dimitry@andric.com>
Sat, 21 Sep 2019 13:34:40 +0000 (13:34 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Sat, 21 Sep 2019 17:34:54 +0000 (17:34 +0000)
Inside AC_DEFUN(), autoconf replaces `$1` with the first argument of the
function.  In this case, the first argument is a variable name. To get
the _value_ of that variable, one has to use `$$1`.

One known effect of this fix (in many build environments) is the
disappearance of the following annoying extra error when a build fails
for some other reason:

    unrecognized command line option -Wno-deprecated-register

acinclude/compiler-flags.m4

index 360fd009560127b327087a74f7bc67ed2348f720..8adb6a4593c6425eeb69bdf611fededd3930ba2e 100644 (file)
@@ -41,7 +41,7 @@ AC_DEFUN([SQUID_CC_REQUIRE_ARGUMENT],[
     SAVED_CFLAGS="$CFLAGS"
     SAVED_CXXFLAGS="$CXXFLAGS"
     AC_COMPILE_IFELSE([AC_LANG_PROGRAM($3,$4)],[$1=no],[],[$1=no])
-    if test "x$1" != "xno" ; then
+    if test "x$$1" != "xno" ; then
       CFLAGS="$CFLAGS $2"
       CXXFLAGS="$CXXFLAGS $2"
       AC_COMPILE_IFELSE([AC_LANG_PROGRAM($3,$4)],[$1=yes],[$1=no],[$1=no])