Mercurial > hg > octave-terminal
changeset 4084:babc519f245b
[project @ 2002-10-03 03:23:14 by jwe]
author | jwe |
---|---|
date | Thu, 03 Oct 2002 03:23:15 +0000 |
parents | 9a1bdd7fff3e |
children | ee4790097033 |
files | ChangeLog Makeconf.in aclocal.m4 configure.in doc/ChangeLog doc/faq/Makefile.in doc/interpreter/Makefile.in doc/liboctave/Makefile.in install-octave.in mkoctfile.in octave-bug.in src/ChangeLog src/Makefile.in src/cutils.c src/oct-conf.h.in src/toplev.cc |
diffstat | 16 files changed, 151 insertions(+), 47 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2002-10-02 John W. Eaton <jwe@bevo.che.wisc.edu> + + * aclocal.m4 (OCTAVE_PROG_SED): New macro, adapted from autoconf + patches mailing list archive, written by Robert Boehne + <rboehne@ricardo-us.com>. + * configure.in: Use it. + * Makeconf.in: Substitute SED, use $(SED), not sed. + (do-subst-conffig-vals): Substitute it here too. + * mkoctfile.in: And here. Use $SED, not sed. + * octave-bug.in: Likewise. + * install-octave.in: Likewise. + 2002-09-30 John W. Eaton <jwe@bevo.che.wisc.edu> * configure.in: Don't define mkdir here.
--- a/Makeconf.in +++ b/Makeconf.in @@ -9,8 +9,10 @@ SHELL = /bin/sh +SED = @SED@ + # A shell command to extract the version number from version.h. -getversion = sed -e '/VERSION/!d' -e 's/.*"\(.*\)".*$$/\1/' -e q +getversion = $(SED) -e '/VERSION/!d' -e 's/.*"\(.*\)".*$$/\1/' -e q # Look for version.h to get version information. xfiles := $(TOPDIR)/src/version.h $(srcdir)/$(TOPDIR)/src/version.h @@ -309,7 +311,7 @@ @echo making $@ from $< @rm -f $@ @$(CXX) $(DEPEND_FLAGS) $(CPPFLAGS) $(ALL_CXXFLAGS) $< | \ - sed \ + $(SED) \ $(DEPEND_EXTRA_SED_PATTERN) \ -e 's,^[^:]*/\(.*\.o\):,\1:,' \ -e 's,$*\.o,pic/& & $*.df $@,g' > $@-t @@ -321,7 +323,7 @@ @echo making $@ from $< @rm -f $@ @$(CC) $(DEPEND_FLAGS) $(CPPFLAGS) $(ALL_CFLAGS) $< | \ - sed \ + $(SED) \ $(DEPEND_EXTRA_SED_PATTERN) \ -e 's,^[^:]*/\(.*\.o\):,\1:,' \ -e 's,$*\.o,pic/& & $@,g' > $@-t @@ -341,7 +343,7 @@ define do-subst-config-vals echo "making $@ from $<" -sed < $< \ +$(SED) < $< \ -e "s;%OCTAVE_CONF_ALL_CFLAGS%;\"${ALL_CFLAGS}\";" \ -e "s;%OCTAVE_CONF_ALL_CXXFLAGS%;\"${ALL_CXXFLAGS}\";" \ -e "s;%OCTAVE_CONF_ALL_FFLAGS%;\"${ALL_FFLAGS}\";" \ @@ -401,6 +403,7 @@ -e "s;%OCTAVE_CONF_RDYNAMIC_FLAG%;\"${RDYNAMIC_FLAG}\";" \ -e "s;%OCTAVE_CONF_RLD_FLAG%;\"${RLD_FLAG}\";" \ -e "s;%OCTAVE_CONF_RUNTEST%;\"${RUNTEST}\";" \ + -e "s;%OCTAVE_CONF_SED%;\"${SED}\";" \ -e "s;%OCTAVE_CONF_SHARED_LIBS%;\"${SHARED_LIBS}\";" \ -e "s;%OCTAVE_CONF_SHLEXT%;\"${SHLEXT}\";" \ -e "s;%OCTAVE_CONF_SHLEXT_VER%;\"${SHLEXT_VER}\";" \ @@ -418,13 +421,13 @@ -e "s;%OCTAVE_CONF_YACC%;\"${YACC}\";" \ -e "s;%OCTAVE_CONF_YFLAGS%;\"${YFLAGS}\";" \ -e "s;%OCTAVE_CONF_config_opts%;\"${config_opts}\";" | \ - sed -e "s;%OCTAVE_CONF_DEFS%;\"${UGLY_DEFS}\";" > $@-t + $(SED) -e "s;%OCTAVE_CONF_DEFS%;\"${UGLY_DEFS}\";" > $@-t $(top_srcdir)/move-if-change $@-t $@ endef define do-subst-default-vals echo "making $@ from $<" -sed < $< > $@-t \ +$(SED) < $< > $@-t \ -e "s;%OCTAVE_ARCHLIBDIR%;\"${archlibdir}\";" \ -e "s;%OCTAVE_BINDIR%;\"${bindir}\";" \ -e "s;%OCTAVE_CANONICAL_HOST_TYPE%;\"${canonical_host_type}\";" \
--- a/aclocal.m4 +++ b/aclocal.m4 @@ -664,3 +664,60 @@ AC_DEFINE(MKDIR_TAKES_ONE_ARG, 1, [Define if host mkdir takes a single argument.]) fi ]) +# OCTAVE_PROG_SED +# -------------- +# Check for a fully-functional sed program, that truncates +# as few characters as possible. Prefer GNU sed if found. +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 + 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" + _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 + rm -rf "$tmp" +]) +fi +AC_SUBST([SED], $octave_cv_path_sed) +AC_MSG_RESULT([$SED]) +])
--- a/configure.in +++ b/configure.in @@ -22,7 +22,7 @@ ### 02111-1307, USA. AC_INIT -AC_REVISION($Revision: 1.370 $) +AC_REVISION($Revision: 1.371 $) AC_PREREQ(2.52) AC_CONFIG_SRCDIR([src/octave.cc]) AC_CONFIG_HEADER(config.h) @@ -1123,6 +1123,8 @@ ### Checks for other programs used for building, testing, installing, ### and running Octave. +OCTAVE_PROG_SED + OCTAVE_PROG_FLEX OCTAVE_PROG_BISON
--- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,9 @@ +2002-10-02 John W. Eaton <jwe@bevo.che.wisc.edu> + + * interpreter/Makefile.in (%.spell): Use $(SED), not sed. + * liboctave/Makefile.in (%.spell): Likewise. + * faq/Makefile.in (%.spell): Likewise. + 2001-11-15 John W. Eaton <jwe@bevo.che.wisc.edu> * interpreter/Makefile.in (octave_toc.html): Use -expand info and
--- a/doc/faq/Makefile.in +++ b/doc/faq/Makefile.in @@ -32,7 +32,7 @@ %.spell : %.texi rm -f $@ - sed -e 's/@@/ at /g' -e 's/@[a-zA-Z]*//g' $< | spell > $@.tmp + $(SED) -e 's/@@/ at /g' -e 's/@[a-zA-Z]*//g' $< | spell > $@.tmp mv $@.tmp $@ all: Octave-FAQ.info Octave-FAQ.dvi Octave-FAQ.ps Octave-FAQ_toc.html
--- a/doc/interpreter/Makefile.in +++ b/doc/interpreter/Makefile.in @@ -56,7 +56,7 @@ %.spell : %.texi rm -f $@ - sed -e 's/@@/ at /g' -e 's/@[a-zA-Z]*//g' $< | spell > $@.tmp + $(SED) -e 's/@@/ at /g' -e 's/@[a-zA-Z]*//g' $< | spell > $@.tmp mv $@.tmp $@ all: octave.info octave.dvi octave.ps octave_toc.html
--- a/doc/liboctave/Makefile.in +++ b/doc/liboctave/Makefile.in @@ -36,7 +36,7 @@ %.spell : %.texi rm -f $@ - sed -e 's/@@/ at /g' -e 's/@[a-zA-Z]*//g' $< | spell > $@.tmp + $(SED) -e 's/@@/ at /g' -e 's/@[a-zA-Z]*//g' $< | spell > $@.tmp mv $@.tmp $@ all: liboctave.info liboctave.dvi liboctave.ps liboctave_toc.html
--- a/install-octave.in +++ b/install-octave.in @@ -11,6 +11,8 @@ set -e +SED=@SED@ + # get version version=`cat VERSION 2> /dev/null` @@ -46,7 +48,7 @@ if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. - if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then + if (echo -n testing; echo 1,2,3) | $SED s/-n/xn/ | grep xn >/dev/null; then echo_n= echo_c=' ' @@ -176,21 +178,21 @@ Installing octave in the following subdirectories of $prefix: - bindir: `echo $bindir | sed "s,^$prefix/,,"` - datadir: `echo $datadir | sed "s,^$prefix/,,"` - libdir: `echo $libdir | sed "s,^$prefix/,,"` - octlibdir: `echo $octlibdir | sed "s,^$prefix/,,"` - includedir: `echo $includedir | sed "s,^$prefix/,,"` - octincludedir: `echo $octincludedir | sed "s,^$prefix/,,"` - mandir: `echo $mandir | sed "s,^$prefix/,,"` - infodir: `echo $infodir | sed "s,^$prefix/,,"` - fcnfiledir: `echo $fcnfiledir | sed "s,^$prefix/,,"` - localfcnfiledir: `echo $localfcnfiledir | sed "s,^$prefix/,,"` - archlibdir: `echo $archlibdir | sed "s,^$prefix/,,"` - localarchlibdir: `echo $localarchlibdir | sed "s,^$prefix/,,"` - octfiledir: `echo $octfiledir | sed "s,^$prefix/,,"` - localoctfiledir: `echo $localoctfiledir | sed "s,^$prefix/,,"` - imagedir: `echo $imagedir | sed "s,^$prefix/,,"` + bindir: `echo $bindir | $SED "s,^$prefix/,,"` + datadir: `echo $datadir | $SED "s,^$prefix/,,"` + libdir: `echo $libdir | $SED "s,^$prefix/,,"` + octlibdir: `echo $octlibdir | $SED "s,^$prefix/,,"` + includedir: `echo $includedir | $SED "s,^$prefix/,,"` + octincludedir: `echo $octincludedir | $SED "s,^$prefix/,,"` + mandir: `echo $mandir | $SED "s,^$prefix/,,"` + infodir: `echo $infodir | $SED "s,^$prefix/,,"` + fcnfiledir: `echo $fcnfiledir | $SED "s,^$prefix/,,"` + localfcnfiledir: `echo $localfcnfiledir | $SED "s,^$prefix/,,"` + archlibdir: `echo $archlibdir | $SED "s,^$prefix/,,"` + localarchlibdir: `echo $localarchlibdir | $SED "s,^$prefix/,,"` + octfiledir: `echo $octfiledir | $SED "s,^$prefix/,,"` + localoctfiledir: `echo $localoctfiledir | $SED "s,^$prefix/,,"` + imagedir: `echo $imagedir | $SED "s,^$prefix/,,"` EOF @@ -295,7 +297,7 @@ chmod 755 $bindir/octave else echo "installing octave-sh as $bindir/octave" - sed "s|@OCTAVE_HOME@|$prefix|; s|@LD_LIBRARY_PATH@|$octlibdir|" octave-sh \ + $SED "s|@OCTAVE_HOME@|$prefix|; s|@LD_LIBRARY_PATH@|$octlibdir|" octave-sh \ > $bindir/octave chmod 755 $bindir/octave
--- a/mkoctfile.in +++ b/mkoctfile.in @@ -10,6 +10,8 @@ # Default values for these variables are filled in when Octave is # compiled. +: ${SED=%OCTAVE_CONF_SED%} + : ${CPPFLAGS=%OCTAVE_CONF_CPPFLAGS%} : ${INCFLAGS=%OCTAVE_CONF_MKOCTFILE_INCFLAGS%} : ${F2C=%OCTAVE_CONF_F2C%} @@ -230,7 +232,7 @@ if [ -n "$outputfile" ]; then octfile="$outputfile" else - octfile=`echo $octfile | sed 's,\.[^.]*$,,'`.oct + octfile=`echo $octfile | $SED 's,\.[^.]*$,,'`.oct fi fi @@ -239,12 +241,12 @@ if $depend; then if [ -n "$cfiles" ]; then for f in $cfiles; do - b=`echo $f | sed 's,\.c$,,'` + b=`echo $f | $SED 's,\.c$,,'` d=$b.d cmd="rm -f $d" $dbg $cmd eval $cmd - cmd="$CC $DEPEND_FLAGS $CPPFLAGS $ALL_CFLAGS $f | sed $DEPEND_EXTRA_SED_PATTERN -e 's,^[^:]*/\(.*\.o\):,\1:,' -e 's,$b\.o,pic/& & $d,g' > $d-t && mv $d-t $d" + cmd="$CC $DEPEND_FLAGS $CPPFLAGS $ALL_CFLAGS $f | $SED $DEPEND_EXTRA_SED_PATTERN -e 's,^[^:]*/\(.*\.o\):,\1:,' -e 's,$b\.o,pic/& & $d,g' > $d-t && mv $d-t $d" $dbg $cmd eval $cmd done @@ -254,20 +256,20 @@ for f in $ccfiles; do case $f in *.cc) - b=`echo $f | sed 's,\.cc$,,'` + b=`echo $f | $SED 's,\.cc$,,'` ;; *.C) - b=`echo $f | sed 's,\.C$,,'` + b=`echo $f | $SED 's,\.C$,,'` ;; *.cpp) - b=`echo $f | sed 's,\.cpp$,,'` + b=`echo $f | $SED 's,\.cpp$,,'` ;; esac d=$b.d cmd="rm -f $d" $dbg $cmd eval $cmd - cmd="$CXX $DEPEND_FLAGS $CPPFLAGS $ALL_CXXFLAGS $f | sed $DEPEND_EXTRA_SED_PATTERN -e 's,^[^:]*/\(.*\.o\):,\1:,' -e 's,$b\.o,pic/& & $d,g' > $d-t && mv $d-t $d" + cmd="$CXX $DEPEND_FLAGS $CPPFLAGS $ALL_CXXFLAGS $f | $SED $DEPEND_EXTRA_SED_PATTERN -e 's,^[^:]*/\(.*\.o\):,\1:,' -e 's,$b\.o,pic/& & $d,g' > $d-t && mv $d-t $d" $dbg $cmd eval $cmd done @@ -283,10 +285,10 @@ for f in $f77files; do case $f in *.f) - b=`echo $f | sed 's,\.f$,,'` + b=`echo $f | $SED 's,\.f$,,'` ;; *.F) - b=`echo $f | sed 's,\.F$,,'` + b=`echo $f | $SED 's,\.F$,,'` ;; esac if [ -n "$F77" ]; then @@ -310,7 +312,7 @@ if [ -n "$cfiles" ]; then for f in $cfiles; do if [ -n "$CC" ]; then - b=`echo $f | sed 's,\.c$,,'` + b=`echo $f | $SED 's,\.c$,,'` o=$b.o objfiles="$objfiles $o" cmd="$CC -c $CPPFLAGS $CPICFLAG $ALL_CFLAGS $incflags $defs $f -o $o" @@ -327,13 +329,13 @@ if [ -n "$CXX" ]; then case $f in *.cc) - b=`echo $f | sed 's,\.cc$,,'` + b=`echo $f | $SED 's,\.cc$,,'` ;; *.C) - b=`echo $f | sed 's,\.C$,,'` + b=`echo $f | $SED 's,\.C$,,'` ;; *.cpp) - b=`echo $f | sed 's,\.cpp$,,'` + b=`echo $f | $SED 's,\.cpp$,,'` ;; esac o=$b.o
--- a/octave-bug.in +++ b/octave-bug.in @@ -15,6 +15,7 @@ config_opts=%OCTAVE_CONF_config_opts% VERSION=%OCTAVE_CONF_VERSION% +SED=%OCTAVE_CONF_SED% MACHINE=%OCTAVE_CONF_CANONICAL_HOST_TYPE% F77=%OCTAVE_CONF_F77% FFLAGS=%OCTAVE_CONF_FFLAGS% @@ -83,7 +84,7 @@ if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. - if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then + if (echo -n testing; echo 1,2,3) | $SED s/-n/xn/ | grep xn >/dev/null; then echo_n= echo_c=' ' @@ -101,7 +102,7 @@ BUGADDR="octave-maintainers@bevo.che.wisc.edu" else pretest_p=`echo $VERSION \ - | sed 's,.*\.\([0-9]*\).*,\1,' \ + | $SED 's,.*\.\([0-9]*\).*,\1,' \ | grep -v '\.' \ | grep '[0-9]'` @@ -191,12 +192,13 @@ LIBPLPLOT: $LIBPLPLOT LIBDLFCN: $LIBDLFCN LIBGLOB: $LIBGLOB +SED: $SED DEFS: EOF if $HAVE_FMT; then - echo $DEFS | fmt | sed 's/^/ /' >> $TEMP + echo $DEFS | fmt | $SED 's/^/ /' >> $TEMP else echo $DEFS >> $TEMP fi @@ -260,8 +262,8 @@ # Try to extract the recipient address, in case the To: line in the # message template has been changed. Also get cc: lines. - TO_ADDR=`sed -e '/^--------[ \t]*$/q' $TEMP | sed -n -e 's/^[Tt][Oo]://p'` - CC_ADDR=`sed -e '/^--------[ \t]*$/q' $TEMP | sed -n -e 's/^[Cc][Cc]://p'` + TO_ADDR=`$SED -e '/^--------[ \t]*$/q' $TEMP | $SED -n -e 's/^[Tt][Oo]://p'` + CC_ADDR=`$SED -e '/^--------[ \t]*$/q' $TEMP | $SED -n -e 's/^[Cc][Cc]://p'` if test -z "$TO_ADDR"; then echo "no valid \`To:' field found in header -- using $BUGADDR instead" @@ -271,7 +273,7 @@ BUGADDR="$BUGADDR $CC_ADDR" - TMP_SUB=`sed -e '/^--------[ \t]*$/q' $TEMP | sed -n -e 's/^Subject://p'` + TMP_SUB=`$SED -e '/^--------[ \t]*$/q' $TEMP | $SED -n -e 's/^Subject://p'` if test -n "$TMP_SUB"; then SUBJECT="$TMP_SUB"
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,12 @@ +2002-10-02 John W. Eaton <jwe@bevo.che.wisc.edu> + + * cutils.c (octave_sleep): Handle Windows, which may not have + sleep, but should have Sleep. + + * oct-conf.h.in (OCTAVE_CONF_SED): Add an entry for SED. + * toplev.cc (octave_config_info): Likewise. + * Makefile.in (oct-gperf.h): Use $(SED), not sed. + 2002-09-27 John W. Eaton <jwe@bevo.che.wisc.edu> * file-io.cc (fopen_mode_to_ios_mode): Set ios::ate instead of
--- a/src/Makefile.in +++ b/src/Makefile.in @@ -487,7 +487,7 @@ @echo "making $@ from $<" @$(GPERF) -t -C -D -E -G -L ANSI-C \ -H octave_kw_hash -N octave_kw_lookup \ - $< | sed 's,lookup\[,gperf_lookup[,' > $@-t + $< | $(SED) 's,lookup\[,gperf_lookup[,' > $@-t @$(top_srcdir)/move-if-change $@-t $@ check: all
--- a/src/cutils.c +++ b/src/cutils.c @@ -74,7 +74,11 @@ void octave_sleep (unsigned int seconds) { +#if defined (__WIN32__) && ! defined (_POSIX_VERSION) + Sleep (1000 * seconds); +#else sleep (seconds); +#endif } void
--- a/src/oct-conf.h.in +++ b/src/oct-conf.h.in @@ -252,6 +252,10 @@ #define OCTAVE_CONF_RUNTEST %OCTAVE_CONF_RUNTEST% #endif +#ifndef OCTAVE_CONF_SED +#define OCTAVE_CONF_SED %OCTAVE_CONF_SED% +#endif + #ifndef OCTAVE_CONF_SHARED_LIBS #define OCTAVE_CONF_SHARED_LIBS %OCTAVE_CONF_SHARED_LIBS% #endif
--- a/src/toplev.cc +++ b/src/toplev.cc @@ -702,6 +702,7 @@ m ["RDYNAMIC_FLAG"] = OCTAVE_CONF_RDYNAMIC_FLAG; m ["RLD_FLAG"] = OCTAVE_CONF_RLD_FLAG; m ["RUNTEST"] = OCTAVE_CONF_RUNTEST; + m ["SED"] = OCTAVE_CONF_SED; m ["SHARED_LIBS"] = OCTAVE_CONF_SHARED_LIBS; m ["SHLEXT"] = OCTAVE_CONF_SHLEXT; m ["SHLEXT_VER"] = OCTAVE_CONF_SHLEXT_VER;