octave-maintainers
[Top][All Lists]
Advanced

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

[patch] tweaks for broken sed (eg., on Solaris)


From: Mumit Khan
Subject: [patch] tweaks for broken sed (eg., on Solaris)
Date: Thu, 16 Jan 2003 12:40:52 -0600 (CST)

The broken sed on Solaris bugs me as I forget to prepend /usr/xpg4/bin to
PATH before running make. The SED variable, which does finds the non-broken
sed on Solaris is unfortunately not used in the various shell-scripts in src,
and that breaks building src/daspk.df, and possible other generated files
as well. Since Octave requires GNU Make, this patch simply exports it from
make, and the shell scripts use it if available.

toplevel/ChangeLog:
2003-10-16  Mumit Khan  <address@hidden>

        * Makeconf.in (SED): Export to subshells.

src/ChangeLog:

2003-10-16  Mumit Khan  <address@hidden>

        * mk-oct-links: Use $SED if set.
        * mkbuiltins: Likewise.
        * mkdefs: Likewise.
        * mkdocs: Likewise.
        * mkgendoc: Likewise.
        * mkops: Likewise.

Index: Makeconf.in
===================================================================
RCS file: /cvs/octave/Makeconf.in,v
retrieving revision 1.134
diff -u -3 -p -r1.134 Makeconf.in
--- Makeconf.in 2003/01/13 15:10:39     1.134
+++ Makeconf.in 2003/01/16 17:51:15
@@ -10,6 +10,7 @@
 SHELL = /bin/sh

 SED = @SED@
+export SED

 # A shell command to extract the version number from version.h.
 getversion = $(SED) -e '/VERSION/!d' -e 's/.*"\(.*\)".*$$/\1/' -e q
Index: src/mk-oct-links
===================================================================
RCS file: /cvs/octave/src/mk-oct-links,v
retrieving revision 1.3
diff -u -3 -p -r1.3 mk-oct-links
--- src/mk-oct-links    2002/08/15 17:38:55     1.3
+++ src/mk-oct-links    2003/01/16 17:51:16
@@ -10,6 +10,8 @@
 # .df files corresponding to the source files that were used to
 # create the .oct files.

+SED=${SED:-'sed'}
+
 print_only=false
 if [ $1 = "-p" ]; then
   print_only=true
@@ -20,9 +22,9 @@ links_dir=$1
 shift

 for f in "$@"; do
-  base=`basename $f | sed 's/\.df$//'`
+  base=`basename $f | $SED 's/\.df$//'`
   fcns=`grep '^ *XDEFUN_DLD_INTERNAL' $f |\
-        sed -e 's/XDEFUN_DLD_INTERNAL *( *//' -e 's/ *,.*$//' |\
+        $SED -e 's/XDEFUN_DLD_INTERNAL *( *//' -e 's/ *,.*$//' |\
         sort -u`
   if [ -n "$fcns" ]; then
     for n in $fcns; do
Index: src/mkbuiltins
===================================================================
RCS file: /cvs/octave/src/mkbuiltins,v
retrieving revision 1.18
diff -u -3 -p -r1.18 mkbuiltins
--- src/mkbuiltins      2002/12/21 17:15:25     1.18
+++ src/mkbuiltins      2003/01/16 17:51:16
@@ -5,6 +5,8 @@ if test $# -ne 2; then
   exit 1
 fi

+SED=${SED:-'sed'}
+
 DEF_FILES=`cat $1`
 VAR_FILES=`cat $2`

@@ -68,7 +70,7 @@ cat << \EOF
 EOF

 for file in $DEF_FILES; do
-  fcn=`echo $file | sed 's,^\./,,; s/\.df//; s/-/_/g'`
+  fcn=`echo $file | $SED 's,^\./,,; s/\.df//; s/-/_/g'`
   echo "static void"
   echo "install_${fcn}_fcns (void)"
   echo "{"
@@ -78,7 +80,7 @@ for file in $DEF_FILES; do
 done

 for file in $VAR_FILES; do
-  f=`echo $file | sed 's,^\./,,; s/-/_/g'`
+  f=`echo $file | $SED 's,^\./,,; s/-/_/g'`
   echo "extern void symbols_of_${f} (void);"
 done

@@ -90,7 +92,7 @@ install_builtin_variables (void)
 EOF

 for file in $VAR_FILES; do
-  f=`echo $file | sed 's,^\./,,; s/-/_/g'`
+  f=`echo $file | $SED 's,^\./,,; s/-/_/g'`
   echo "  symbols_of_${f} ();"
 done

@@ -103,7 +105,7 @@ install_builtin_functions (void)
 EOF

 for file in $DEF_FILES; do
-  fcn=`echo $file | sed 's,^\./,,; s/\.df//; s/-/_/g'`
+  fcn=`echo $file | $SED 's,^\./,,; s/\.df//; s/-/_/g'`
   echo "  install_${fcn}_fcns ();"
 done

Index: src/mkdefs
===================================================================
RCS file: /cvs/octave/src/mkdefs,v
retrieving revision 1.4
diff -u -3 -p -r1.4 mkdefs
--- src/mkdefs  2000/11/29 22:58:53     1.4
+++ src/mkdefs  2003/01/16 17:51:16
@@ -1,6 +1,8 @@
 #!/bin/sh

-sed -n -e '/^ *BEGIN_INSTALL_BUILTIN/{
+SED=${SED:-'sed'}
+
+$SED -n -e '/^ *BEGIN_INSTALL_BUILTIN/{
   : loop
   s/BEGIN_INSTALL_BUILTIN//
   s/^#[ \t][ \t]*[0-9][0-9]*.*$//
Index: src/mkdocs
===================================================================
RCS file: /cvs/octave/src/mkdocs,v
retrieving revision 1.1
diff -u -3 -p -r1.1 mkdocs
--- src/mkdocs  1999/10/19 10:13:06     1.1
+++ src/mkdocs  2003/01/16 17:51:16
@@ -1,6 +1,8 @@
 #!/bin/sh

-sed -n -e '/^BEGIN_DOC_STRING/{
+SED=${SED:-'sed'}
+
+$SED -n -e '/^BEGIN_DOC_STRING/{
   : loop
   N
   /END_DOC_STRING/b done
Index: src/mkgendoc
===================================================================
RCS file: /cvs/octave/src/mkgendoc,v
retrieving revision 1.10
diff -u -3 -p -r1.10 mkgendoc
--- src/mkgendoc        2003/01/04 01:10:26     1.10
+++ src/mkgendoc        2003/01/16 17:51:16
@@ -1,5 +1,7 @@
 #! /bin/sh

+SED=${SED:-'sed'}
+
 if test $# -ne 1; then
   echo "usage: mkgendoc f1" 1>&2
   exit 1
@@ -67,7 +69,7 @@ print_doc_string (const std::string& nam
 EOF

 for file in $DOC_FILES; do
-  fcn=`echo $file | sed 's,^\./,,; s/\.df//; s/-/_/g'`
+  fcn=`echo $file | $SED 's,^\./,,; s/\.df//; s/-/_/g'`
   echo "static void"
   echo "print_${fcn}_doc_strings (void)"
   echo "{"
@@ -84,7 +86,7 @@ main (void)
 EOF

 for file in $DOC_FILES; do
-  fcn=`echo $file | sed 's,^\./,,; s/\.df//; s/-/_/g'`
+  fcn=`echo $file | $SED 's,^\./,,; s/\.df//; s/-/_/g'`
   echo "  print_${fcn}_doc_strings ();"
 done

Index: src/mkops
===================================================================
RCS file: /cvs/octave/src/mkops,v
retrieving revision 1.3
diff -u -3 -p -r1.3 mkops
--- src/mkops   1998/12/04 23:20:22     1.3
+++ src/mkops   2003/01/16 17:51:16
@@ -1,5 +1,7 @@
 #!/bin/sh

+SED=${SED:-'sed'}
+
 cat << \EOF
 // DO NOT EDIT!  Generated automatically by mkbuiltins.

@@ -12,7 +14,7 @@ extern void install_base_type_conversion
 EOF

 for file in "$@"; do
-  f=`echo $file | sed 's,^\./,,; s%^OPERATORS/op-%%; s%\.cc%%; s%-%_%g'`
+  f=`echo $file | $SED 's,^\./,,; s%^OPERATORS/op-%%; s%\.cc%%; s%-%_%g'`
   echo "extern void install_${f}_ops (void);"
 done

@@ -26,7 +28,7 @@ install_ops (void)
 EOF

 for file in "$@"; do
-  f=`echo $file | sed 's,^\./,,; s%^OPERATORS/op-%%; s%\.cc%%; s%-%_%g'`
+  f=`echo $file | $SED 's,^\./,,; s%^OPERATORS/op-%%; s%\.cc%%; s%-%_%g'`
   echo "  install_${f}_ops ();"
 done





reply via email to

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