autoconf
[Top][All Lists]
Advanced

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

Re: Checking default headers


From: Ross Lagerwall
Subject: Re: Checking default headers
Date: Sat, 7 Sep 2013 08:20:56 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

On Fri, Sep 06, 2013 at 10:42:00PM -0400, Zack Weinberg wrote:
> On Tue, Sep 3, 2013 at 1:42 PM, Ross Lagerwall <address@hidden> wrote:
> >> Probably means that AC_TYPE_UINT32_T is missing a prereq on the standard
> >> headers; would you mind posting a reproducible test case, and we can
> >> work on fixing the bug?
> >
> > The following reproduces it:
> > """
> > AC_INIT([test], [dev])
> > AC_PROG_CC
> >
> > if false; then
> >     AC_CHECK_HEADERS([pthread.h], [], [have_pthreads=no])
> > fi
> >
> > AC_TYPE_UINT16_T
> > AC_OUTPUT
> > """
> 
> It looks like AC_TYPE_INT<n>_T are correct.  The problem is that if
> the very first AC_CHECK_HEADER[S] in the file is inside a shell
> conditional, _AC_INCLUDES_DEFAULT_REQUIREMENTS gets expanded inside
> the conditional, and so only executes if the shell conditional is
> true.  This is (one of) the problems AS_IF addresses:
> 
>     AC_INIT([test], [dev])
>     AC_PROG_CC
>     AS_IF([false], [AC_CHECK_HEADERS([pthread.h])])
>     AC_TYPE_UINT16_T
>     AC_OUTPUT
> 
> does the right thing (because the conditional is now visible on the M4
> expansion stack, so _AC_INCLUDES_DEFAULT_REQUIREMENTS gets placed just
> before it instead of inside it).
> 
> I don't think there's anything we can reasonably do in Autoconf to
> make this less troublesome.
> 

Thanks for the explanation.  Noting down AS_IF for the future...

-- 
Ross Lagerwall



reply via email to

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