diff --git a/build/autoconf/toolchain.m4 b/build/autoconf/toolchain.m4 index fe76bb6f0038..d6a23b3dddbb 100644 --- a/build/autoconf/toolchain.m4 +++ b/build/autoconf/toolchain.m4 @@ -17,13 +17,13 @@ fi if test "$GXX" = "yes"; then GNU_CXX=1 CXX_VERSION=`$CXX -v 2>&1 | grep 'gcc version'` - changequote(,) - GCC_VERSION_FULL=`echo "$CXX_VERSION" | $PERL -pe 's/^.*gcc version ([^ ]*).*/$1/'` - GCC_VERSION=`echo "$GCC_VERSION_FULL" | $PERL -pe '(split(/\./))[0]>=4&&s/(^\d*\.\d*).*/$1/;'` - changequote([,]) + changequote(<<,>>) + GCC_VERSION_FULL=`echo "$CXX_VERSION" | $PERL -pe 's/^.*gcc version ([^ ]*).*/<<$>>1/'` + GCC_VERSION=`echo "$GCC_VERSION_FULL" | $PERL -pe '(split(/\./))[0]>=4&&s/(^\d*\.\d*).*/<<$>>1/;'` - GCC_MAJOR_VERSION=`echo ${GCC_VERSION} | $AWK -F\. '{ print $1 }'` - GCC_MINOR_VERSION=`echo ${GCC_VERSION} | $AWK -F\. '{ print $2 }'` + GCC_MAJOR_VERSION=`echo ${GCC_VERSION} | $AWK -F\. '{ print <<$>>1 }'` + GCC_MINOR_VERSION=`echo ${GCC_VERSION} | $AWK -F\. '{ print <<$>>2 }'` + changequote([,]) fi if test "`echo | $AS -o conftest.out -v 2>&1 | grep -c GNU`" != "0"; then diff --git a/js/src/build/autoconf/toolchain.m4 b/js/src/build/autoconf/toolchain.m4 index fe76bb6f0038..d6a23b3dddbb 100644 --- a/js/src/build/autoconf/toolchain.m4 +++ b/js/src/build/autoconf/toolchain.m4 @@ -17,13 +17,13 @@ fi if test "$GXX" = "yes"; then GNU_CXX=1 CXX_VERSION=`$CXX -v 2>&1 | grep 'gcc version'` - changequote(,) - GCC_VERSION_FULL=`echo "$CXX_VERSION" | $PERL -pe 's/^.*gcc version ([^ ]*).*/$1/'` - GCC_VERSION=`echo "$GCC_VERSION_FULL" | $PERL -pe '(split(/\./))[0]>=4&&s/(^\d*\.\d*).*/$1/;'` - changequote([,]) + changequote(<<,>>) + GCC_VERSION_FULL=`echo "$CXX_VERSION" | $PERL -pe 's/^.*gcc version ([^ ]*).*/<<$>>1/'` + GCC_VERSION=`echo "$GCC_VERSION_FULL" | $PERL -pe '(split(/\./))[0]>=4&&s/(^\d*\.\d*).*/<<$>>1/;'` - GCC_MAJOR_VERSION=`echo ${GCC_VERSION} | $AWK -F\. '{ print $1 }'` - GCC_MINOR_VERSION=`echo ${GCC_VERSION} | $AWK -F\. '{ print $2 }'` + GCC_MAJOR_VERSION=`echo ${GCC_VERSION} | $AWK -F\. '{ print <<$>>1 }'` + GCC_MINOR_VERSION=`echo ${GCC_VERSION} | $AWK -F\. '{ print <<$>>2 }'` + changequote([,]) fi if test "`echo | $AS -o conftest.out -v 2>&1 | grep -c GNU`" != "0"; then