From: Paul Eggert Date: Mon, 19 Sep 2022 20:22:53 +0000 (-0700) Subject: libtool: port to GNU grep 3.8 X-Git-Tag: v2.5.0~79 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=eb2a21cf2e1c56fd9461de67ef0ecccd66f478b9;p=thirdparty%2Flibtool.git libtool: port to GNU grep 3.8 GNU grep 3.8 warns about some regular expressions that POSIX says have undefined effect, e.g., '\-'. Unfortunately Libtool uses regular expressions of this form. Some unittests now fail, e.g. link-order.at: --- /dev/null +++ .../libtool/tests/testsuite.dir/at-groups/66/stderr @@ -0,0 +1,4 @@ +/bin/grep: warning: stray \ before / +/bin/grep: warning: stray \ before / +/bin/grep: warning: stray \ before / +/bin/grep: warning: stray \ before / Url: https://savannah.gnu.org/patch/index.php?10282 * m4/libtool.m4 (_LT_LANG_CXX_CONFIG): Do not use \- in a BRE or ERE, as this produces undefined results that GNU grep 3.8 warns about. Use [-] instead. * tests/link-order.at (Link order test): Similarly, do not use \/ in an ERE; use / instead. --- diff --git a/m4/libtool.m4 b/m4/libtool.m4 index 8606c4e24..111b87d11 100644 --- a/m4/libtool.m4 +++ b/m4/libtool.m4 @@ -6442,7 +6442,7 @@ if test yes != "$_lt_caught_CXX_error"; then # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "[[-]]L"' else GXX=no @@ -6818,7 +6818,7 @@ if test yes != "$_lt_caught_CXX_error"; then # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "[[-]]L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then @@ -6883,7 +6883,7 @@ if test yes != "$_lt_caught_CXX_error"; then # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "[[-]]L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then @@ -7222,7 +7222,7 @@ if test yes != "$_lt_caught_CXX_error"; then # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "[[-]]L"' else # FIXME: insert proper C++ library support @@ -7306,7 +7306,7 @@ if test yes != "$_lt_caught_CXX_error"; then # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "[[-]]L"' else # g++ 2.7 appears to require '-G' NOT '-shared' on this # platform. @@ -7317,7 +7317,7 @@ if test yes != "$_lt_caught_CXX_error"; then # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "[[-]]L"' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir' diff --git a/tests/link-order.at b/tests/link-order.at index 4c88f9b5a..659ac7049 100644 --- a/tests/link-order.at +++ b/tests/link-order.at @@ -99,12 +99,12 @@ aix* | interix*) ;; # These systems have different path syntax case $hardcode_direct$hardcode_direct_absolute in yesno) AT_CHECK([if $EGREP relinking stderr; then - $EGREP " .*\/new\/lib/libb$shared_ext .*\/old\/lib/libcee$shared_ext" stdout + $EGREP " .*/new/lib/libb$shared_ext .*/old/lib/libcee$shared_ext" stdout else :; fi], [0], [ignore], [], [echo "wrong link order"]) ;; *) AT_CHECK([if $EGREP relinking stderr; then - $EGREP " -L.*\/new\/lib -lb -L.*\/old\/lib -lcee" stdout + $EGREP " -L.*/new/lib -lb -L.*/old/lib -lcee" stdout else :; fi], [0], [ignore], [], [echo "wrong link order"]) ;; esac