bug-autoconf
[Top][All Lists]
Advanced

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

Re: AC_CHECK_ALIGNOF fails when cross-compiling with gcc >= 4.5


From: Eric Blake
Subject: Re: AC_CHECK_ALIGNOF fails when cross-compiling with gcc >= 4.5
Date: Thu, 26 Apr 2012 08:07:24 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120329 Thunderbird/11.0.1

On 04/26/2012 02:03 AM, Michael Olbrich wrote:
>> > 
>> > While AC_INCLUDES_DEFAULT is in $2 this put me on the right track.
>> > The problem ist that STDC_HEADERS is not defined.
>> > 

>> > 
>> > From what I can tell, the code needed to define STDC_HEADERS is generated
>> > for the first AC_CHECK_HEADER. In this case for zlib.h:
>> > http://git.gnome.org/browse/glib/tree/configure.ac#n466
>> > 
>> > However this is only executed for 'test "x$found_zlib" = "xno"', so
>> > STDC_HEADERS is never defined. If I put an unconditional AC_CHECK_HEADER
>> > before the zlib stuff, then STDC_HEADERS is defined and AC_CHECK_ALIGNOF
>> > works as expected.
> I've attached a minimalistic configure.ac that demonstrated the problem.
> That should be easier than the one from glib.
> 

> 
> AC_PREREQ([2.68])
> AC_INIT([foo],[1],address@hidden)
> AC_CONFIG_SRCDIR([configure.ac])
> 
> AC_PROG_CC
> 
> if false; then
>     AC_CHECK_HEADER(stdint.h)

Yep.  That's indeed a bug in your configure.ac, and nothing that
autoconf can do about it without your help.  One thing that is possible
to keep the actual header check conditional, but making all the
prerequisites (such as the side effect of setting STDC_HEADERS)
unconditional, would be to rewrite this as:

AS_IF([false], [AC_CHECK_HEADER([stdint.h])])

to rely on the documented property of AS_IF of hoisting prerequisites
outside the conditional.

-- 
Eric Blake   address@hidden    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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