[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
65-fyi-finish-autoheader.patch
From: |
Akim Demaille |
Subject: |
65-fyi-finish-autoheader.patch |
Date: |
Fri, 31 Aug 2001 15:30:39 +0200 |
Index: ChangeLog
from Akim Demaille <address@hidden>
* bin/autoheader.in: Handle the acconfig.h etc. junk files.
Check the completeness of the #template.
* lib/Autom4te/General.pm (&update_file): s/remove/unlink/.
* tests/semantics.at (AC_C_BIGENDIAN): Adjust AT_CHECK_AUTOHEADER
invocation.
Index: bin/autoheader.in
--- bin/autoheader.in Fri, 31 Aug 2001 09:41:25 +0200 akim
+++ bin/autoheader.in Fri, 31 Aug 2001 10:15:54 +0200 akim
@@ -33,9 +33,6 @@
unshift @INC, "$perllibdir";
}
-use Getopt::Long;
-use File::Basename;
-use IO::File;
use Autom4te::General;
use strict;
@@ -194,7 +191,7 @@ sub parse_args ()
verbose "$me: running $autoconf to trace from $ARGV[0]";
xsystem ("$autoconf "
. " --trace AC_CONFIG_HEADERS:'\$\$config_h ||= \"\$1\";'"
- . " --trace AH_OUTPUT:'\$\$verbatim{\$1} = \"\\\n\$2\";'"
+ . " --trace AH_OUTPUT:'\$\$verbatim{\"\$1\"} = \"\\\n\$2\";'"
. " --trace AC_DEFINE_TRACE_LITERAL:'\$\$symbol{\"\$1\"} = 1;'"
. " $ARGV[0] >$tmp/traces.pl");
@@ -217,11 +214,26 @@ sub parse_args ()
print $out "/* $config_h_in. Generated from $ARGV[0] by autoheader. */\n";
# Dump the top.
-# test -r $config_h.top && cat $config_h.top >>$tmp/config.hin
-#
-# # Dump `acconfig.h' but its bottom.
-# test -r $localdir/acconfig.h &&
-# sed '/@BOTTOM@/,$d;s/@TOP@//' $localdir/acconfig.h >>$tmp/config.hin
+if ($config_h_top)
+ {
+ my $in = new IO::File ($config_h_top);
+ while ($_ = $in->getline)
+ {
+ print $out;
+ }
+ }
+
+# Dump `acconfig.h' but its bottom.
+if ($acconfig_h)
+ {
+ my $in = new IO::File ($acconfig_h);
+ while ($_ = $in->getline)
+ {
+ last if /address@hidden@/;
+ next if /address@hidden@/;
+ print $out;
+ }
+ }
# Dump the templates from `configure.ac'.
foreach (sort keys %verbatim)
@@ -229,29 +241,45 @@ sub parse_args ()
print $out "$verbatim{$_}\n";
}
+# Dump `acconfig.h' bottom.
+if ($acconfig_h)
+ {
+ my $in = new IO::File ($acconfig_h);
+ my $dump = 0;
+ while ($_ = $in->getline)
+ {
+ print $out if $dump;
+ $dump = 1 if /address@hidden@/;
+ }
+ }
+
+# Dump the bottom.
+if ($config_h_bot)
+ {
+ my $in = new IO::File ($config_h_bot);
+ while ($_ = $in->getline)
+ {
+ print $out;
+ }
+ }
+
$out->close;
-# # Handle the case where @BOTTOM@ is the first line of acconfig.h.
-# test -r $localdir/acconfig.h &&
-# grep @BOTTOM@ $localdir/acconfig.h >/dev/null &&
-# sed -n '/@BOTTOM@/,${/@BOTTOM@/!p;}' $localdir/acconfig.h >>$tmp/config.hin
-# test -f $config_h.bot && cat $config_h.bot >>$tmp/config.hin
-
-# # Check that all the symbols have a template.
-# $verbose $me: checking completeness of the template >&2
-# # Regexp for a white space.
-# w='[ ]'
-# if test -n "$syms"; then
-# for sym in $syms; do
-# if egrep "^#$w*[a-z]*$w$w*$sym($w*|$w.*)$" $tmp/config.hin >/dev/null;
then
-# : # All is well.
-# else
-# echo "$me: No template for symbol \`$sym'" >&2
-# status=1
-# fi
-# done
-# fi
+# Check that all the symbols have a template.
+{
+ my $in = new IO::File ("$tmp/config.hin");
+ while ($_ = $in->getline)
+ {
+ my ($symbol) = /^\#\s*\w+\s+(\w+)/
+ or next;
+ delete $symbol{$symbol};
+ }
+ foreach (sort keys %symbol)
+ {
+ print STDERR "$me: missing template: $_\n";
+ }
+ exit 1
+ if keys %symbol;
+}
update_file ("$tmp/config.hin", "$config_h_in");
-
-__END__
Index: lib/Autom4te/General.pm
--- lib/Autom4te/General.pm Fri, 31 Aug 2001 09:41:25 +0200 akim
+++ lib/Autom4te/General.pm Fri, 31 Aug 2001 10:06:57 +0200 akim
@@ -20,8 +20,10 @@
use 5.005;
use Exporter;
+use Getopt::Long;
use File::Basename;
use File::stat;
+use IO::File;
use Carp;
use strict;
@@ -230,7 +232,7 @@ sub update_file ($$)
print $out $_;
}
$in->close;
- remove ($from)
+ unlink ($from)
or die "$me: cannot not remove $from: $!\n";
return;
}
Index: tests/semantics.at
--- tests/semantics.at Sun, 19 Aug 2001 11:37:40 +0200 akim
+++ tests/semantics.at Fri, 31 Aug 2001 10:22:48 +0200 akim
@@ -322,11 +322,13 @@ m4_define([AT_CHECK_PROGS_PREPARE],
AT_CLEANUP(path)
-# -------------- #
-# AC_C_BIGENDIAN #
-# -------------- #
-AT_SETUP(AC_C_BIGENDIAN)
+
+## ---------------- ##
+## AC_C_BIGENDIAN. ##
+## ---------------- ##
+
+AT_SETUP([[AC_C_BIGENDIAN]])
# Make sure that AC_C_BIGENDIAN behave the same whether we are
# cross-compiling or not.
@@ -352,16 +354,17 @@ m4_define([AT_CHECK_PROGS_PREPARE],
# Make sure AC_C_BIGENDIAN with no argument will define WORDS_BIGENDIAN
AT_CONFIGURE_AC([AC_C_BIGENDIAN])
-AT_CHECK_AUTOHEADER
+AT_CHECK_AUTOHEADER([], [], [], [autoheader: `config.hin' is updated])
AT_CHECK([grep WORDS_BIGENDIAN config.hin], [], [ignore])
AT_CLEANUP(at-endian)
+
# ------------------------------ #
# AC_PATH_PROG & AC_PATH_PROGS. #
# ------------------------------ #
-AT_SETUP(AC_PATH_PROG & AC_PATH_PROGS)
+AT_SETUP([[AC_PATH_PROG & AC_PATH_PROGS]])
AT_CHECK_PROGS_PREPARE
Index: tests/tools.at
--- tests/tools.at Fri, 31 Aug 2001 09:41:25 +0200 akim
+++ tests/tools.at Fri, 31 Aug 2001 10:23:29 +0200 akim
@@ -432,6 +432,8 @@ configure:18: error: possibly undefined
# Yes, that's right: the `middle' part of `acconfig.h' is still before
# the AH_TOP part. But so what, you're not supposed to use the two
# together.
+# Ignore STDERR which is the longuish complaint against autoheader junk
+# files.
AT_CHECK([autoheader -<configure.ac], 0,
[[/* config.h.in. Generated automatically from Standard input by autoheader.
*/
/* Top from acconfig.h. */
@@ -448,7 +450,7 @@ configure:18: error: possibly undefined
Bottom2 from configure.ac.
/* Bottom from acconfig.h. */
-]], [])
+]], [ignore])
AT_CLEANUP
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- 65-fyi-finish-autoheader.patch,
Akim Demaille <=