diff options
author | Alexey Neyman <stilor@att.net> | 2017-02-12 18:53:23 -0800 |
---|---|---|
committer | Alexey Neyman <stilor@att.net> | 2017-02-13 22:47:40 -0800 |
commit | 7bcf18bfab84374d3305c7a088f95ac1219ddf93 (patch) | |
tree | 49c67ed5fb9729ef554c3a07a916612af5139e24 /configure.ac | |
parent | fbc69323085e2370faeb8b46291cd66cbf9ef649 (diff) | |
download | crosstool-ng-7bcf18bfab84374d3305c7a088f95ac1219ddf93.tar.gz crosstool-ng-7bcf18bfab84374d3305c7a088f95ac1219ddf93.tar.bz2 crosstool-ng-7bcf18bfab84374d3305c7a088f95ac1219ddf93.zip |
Determine whether -E/-r option selects extended regexp
... and then use the right option. See the note in scripts/functions
on where we should use ${foo} and where just 'foo'; this boils down to
whether we can expect the build tools override to be in effect (e.g. in
the actual build scripts) or not (i.e. outside of scripts/build).
While running in scripts/functions, or in scripts/crosstool-NG.sh the
build tools override directory (.build/tools/bin) may have not been
set up (yet, or at all).
Also, modify the installed scripts (populate, xldd) accordingly.
Signed-off-by: Alexey Neyman <stilor@att.net>
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/configure.ac b/configure.ac index 11c5a8e8..439cdcab 100644 --- a/configure.ac +++ b/configure.ac @@ -171,15 +171,27 @@ AS_IF([test "$EGREP" != "$GREP -E"], ACX_WITH_DEPRECATED([sed], [SED]) AC_ARG_VAR([INSTALL], [Specify the full path to GNU sed]) AC_PROG_SED -AC_MSG_CHECKING([whether sed understands -r -i -e]) -echo foo > .ct-ng.sed.test -${SED} -r -i -e 's/f(o)o/b\1ar/' .ct-ng.sed.test >/dev/null 2>&1 -rc=$? -content=`cat .ct-ng.sed.test` -rm -f .ct-ng.sed.test -AS_IF([test "$rc:$content" = "0:boar"], - [AC_MSG_RESULT([yes])], - [AC_MSG_ERROR([sed does not accept -r -i -e])]) +AC_CACHE_CHECK([whether $SED understands -i -e], + [acx_cv_sed_i_e], + [echo foo > .ct-ng.sed.test + ${SED} -i -e 's/foo/bar/' .ct-ng.sed.test >/dev/null 2>&1 + rc=$? + content=`cat .ct-ng.sed.test` + rm -f .ct-ng.sed.test + AS_IF([test "$rc:$content" = "0:bar"], + [acx_cv_sed_i_e=yes], + [AC_MSG_ERROR([sed does not accept -i -e])])]) +AC_CACHE_CHECK([which $SED option selects extended regexp], + [acx_cv_sed_r], + [opt_r=`echo foo | $SED -r -e 's/f(o)o/b\1ar/' 2>/dev/null` + opt_E=`echo foo | $SED -E -e 's/f(o)o/b\1ar/' 2>/dev/null` + AS_IF([test "$opt_r" = "boar"], + [acx_cv_sed_r=-r], + [test "$opt_E" = "boar"], + [acx_cv_sed_r=-E], + [AC_MSG_ERROR([neither -r nor -E enables extended regexp])])]) +SED_R="$SED $acx_cv_sed_r" +AC_SUBST([SED_R]) AC_PROG_LN_S |