From: Ralf Wildenhues Date: Mon, 31 Jan 2005 16:17:06 +0000 (+0000) Subject: * config/ltmain.m4sh, m4/libtool.m4: Change `( cmd ) 2>/dev/null' to X-Git-Tag: release-2-1b~769 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=41a67fb432409a29bf47397ac412e0624410bcc3;p=thirdparty%2Flibtool.git * config/ltmain.m4sh, m4/libtool.m4: Change `( cmd ) 2>/dev/null' to `{ cmd; } 2>/dev/null', when cmd has no side effects and might be a builtin. Note that it is unspecified whether cmd will run within a subshell (e.g. Bourne shells) or within the current shell (most modern shells). --- diff --git a/ChangeLog b/ChangeLog index 4603d8db3..b0a4eaf22 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2005-01-31 Ralf Wildenhues + + * config/ltmain.m4sh, m4/libtool.m4: Change `( cmd ) 2>/dev/null' to + `{ cmd; } 2>/dev/null', when cmd has no side effects and might be a + builtin. Note that it is unspecified whether cmd will run within a + subshell (e.g. Bourne shells) or within the current shell (most modern + shells). + 2005-01-29 Ralf Wildenhues * m4/libtool.m4 (_LT_LINKER_SHLIBS, _LT_LANG_CXX_CONFIG) [linux]: diff --git a/config/ltmain.m4sh b/config/ltmain.m4sh index 64d77ccd9..9e3f1e0f1 100644 --- a/config/ltmain.m4sh +++ b/config/ltmain.m4sh @@ -88,7 +88,7 @@ if test "X$1" = X--no-reexec; then elif test "X$1" = X--fallback-echo; then # Avoid inline document here, it may be left over : -elif test "X`($ECHO '\t') 2>/dev/null`" = 'X\t'; then +elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t'; then # Yippee, $ECHO works! : else @@ -6092,7 +6092,7 @@ else if test \"X\$1\" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift - elif test \"X\`(\$ECHO '\t') 2>/dev/null\`\" = 'X\t'; then + elif test \"X\`{ \$ECHO '\t'; } 2>/dev/null\`\" = 'X\t'; then # Yippee, \$ECHO works! : else @@ -6564,8 +6564,8 @@ func_mode_uninstall () fi # Don't error if the file doesn't exist and rm -f was used. - if (test -L "$file") >/dev/null 2>&1 || - (test -h "$file") >/dev/null 2>&1 || + if { test -L "$file"; } >/dev/null 2>&1 || + { test -h "$file"; } >/dev/null 2>&1 || test -f "$file"; then : elif test -d "$file"; then diff --git a/m4/libtool.m4 b/m4/libtool.m4 index 6a21cfda3..2cfb52353 100644 --- a/m4/libtool.m4 +++ b/m4/libtool.m4 @@ -728,7 +728,7 @@ if test "X[$]1" = X--no-reexec; then elif test "X[$]1" = X--fallback-echo; then # Avoid inline document here, it may be left over : -elif test "X`($ECHO '\t') 2>/dev/null`" = 'X\t' ; then +elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then # Yippee, $ECHO works! : else @@ -754,17 +754,16 @@ if test -z "$lt_ECHO"; then # find a string as large as possible, as long as the shell can cope with it for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... - if (echo_test_string="`eval $cmd`") 2>/dev/null && - echo_test_string="`eval $cmd`" && - (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null + if { echo_test_string="`eval $cmd`"; } 2>/dev/null && + { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null then break fi done fi - if test "X`($ECHO '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($ECHO "$echo_test_string") 2>/dev/null` && + if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && + echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then : else @@ -789,12 +788,12 @@ if test -z "$lt_ECHO"; then if test "X$ECHO" = Xecho; then # We didn't find a better echo, so look for alternatives. - if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && + if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' && + echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # This shell has a builtin print -r that does the trick. ECHO='print -r' - elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && + elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } && test "X$CONFIG_SHELL" != X/bin/ksh; then # If we have ksh, try running configure again with it. ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} @@ -805,8 +804,8 @@ if test -z "$lt_ECHO"; then else # Try using printf. ECHO='printf %s\n' - if test "X`($ECHO '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($ECHO "$echo_test_string") 2>/dev/null` && + if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && + echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # Cool, printf works : @@ -829,7 +828,7 @@ if test -z "$lt_ECHO"; then prev=: for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do - if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null + if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null then break fi @@ -1191,8 +1190,8 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. - while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \ - = "XX$teststring$teststring") >/dev/null 2>&1 && + while { test "X"`$SHELL [$]0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \ + = "XX$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1`