octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Set awk and find used in run-octave from configure


From: Moritz Borgmann
Subject: Set awk and find used in run-octave from configure
Date: Tue, 4 Dec 2007 01:49:46 +0100

To make run-octave run under Solaris, I propose the following patchset:

ChangeLog:

2007-12-03  Moritz Borgmann  <address@hidden>

* 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.

Index: Makeconf.in
===================================================================
RCS file: /cvs/octave/Makeconf.in,v
retrieving revision 1.201
diff -u -r1.201 Makeconf.in
--- Makeconf.in 26 Oct 2007 18:22:04 -0000      1.201
+++ Makeconf.in 29 Nov 2007 22:01:07 -0000
@@ -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" \
Index: aclocal.m4
===================================================================
RCS file: /cvs/octave/aclocal.m4,v
retrieving revision 1.116
diff -u -r1.116 aclocal.m4
--- aclocal.m4  24 Oct 2007 20:35:20 -0000      1.116
+++ aclocal.m4  29 Nov 2007 22:01:07 -0000
@@ -817,6 +817,14 @@
AC_DEFINE(MKDIR_TAKES_ONE_ARG, 1, [Define if host mkdir takes a single argument.])
 fi
 ])
+# OCTAVE_PROG_FIND
+# ----------------
+# Check for gfind first since it's generally better.
+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, )])
 # OCTAVE_PROG_SED
 # --------------
 # Check for a fully-functional sed program, that truncates
Index: configure.in
===================================================================
RCS file: /cvs/octave/configure.in,v
retrieving revision 1.596
diff -u -r1.596 configure.in
--- configure.in        14 Nov 2007 22:21:35 -0000      1.596
+++ configure.in        29 Nov 2007 22:01:07 -0000
@@ -1592,6 +1592,7 @@
 ### and running Octave.

 AC_PROG_AWK
+OCTAVE_PROG_FIND
 OCTAVE_PROG_SED
 OCTAVE_PROG_PERL
 OCTAVE_PROG_PYTHON
Index: run-octave.in
===================================================================
RCS file: /cvs/octave/run-octave.in,v
retrieving revision 1.24
diff -u -r1.24 run-octave.in
--- run-octave.in       12 Oct 2007 21:27:12 -0000      1.24
+++ run-octave.in       29 Nov 2007 22:01:07 -0000
@@ -20,7 +20,8 @@
 ## along with Octave; see the file COPYING.  If not, see
 ## <http://www.gnu.org/licenses/>.

-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; }'`


reply via email to

[Prev in Thread] Current Thread [Next in Thread]