]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fix escaping leading regex dashes in ./configure sources (#1152)
authorAlex Rousskov <rousskov@measurement-factory.com>
Wed, 21 Sep 2022 13:53:22 +0000 (13:53 +0000)
committerAmos Jeffries <yadij@users.noreply.github.com>
Wed, 7 Dec 2022 12:59:44 +0000 (01:59 +1300)
    grep: invalid option -- 't'
    Usage: grep [OPTION]... PATTERNS [FILE]...
    Try 'grep --help' for more information.

    Usage: grep [OPTION]... PATTERNS [FILE]...
    Try 'grep --help' for more information.
    ./configure: line 27524: test: too many arguments

    Usage: grep [OPTION]... PATTERNS [FILE]...
    Try 'grep --help' for more information.
    ./configure: line 27698: test: too many arguments

Configure scripts are written in m4, not shell. M4 treats [square
brackets] specially. We could use quadrigraphs instead (as documented in
autoconf manual) but `(-)` looks a lot simpler than `@<:@-@:>@`!

acinclude/krb5.m4
configure.ac

index a0f44b0e9c3c64b3dcb3a9268d3d51f8e4bc51eb..9dab48064170cc0d0bd220119c943e0311f2d969 100644 (file)
@@ -192,7 +192,7 @@ main(void)
         return 0;
 }
   ]])],  [ squid_cv_working_gssapi=yes ], [ squid_cv_working_gssapi=no ], [:])])
-if test "x$squid_cv_working_gssapi" = "xno" -a `echo $LIBS | grep -i -c "\-L"` -gt 0; then
+if test "x$squid_cv_working_gssapi" = "xno" -a `echo $LIBS | grep -i -c "(-)L"` -gt 0; then
   AC_MSG_NOTICE([Check Runtime library path !])
 fi
 ])
@@ -284,7 +284,7 @@ main(void)
         return 0;
 }
   ]])], [ squid_cv_working_krb5=yes ], [ squid_cv_working_krb5=no ],[:])])
-if test "x$squid_cv_working_krb5" = "xno" -a `echo $LIBS | grep -i -c "\-L"` -gt 0; then
+if test "x$squid_cv_working_krb5" = "xno" -a `echo $LIBS | grep -i -c "(-)L"` -gt 0; then
   AC_MSG_NOTICE([Check Runtime library path !])
 fi
 ])
index 2087a8d9be4cc7e07250c3d2818de96b7abda25e..d91943a6638793e819338b180b28834811c1b944 100644 (file)
@@ -94,7 +94,7 @@ if test "x$squid_host_os" = "solaris" -a "x$GCC" != "x" ; then
 fi
 
 # If the user did not specify a C++ version.
-user_cxx=`echo "$PRESET_CXXFLAGS" | grep -o -E "\-std="`
+user_cxx=`echo "$PRESET_CXXFLAGS" | grep -o -E "(-)std="`
 if test "x$user_cxx" = "x"; then
   # Check for C++11 compiler support
   AX_CXX_COMPILE_STDCXX_11([noext],[mandatory])