[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 2/5] New FAQ node: Debugging.
From: |
Bruno Haible |
Subject: |
Re: [PATCH 2/5] New FAQ node: Debugging. |
Date: |
Sun, 4 Oct 2009 14:21:46 +0200 |
User-agent: |
KMail/1.9.9 |
Ralf,
Thanks a *lot* for this patch series. Here are two proposed additions:
- Mention the trick of running "bash -x -n configure" before even trying
to execute the configure script. When the configure script has invalid
shell syntax, this often has the same causes as when autoconf fails
(bad quoting, bad use of autoconf built-in macros etc.).
- I like Jim's recommendation to not "requiring users of your macro to
use the cache variables". What we see in many places in gnulib is that
a macro has a certain purpose/result, which can be stored in a variable
or a set of variables. The *_cv_* cache variable is the same as this
result only in simple cases. In more complex cases you often have 5
*_cv_* cache variable that together determine 1 or 2 result variables.
OTOH, the recommendation to use "@var{run-if-true} and @var{run-if-false}
parameters" works only for boolean result variables, and requires the
user to be familiar with functional programming style.
2009-10-04 Bruno Haible <address@hidden>
* doc/autoconf.texi (Debugging): Recommend to use
"bash -x -n configure". Recommend the use of result variables as an
alternative to run-if-true/run-if-false parameters.
--- doc/autoconf.texi.orig 2009-10-04 14:12:10.000000000 +0200
+++ doc/autoconf.texi 2009-10-04 14:11:44.000000000 +0200
@@ -24280,6 +24280,13 @@
verbosely (@pxref{Debugging via autom4te}).
@item
+Sometimes @command{autoconf} succeeds but the generated
address@hidden script has invalid shell syntax. You can detect this
+case by running @samp{bash -x -n configure} or @samp{sh -x -n configure}.
+If this command fails, the same tips apply, as if @command{autoconf} had
+failed.
+
address@hidden
Debugging @command{configure} script execution may be done by sprinkling
pairs of @code{set -x} and @code{set +x} into the shell script before
and after the region that contains a bug. Running the whole script with
@@ -24338,8 +24345,8 @@
@item
by not requiring users of your macro to use the cache variables.
-Instead, expose the result of the test via @var{run-if-true} and
address@hidden parameters.
+Instead, expose the result of the test via documented shell variables or
+via @var{run-if-true} and @var{run-if-false} parameters.
@end itemize
- Re: [PATCH 2/5] New FAQ node: Debugging.,
Bruno Haible <=