autoconf
[Top][All Lists]
Advanced

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

Re: debugging autoconf tests (was: gl_CACHE_VAL_SILENT)


From: Bruno Haible
Subject: Re: debugging autoconf tests (was: gl_CACHE_VAL_SILENT)
Date: Sat, 14 Mar 2020 03:49:21 +0100
User-agent: KMail/5.1.3 (Linux/4.4.0-174-generic; KDE/5.18.0; x86_64; ; )

Hi Zack,

> Yeah, most of the time
> that text is just going to scroll by unread, but when something goes
> wrong, the poor schmuck who has to debug it wants to know that it was
> the test for `ceil` (for instance) that hung the build, not the
> unrelated thing that happens to have been tested right before that.

Hanging autoconf tests are rare. And even in that case, looking at
the configure output does not help much, because it won't tell you
whether the compiler is taking hours or whether the test program hangs.
In practice, when something hangs, "ps aux" or "pstree -p" (when available)
is a better starting point for debugging.

In the much more frequent case that an autoconf test produces an unexpected
result, the most efficient debugging technique is:
  1. look at the S[...] and D[...] lines in config.status. This will tell
     you whether the problem is on the configure.ac + *.m4 side or on the
     Makefile.{am,in} side.
  2. If it is on the configure.ac + *.m4 side, rerun the configuration with
     option '-C'. Then look at the config.cache. This will tell you whether
     the problem is inside or outside AC_CACHE_VAL/AC_CACHE_CHECK calls.
  3. If it is inside AC_CACHE_VAL/AC_CACHE_CHECK calls, then look at the
     config.log. This will show you the test programs, the compiler options
     with which they are compiled, and the test programs' exit code.

In this case as well, the configure output is hardly useful.

The only real uses of the configure output, for me who is maintaining hundreds
of autoconf macros in gnulib, are:
  - Compare the configuration results between different platforms (e.g.
    linux-mipseb and linux-mipsel).
  - Look for spurious error messages such as
      test: =: unary operator expected
    that indicate broken shell code.

The other use of this output is, of course, to let the non-expert user
keep patient.

Due to all this, executing a test silently is not as problematic as
you think.

Bruno




reply via email to

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