# HG changeset patch # User jwe # Date 1196735247 0 # Node ID 5a9561046b89c3a6f0b93ed0111b745fb3f7d215 # Parent e8d7eed42935c25fc023ca5ed5ec855ee4e8770c [project @ 2007-12-04 02:27:27 by jwe] diff --git a/ChangeLog b/ChangeLog --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2007-12-03 Moritz Borgmann + + * Makeconf.in, aclocal.m4, configure.in: Check for find program, + preferably gfind (on non-GNU systems). Need a sane find for + run-octave script. + * run-octave.in: Use FIND and AWK as determined by configure. + 2007-12-03 John W. Eaton * configure.in: If available, include in test for diff --git a/Makeconf.in b/Makeconf.in --- a/Makeconf.in +++ b/Makeconf.in @@ -29,6 +29,9 @@ SED = @SED@ export SED +FIND = @FIND@ +export FIND + PERL = @PERL@ PYTHON = @PYTHON@ @@ -586,6 +589,8 @@ define do-subst-script-vals echo "making $@ from $<" $(SED) < $< \ + -e "s|%AWK%|${AWK}|g" \ + -e "s|%FIND%|${FIND}|g" \ -e "s|%library_path_var%|${library_path_var}|g" \ -e "s|%liboctinterp%|${LIBPRE}octinterp.${SHLEXT}|g" \ -e "s|%liboctave%|${LIBPRE}octave.${SHLEXT}|g" \ diff --git a/aclocal.m4 b/aclocal.m4 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -817,8 +817,18 @@ AC_DEFINE(MKDIR_TAKES_ONE_ARG, 1, [Define if host mkdir takes a single argument.]) fi ]) -# OCTAVE_PROG_SED -# -------------- +dnl +dnl Find find. +dnl +# Prefer GNU find if found. +AN_MAKEVAR([FIND], [OCTAVE_PROG_FIND]) +AN_PROGRAM([gfind], [OCTAVE_PROG_FIND]) +AN_PROGRAM([find], [OCTAVE_PROG_FIND]) +AC_DEFUN([OCTAVE_PROG_FIND], +[AC_CHECK_PROGS(FIND, gfind find, )]) +dnl +dnl Find sed. +dnl # Check for a fully-functional sed program, that truncates # as few characters as possible and that supports "\(X\|Y\)" # style regular expression alternation. Prefer GNU sed if found. diff --git a/configure.in b/configure.in --- a/configure.in +++ b/configure.in @@ -29,7 +29,7 @@ EXTERN_CXXFLAGS="$CXXFLAGS" AC_INIT -AC_REVISION($Revision: 1.598 $) +AC_REVISION($Revision: 1.599 $) AC_PREREQ(2.57) AC_CONFIG_SRCDIR([src/octave.cc]) AC_CONFIG_HEADER(config.h) @@ -1596,6 +1596,7 @@ ### and running Octave. AC_PROG_AWK +OCTAVE_PROG_FIND OCTAVE_PROG_SED OCTAVE_PROG_PERL OCTAVE_PROG_PYTHON diff --git a/run-octave.in b/run-octave.in --- a/run-octave.in +++ b/run-octave.in @@ -20,7 +20,8 @@ ## along with Octave; see the file COPYING. If not, see ## . -AWK=${AWK:-'awk'} +AWK=%AWK% +FIND=%FIND% # FIXME -- is there a better way to handle the possibility of spaces # in these names? @@ -37,10 +38,10 @@ d3="$builddir/scripts" d4="$builddir/src" -d1_list=`find "$d1" -type d -a ! \( \( -name CVS -o -name private \) -a -prune \) -exec echo '{}': ';'` -d2_list=`find "$d2" -type d -a ! \( \( -name CVS -o -name private \) -a -prune \) -exec echo '{}': ';'` -d3_list=`find "$d3" -type d -a ! \( \( -name CVS -o -name private \) -a -prune \) -exec echo '{}': ';'` -d4_list=`find "$d4" -type d -a ! \( \( -name CVS -o -name private \) -a -prune \) -exec echo '{}': ';'` +d1_list=`$FIND "$d1" -type d -a ! \( \( -name CVS -o -name private \) -a -prune \) -exec echo '{}': ';'` +d2_list=`$FIND "$d2" -type d -a ! \( \( -name CVS -o -name private \) -a -prune \) -exec echo '{}': ';'` +d3_list=`$FIND "$d3" -type d -a ! \( \( -name CVS -o -name private \) -a -prune \) -exec echo '{}': ';'` +d4_list=`$FIND "$d4" -type d -a ! \( \( -name CVS -o -name private \) -a -prune \) -exec echo '{}': ';'` d1_path=`echo "$d1_list" | $AWK '{ t = (s $0); s = t; } END { sub (/:$/, "", s); print s; }'` d2_path=`echo "$d2_list" | $AWK '{ t = (s $0); s = t; } END { sub (/:$/, "", s); print s; }'` diff --git a/scripts/testfun/test.m b/scripts/testfun/test.m --- a/scripts/testfun/test.m +++ b/scripts/testfun/test.m @@ -480,8 +480,8 @@ fputs (__fid, __msg); fflush (__fid); ## show the variable context - if (! strcmp (__type, "error") && ! strcmp (__type, "testif") && - ! all (__shared == " ")) + if (! strcmp (__type, "error") && ! strcmp (__type, "testif") + && ! all (__shared == " ")) fputs (__fid, "shared variables "); eval (sprintf ("fdisp(__fid,bundle(%s));", __shared)); fflush (__fid);