From: Alex Rousskov Date: Wed, 21 Sep 2022 13:53:22 +0000 (+0000) Subject: Fix escaping leading regex dashes in ./configure sources (#1152) X-Git-Tag: SQUID_5_8~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d1107aa54a75331d4af95755d0eea90b37a2667d;p=thirdparty%2Fsquid.git Fix escaping leading regex dashes in ./configure sources (#1152) 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 `@<:@-@:>@`! --- diff --git a/acinclude/krb5.m4 b/acinclude/krb5.m4 index a0f44b0e9c..9dab480641 100644 --- a/acinclude/krb5.m4 +++ b/acinclude/krb5.m4 @@ -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 ]) diff --git a/configure.ac b/configure.ac index 2087a8d9be..d91943a663 100644 --- a/configure.ac +++ b/configure.ac @@ -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])