autoconf-patches
[Top][All Lists]
Advanced

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

Re: awk for config headers


From: Benoit SIGOURE
Subject: Re: awk for config headers
Date: Sun, 30 Sep 2007 23:22:48 +0200

On Sep 30, 2007, at 8:34 PM, Ralf Wildenhues wrote:

Following up on
<http://lists.gnu.org/archive/html/autoconf/2007-09/msg00075.html>,
here's a rewrite using awk instead of sed to generate config headers.

Notes:
- backslash-newline are retained in config.h, flattened for @DEFS@,
- should be portable to old awk,
- the length limits for define values should be lifted now (for config
  headers, not for DEFS): the per line limit is still that of sed and
  the shell, but for awk, long values are split into several literal
  strings (and over several lines in the script).
- formally, this is a work complexity reduction from D * L to D + L for
  D defines and L "active" config header lines, i.e., those with
  `#define' or `#undef' in the header input file,
- still needs testing on all kinds of systems.

The absolute impact of the speedup is rather small: for OpenMPI, on a
modern GNU/Linux x86, creating 5 config headers with roughly 520 defines takes 0.68 sec over previously 1.32 sec. So speedup is no reason to do
this change, even though the relative improvement is nice.

configure size increases by a few hundred bytes, config.status size
decreases for more than a few defines (from 180K to 160K in the above
example).

In the patch below, I've not changed the XFAILing test `Define a
newline' as that would clash with Eric's proposed patch; likewise a
manual change is still missing.

What do you think?

Great thing overall.


I do hope that the length of the awk script is due to the severe
limitations of portable awk rather than my inability to write concise
programs in that language, but of course would happy to be proven wrong
there.  ;-)

Looks fine to me.


Tested with plain awk on Solaris 2.6, HP-UX 10.20, AIX 4.3, Tru64 4.0D,
FreeBSD 6.2, GNU/Linux.


Tested here (Mac OSX 10.4.10) and I get failures. By the way, with Git, testing the patch is as simple as:
  - Saving the raw message with your favorite mail client.
  - Adding a line that contains `---' before the actual patch
  - Invoking git am /path/to/raw_mail
git am (apply mailbox) parses the headers of the mail to retain authorship and date of the original commit, looks for `---' in order to delimit the patch and the commit message (read: "it would be great if you guys got in the habit of adding the --- in your mails to be nice with Git users" :D). It does all the unescaping necessary (such as converting `=3D' in `=' etc.) and supports binary patches, type changes etc.

ERROR: 301 tests were run,
7 failed (4 expected failures).
9 tests were skipped.
[...]
testsuite: 103 156 158 failed

Hmm so I just checked without your patch:
$ git co HEAD~1
$ make -j2 && make check

ERROR: 301 tests were run,
6 failed (4 expected failures).
9 tests were skipped.
[...]
testsuite: 156 158 failed

So humm it looks like your patch breaks (at least) test #103 [#define header templates] here.

For the 3 tests, the error is:
.../m4:configure.ac:...: ERROR: end of file in string
autom4te: .../m4 failed with exit status: 1

testsuite.log @ https://www.tsunanet.net/~tsuna/awk-for-config- headers.log

I didn't have time to investigate, however please let me know if I can do anything to provide you with more valuable information.

--
Benoit Sigoure aka Tsuna
EPITA Research and Development Laboratory


Attachment: PGP.sig
Description: This is a digitally signed message part


reply via email to

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