Hello, I'd like to propose a solution, please speak up if you are not satisfied with it. (If we reach an agreement, I'm willing to prepare a patch later.)
First, let me state that, strictly speaking, this is not a regression. The Autoconf manual says that the #undef line cannot contain anything after the symbol. And in that case, all versions tested by Ralf do the same. Does anyone know whether comments on #undef lines and #define lines are portable? I always thought that #undef comments were not portable and #define comments could at least became part of the body of the macro definition. I thought this were the reason why these comments were generally frown upon. If that were true, than I would prefer deleting the rest of the line after #undef since it might make the resulting header more portable. About the case of #undef OTHER_SYMBOL being commented out, I suggest to preserve that behaviour, or someone will get trapped by that change and report a regression. ;-) I suggest to add a note to the manual along these lines: `` Generally speaking, all #define and #undef directives in the header template may be modified by config.status, under some circumstances. Consequently, if you need to define or undefine a symbol under some circumstances (#ifdef THIS #define THAT, etc.), you should place those directives outside the config headers. If you absolutely need to hook that to the config header itself, please put these directives to a separate file, and #include it from the config header template. (If you are using autoheader, you would probably use AH_TOP or AH_BOTTOM to inject the #include directive. For certain symbold it is important to avoid #undef ... [explanation about _POSIX_WHATEVER]. To achive this, current Autoconf comments out _all_ remaining #undef directives remaining in the config header at the end of the instatiation, but this may change in future releases. '' WDYT? Stepan