|
From: | Stepan Kasal |
Subject: | Re: non portable sed scripts |
Date: | Mon, 22 May 2006 14:30:44 +0200 |
User-agent: | Mutt/1.4.2.1i |
Hello Ralf, thank you for your explanation. I felt that things are getting more compliacted than necessary, so I broke this into 6 patches. First, I installed the following three ones (attached): autoconf-20060522-no-labels.patch - that `:' doesn't count as a command on the HP-UX sed autoconf-20060522-feature-check-length.patch - delete only the files you created, required by the AC_PROG_SED patch, but harmless anyway autoconf-20060522-typo.patch - just typos What remains from the patch that Ralf proposed in the previous mail? The doc fixes for sed length limitations, and the AC_PROG_SED patch. And then we have to return to the hack I proposed. 1) AC_PROG_SED patch (autoconf-20060522-prog-sed.patch) On Mon, May 22, 2006 at 11:21:16AM +0200, Ralf Wildenhues wrote: > [...] I think it's a good idea though (and I did do some testing > with some system seds). Well, I don't agree that this is a ``bugfix''. The macro searches for a ``good sed'' and you strengthened the conditions for that. In particular, the macro will now fail on Solaris systems without xpg4, right? The previous version found an implementation which worked with small scripts. Anyway, I agree it is better to change the macro now, before it is first published. 2) The doc fixes. I modified the following text: > +Solaris @command{/usr/ucb/sed} has a limit of about 6000 bytes for the > +internal representation of the sed script, which can not be circumvented > +using more than one script file. It fails with longer scripts, and > +and Solaris @command{/usr/xpg4/bin/sed} dumps core with long scripts. The first half of the second sentence still speaks about /usr/ucb/sed, while the second half speaks about another one; yet they are connected by a comma. I think this is unfortunate, so I changed it this way: ``[...] more than one script file, and it fails with longer scripts. Moreover, Solaris @command{/usr/xpg4/bin/sed} dumps core with long scripts.'' I also shortened the description of AC_PROG_SED and AC_PROG_*GREP: - We shall not mention that we prefer GNU sed; that may change if we find a serious bug in certain version of it. - We shall not mention that we look for the binaries ``on PATH''; this is not true for AC_PROG_GREP and can change for other macros, too. These proposals led to autoconf-20060522-doc.patch, also attached. 3) autoconf-20060522-sed-safe.patch (my hack, this time w/ a chlog entry) A few comments about this trivial patch: Ralf said, replying to my post: > > Since most packages use only one config header, we don't have to be > > sad that its creation has been slowed down. > > Agreed. But the problem is not only the config header generation. The > config files generation suffers from the size limitation, too. Luckily, > it seems we are generally still below the limit on that. Of course, this is not a general solution, just a hack which fixes most real world cases. The proposed variant is relatively weak, and a stronger variants can be imagined: - we could have ac_max_sed_lines=38, as in Autoconf 2.59 - we could shorten the scripts for config files (Dan Manthey's code) by lowering _AC_SED_CMD_LIMIT, too. To make the fragments' size simiar to what we had with 2.59, we could set it to say 45. (The previous version had 2 commands per each substitution, that is about 50, and then subtract another 5 to compensate for all those |#_!!_#|.) Ralf, if you decide to strengthen the patch this way, I won't object. I don't think it would mind if this release is slightly slower. (And the future version will hopefully use awk. ;-) Have a nice day, Stepan PS: Ufff, this was long. I know why I avoided reading the Autoconf lists during the last few weeks. See you in June. ;-)
autoconf-20060522-no-labels.patch
Description: Text document
autoconf-20060522-feature-check-length.patch
Description: Text document
autoconf-20060522-typo.patch
Description: Text document
autoconf-20060522-prog-sed.patch
Description: Text document
autoconf-20060522-doc.patch
Description: Text document
autoconf-20060522-sed-safe.patch
Description: Text document
[Prev in Thread] | Current Thread | [Next in Thread] |