>>>>> "Ralf" == Ralf Fassel <[EMAIL PROTECTED]> writes: Ralf> I have GNU m4 1.4 installed at this machine, would that be ok? Fine! Ralf> I'll give it a try. Results tomorrow :-) Fine too :) | In fact I think it is enough to | | | : t | | s%#undef FOO$%#define FOO 1%;t t | | s%#undef DIRECTORY_SEPARATOR$%#define DIRECTORY_SEPARATOR '/'%;t t | | s%#undef [a-zA-Z_][a-zA-Z_0-9]*%/* & */% | | this is the approach taken in the a2ps and Autoconf I just gave. I | like it better, it is less hacky. Ralf> Yes, this works too, but is has the potential danger of an Ralf> endless loop if the replacement triggers another match (eg: add Ralf> `;t t' to the last line, too). Oh, yes, yes, that's why I had changed it :( This is no risk with #undef -> #define, but there is that danger with #define templates. 2000-02-10 Akim Demaille <[EMAIL PROTECTED]> Honor properly the `#define' config.h.in templates. Test it. * acgeneral.m4 (AC_OUTPUT_HEADERS): Renamed as... (_AC_OUTPUT_HEADERS): this. All callers changed. Don't mess with changequote, just quote properly. Bug 1. Because of the `#' in `ac_dA', the quotes <<>> were not removed, and therefore the sed script contained `<<define>>' instead of `define'. Now that the block is properly quoted, there is no need to quote `define'. Bug 2. Once a `#define' substitution performed, we were branching to the top of the sed script (`t top'). This resulted in an endless substitution of `#define foo 1' to `#define foo 1'. Branching is not enough: you also have to fetch the next input line, i.e., use `t' instead of `t t' in ac_dD, and don't output `: top' in `config.defines'. Though it was correct for `#undef' templates, just apply the same transformation to `ac_uD' and `config.undefs'. Bug 3. Don't try to preserve what was behind the value in the template, since on #define NAME "bar baz" it leads to #define NAME 1 baz" Now `ac_dB' catches everything behind the NAME (making sure there is at least a space) and `ac_dC' only outputs a space. * tests/torture.m4: Check that various forms of `#define' header templates are properly handled. Heck, I hate those #define templates. Can't we get rid of them? They're only leading to complications. Yes, it is not 100% compatible with previous Autoconves, but they are a real pain, they force us to have twice the needed code. `autoheader' can be used to guarantee the user has proper #undef templates. I moved this to autoconf@ so that this can be debated (again). Akim