Mercurial > hg > octave-lyh
changeset 6822:5c4702203cc4
[project @ 2007-08-23 19:43:07 by jwe]
author | jwe |
---|---|
date | Thu, 23 Aug 2007 19:43:08 +0000 |
parents | b5d4d61d6bad |
children | 9fddcc586065 |
files | ChangeLog aclocal.m4 |
diffstat | 2 files changed, 48 insertions(+), 43 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-08-23 John W. Eaton <jwe@octave.org> + + * aclocal.m4 (OCTAVE_PROG_SED): Don't clobber value from environment. + From: Christian Cornelssen <ccorn@cs.tu-berlin.de>. + 2007-08-23 Thomas Weber <thomas.weber.mail@gmail.com> * aclocal.m4 (OCTAVE_PROG_GNUPLOT): Drop check for multiple plot
--- a/aclocal.m4 +++ b/aclocal.m4 @@ -810,54 +810,54 @@ AC_DEFUN([OCTAVE_PROG_SED], [AC_MSG_CHECKING([for a sed that does not truncate output]) if test -z "$SED"; then -AC_CACHE_VAL(ac_cv_path_sed, -[# Loop through the user's path and test for sed and gsed. -# Then use that list of sed's as ones to test for truncation. -_AS_PATH_WALK([$PATH], - [for ac_prog in sed gsed; do - for ac_exec_ext in '' $ac_executable_extensions; do - if AS_EXECUTABLE_P(["$as_dir/$ac_prog$ac_exec_ext"]); then - _sed_list="$_sed_list $as_dir/$ac_prog$ac_exec_ext" - fi + AC_CACHE_VAL(ac_cv_path_sed, [ + # Loop through the user's path and test for sed and gsed. + # Then use that list of sed's as ones to test for truncation. + _AS_PATH_WALK([$PATH], + [for ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + if AS_EXECUTABLE_P(["$as_dir/$ac_prog$ac_exec_ext"]); then + _sed_list="$_sed_list $as_dir/$ac_prog$ac_exec_ext" + fi + done done - done - ]) - AS_TMPDIR(sed) - _max=0 - _count=0 - # Add /usr/xpg4/bin/sed as it is typically found on Solaris - # along with /bin/sed that truncates output. - for _sed in $_sed_list /usr/xpg4/bin/sed; do - test ! -f ${_sed} && break - cat /dev/null > "$tmp/sed.in" + ]) + AS_TMPDIR(sed) + _max=0 _count=0 - echo $ECHO_N "0123456789$ECHO_C" >"$tmp/sed.in" - # Check for GNU sed and select it if it is found. - if "${_sed}" --version 2>&1 < /dev/null | egrep '(GNU)' > /dev/null; -then - octave_cv_path_sed=${_sed} - break; - fi - while true; do - cat "$tmp/sed.in" "$tmp/sed.in" >"$tmp/sed.tmp" - mv "$tmp/sed.tmp" "$tmp/sed.in" - cp "$tmp/sed.in" "$tmp/sed.nl" - echo >>"$tmp/sed.nl" - ${_sed} -e 's/a$//' < "$tmp/sed.nl" >"$tmp/sed.out" || break - cmp -s "$tmp/sed.out" "$tmp/sed.nl" || break - # 10000 chars as input seems more than enough - test $_count -gt 10 && break - _count=`expr $_count + 1` - if test $_count -gt $_max; then - _max=$_count - octave_cv_path_sed=$_sed + # Add /usr/xpg4/bin/sed as it is typically found on Solaris + # along with /bin/sed that truncates output. + for _sed in $_sed_list /usr/xpg4/bin/sed; do + test ! -f ${_sed} && break + cat /dev/null > "$tmp/sed.in" + _count=0 + echo $ECHO_N "0123456789$ECHO_C" >"$tmp/sed.in" + # Check for GNU sed and select it if it is found. + if "${_sed}" --version 2>&1 < /dev/null | egrep '(GNU)' > /dev/null; then + octave_cv_path_sed=${_sed} + break; fi + while true; do + cat "$tmp/sed.in" "$tmp/sed.in" >"$tmp/sed.tmp" + mv "$tmp/sed.tmp" "$tmp/sed.in" + cp "$tmp/sed.in" "$tmp/sed.nl" + echo >>"$tmp/sed.nl" + ${_sed} -e 's/a$//' < "$tmp/sed.nl" >"$tmp/sed.out" || break + cmp -s "$tmp/sed.out" "$tmp/sed.nl" || break + # 10000 chars as input seems more than enough + test $_count -gt 10 && break + _count=`expr $_count + 1` + if test $_count -gt $_max; then + _max=$_count + octave_cv_path_sed=$_sed + fi + done done - done - rm -rf "$tmp" -]) + rm -rf "$tmp" + ]) + SED=$octave_cv_path_sed fi -AC_SUBST([SED], $octave_cv_path_sed) +AC_SUBST(SED) AC_MSG_RESULT([$SED]) ]) dnl