Please help wordsmith NEWS entry warning about AC_REQUIRE inside shell conditional

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

 



I've been going through the outstanding Savannah bugs in preparation
for a 2.70 beta.  I've found a situation where 2.70 may break existing
configure scripts, that we can't address in our code, and is worth
warning people about in the NEWS, but I'm having trouble with the
wording.

The problem in a nutshell is that if a configure script has

    if test some condition; then
        AC_PROG_FOO
    fi

where AC_PROG_FOO internally contains calls to AC_REQUIRE, and this is
the first mention of the AC_REQUIREd macros in this script, then they
will be emitted inside the shell conditional, breaking any code below
this point that also needs those macros to have been invoked.  The
manual already warns people about this, but not clearly or
prominently.

2.70 changes which macros internally call AC_REQUIRE and for what, so
code that worked with 2.69 may break.

What I put into the NEWS file as of d5cb54d0 reads

** Several macros that are commonly used early in a configure
   script, such as AC_PROG_CC, have been optimized and no longer
   invoke as many subroutine macros as they used to.  This can expose
   several classes of bugs: these are the ones we know about:

   [...]

   - Autoconf macros that use AC_REQUIRE internally, are not safe to
     use inside of hand-written shell conditional or looping
     constructs.  Use AS_IF, AS_CASE, AS_FOR, etc. instead.
     (See the “Prerequisite Macros” section of the manual for
     further explanation.)

     The set of macros that use AC_REQUIRE internally may change from
     release to release.  The only macros that are guaranteed *not* to
     use AC_REQUIRE are the macros for acting on the results of a
     test: AC_DEFINE, AC_SUBST, AC_MSG_*, AC_CACHE_CHECK, etc.

I'd appreciate any suggestions you may have for improving the wording,
particularly of the last paragraph.

zw





[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux