* opts.sh: Tweak awk script for portability.
authorKelley Cook <kelleycook@wideopenwest.com>
Fri, 20 Jun 2003 20:07:51 +0000 (20:07 +0000)
committerNeil Booth <neil@gcc.gnu.org>
Fri, 20 Jun 2003 20:07:51 +0000 (20:07 +0000)
From-SVN: r68282

gcc/ChangeLog
gcc/opts.sh

index 3f405374acaf08ca2acfc76f04d4889c3746b931..7625baeb7987db2bb4e8e4511fa88c15759672db 100644 (file)
@@ -1,3 +1,7 @@
+2003-06-20  Kelley Cook  <kelleycook@wideopenwest.com>
+
+       * opts.sh: Tweak awk script for portability.
+
 2003-06-20  Mark Mitchell  <mark@codesourcery.com>
 
        PR c++/10888
index bbca27265c725eae95a3f46c66b5be10dc23628f..385ef34414e5661067f0b4a762ee5ebecdb32700 100644 (file)
@@ -33,15 +33,11 @@ SORT=sort           # Could be /bin/sort or /usr/bin/sort
 C_FILE=$1; shift
 H_FILE=$1; shift
 
-# Must unset, so that RS="" works in gawk 3.0-3.1.1 (possibly earlier too)
-# Appears to be a gawk bug, RS="" is not an extension
-unset POSIXLY_CORRECT
-
 ${AWK} '
-       BEGIN{ RS=""; FS="\n" }
        # Ignore comments and blank lines
        /^[ \t]*(;|$)/  { next }
-       /^[^ \t]/       { gsub ("\n", "\034", $0); print }
+       # Note that RS="" falls foul of gawk 3.1.2 bugs
+       /^[^ \t]/       { getline tmp; print $0 "\034" tmp}
 ' "$@" | ${SORT} | ${AWK} '
     function switch_flags (flags,   result)
     {