autoconf
[Top][All Lists]
Advanced

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

Re: Appending to config.log


From: Akim Demaille
Subject: Re: Appending to config.log
Date: 20 May 2002 12:01:45 +0200
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Common Lisp)

| I'm writing a macro to test whether make supports a particular
| feature.  To do this, I construct a sample Makefile and invoke make on
| it.  If make returns a non-zero exit code, I know that the test
| failed, but I'd also like to save the output to config.log so the user
| can try to diagnose the problem.
| 
| I didn't see anything in the autoconf docs about this, so I assume
| there's currently no supported way to do it.  If I missed something,
| please point me in the right direction and disregard the rest of this
| message. :)
| 
| To address this problem, I'd like to see the following two macros
| added to autoconf:
| 
|   AC_LOG(TEXT)
|   ------------
|   Append TEXT to config.log.
| 
|   AC_RUN_COMMAND(COMMAND)
|   -----------------------
|   1. Run COMMAND, saving stderr to a file.
|   2. Set a shell variable to the command's exit value so that macro
|      caller can get it.
|   2. If exit value is non-zero, append stderr output to config.log.
|   3. Remove stderr output file.
| 
| Looking through the autoconf macro files, it looks like there's
| already some stuff that's very similar to my proposed AC_RUN_COMMAND
| macro, but it doesn't look like it's really intended to be a
| general-purpose macro, and it's also not part of the published
| interface.  I don't know whether it would be easier to modify the
| existing internal macros or just start from scratch, but I guess it
| doesn't matter as long as the result is the same. :)
| 
| Anyway, I'd appreciate any reactions that anyone has to any of this.
| Thanks!

Hi!

Your need is very legitimate!  The main problem is that the behavior
of one such macro is very unclear, especially because there are
several possible evaluation schemes of the COMMANDS (e.g., the
compiling macros need the COMMANDS to be evaluated twice, since they
contain shell variables that must be expanded.

I'm going to try to clear this part in Autoconf, and to provide a
definitive interface.

As far as config.log is concerned, there was not enough demand for
such a macro: having config.log filled as a side-effect of some main
command (such as AC_RUN_COMMAND) has always been proved sufficient.
Since I'm willing to keep the interface as small as possible, it has
never been provided.

If AC_RUN_COMMAND or similar fulfils, your needs, would that be
enough, or would you still need some form of AC_MSG_LOG?



reply via email to

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