]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
Use a single tool to reformat the raw `configure' script output by
authorAkim Demaille <akim@epita.fr>
Mon, 20 Mar 2000 10:06:36 +0000 (10:06 +0000)
committerAkim Demaille <akim@epita.fr>
Mon, 20 Mar 2000 10:06:36 +0000 (10:06 +0000)
m4.
Suggested by Paul Eggert.

* autoconf.sh: Stop playing with 2 seds and an AWK to finalize
`configure', a single AWK program is enough.

ChangeLog
autoconf.in
autoconf.sh
bin/autoconf.in

index 7eb633df3b66f73736a131b706763d1f5bd2a088..2fd257e2c67775e674a98515a261c2a93ab05915 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2000-03-17  Akim Demaille  <akim@epita.fr>
+
+       Use a single tool to reformat the raw `configure' script output by
+       m4.
+       Suggested by Paul Eggert.
+
+       * autoconf.sh: Stop playing with 2 seds and an AWK to finalize
+       `configure', a single AWK program is enough.
+
 2000-03-17  Akim Demaille  <akim@epita.fr>
 
        In Autoconf 2.13, although AC_OUTPUT_COMMANDS did double quote its
index 0f0a5cd5eb3bdf0b540f01c69eddf755940b92d1..d8062eda49c4f5a24a8c66160d1ee84fbf642bed 100644 (file)
@@ -253,21 +253,33 @@ case $task in
     chmod +x $outfile
   fi
 
-  # Put the real line numbers into configure to make config.log more helpful.
-  # Because quoting can sometimes get really painful in m4, there are special
-  # @tokens@ to substitute.
-  sed -e 's/[  ]*$//' <$tmpout |
-    sed -e '/^$/N;/\n$/D' |
-    $AWK '
-      /__oline__/ { printf "%d:", NR + 1 }
-                 { print }' |
-    sed '
-      /__oline__/s/^\([0-9][0-9]*\):\(.*\)__oline__/\2\1/
-      s/@<:@/[/g
-      s/@:>@/]/g
-      s/@S|@/$/g
-      s/@%:@/#/g
-      ' >&4
+  # Put the real line numbers into configure to make config.log more
+  # helpful.  Because quoting can sometimes get really painful in m4,
+  # there are special @tokens@ to substitute.
+  $AWK '
+    {
+      sub(/[         ]*$/, "")
+      if ($0 == "")
+        {
+          if (!duplicate)
+            print
+          duplicate = 1
+          next
+        }
+      duplicate = 0
+      oline++
+      while (sub(/__oline__/, oline))
+        continue
+      while (sub(/@<:@/, "["))
+        continue
+      while (sub(/@:>@/, "]"))
+        continue
+      while (sub(/@S\|@/, "$"))
+        continue
+      while (sub(/@%:@/, "#"))
+        continue
+      print
+    }' <$tmpout >&4
   ;; # End of the task script.
 
 
index 0f0a5cd5eb3bdf0b540f01c69eddf755940b92d1..d8062eda49c4f5a24a8c66160d1ee84fbf642bed 100644 (file)
@@ -253,21 +253,33 @@ case $task in
     chmod +x $outfile
   fi
 
-  # Put the real line numbers into configure to make config.log more helpful.
-  # Because quoting can sometimes get really painful in m4, there are special
-  # @tokens@ to substitute.
-  sed -e 's/[  ]*$//' <$tmpout |
-    sed -e '/^$/N;/\n$/D' |
-    $AWK '
-      /__oline__/ { printf "%d:", NR + 1 }
-                 { print }' |
-    sed '
-      /__oline__/s/^\([0-9][0-9]*\):\(.*\)__oline__/\2\1/
-      s/@<:@/[/g
-      s/@:>@/]/g
-      s/@S|@/$/g
-      s/@%:@/#/g
-      ' >&4
+  # Put the real line numbers into configure to make config.log more
+  # helpful.  Because quoting can sometimes get really painful in m4,
+  # there are special @tokens@ to substitute.
+  $AWK '
+    {
+      sub(/[         ]*$/, "")
+      if ($0 == "")
+        {
+          if (!duplicate)
+            print
+          duplicate = 1
+          next
+        }
+      duplicate = 0
+      oline++
+      while (sub(/__oline__/, oline))
+        continue
+      while (sub(/@<:@/, "["))
+        continue
+      while (sub(/@:>@/, "]"))
+        continue
+      while (sub(/@S\|@/, "$"))
+        continue
+      while (sub(/@%:@/, "#"))
+        continue
+      print
+    }' <$tmpout >&4
   ;; # End of the task script.
 
 
index 0f0a5cd5eb3bdf0b540f01c69eddf755940b92d1..d8062eda49c4f5a24a8c66160d1ee84fbf642bed 100644 (file)
@@ -253,21 +253,33 @@ case $task in
     chmod +x $outfile
   fi
 
-  # Put the real line numbers into configure to make config.log more helpful.
-  # Because quoting can sometimes get really painful in m4, there are special
-  # @tokens@ to substitute.
-  sed -e 's/[  ]*$//' <$tmpout |
-    sed -e '/^$/N;/\n$/D' |
-    $AWK '
-      /__oline__/ { printf "%d:", NR + 1 }
-                 { print }' |
-    sed '
-      /__oline__/s/^\([0-9][0-9]*\):\(.*\)__oline__/\2\1/
-      s/@<:@/[/g
-      s/@:>@/]/g
-      s/@S|@/$/g
-      s/@%:@/#/g
-      ' >&4
+  # Put the real line numbers into configure to make config.log more
+  # helpful.  Because quoting can sometimes get really painful in m4,
+  # there are special @tokens@ to substitute.
+  $AWK '
+    {
+      sub(/[         ]*$/, "")
+      if ($0 == "")
+        {
+          if (!duplicate)
+            print
+          duplicate = 1
+          next
+        }
+      duplicate = 0
+      oline++
+      while (sub(/__oline__/, oline))
+        continue
+      while (sub(/@<:@/, "["))
+        continue
+      while (sub(/@:>@/, "]"))
+        continue
+      while (sub(/@S\|@/, "$"))
+        continue
+      while (sub(/@%:@/, "#"))
+        continue
+      print
+    }' <$tmpout >&4
   ;; # End of the task script.