[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Suppressing warning AC_LANG_CONFTEST
From: |
Ralph Castain |
Subject: |
Re: Suppressing warning AC_LANG_CONFTEST |
Date: |
Tue, 12 Oct 2010 14:48:45 -0600 |
On Oct 12, 2010, at 2:44 PM, Eric Blake wrote:
> [please don't top-post on technical lists]
Different list, different etiquette :-)
>
> On 10/12/2010 02:34 PM, Ralph Castain wrote:
>> Sorry for delay - was out. Since the code is rather long, I have simply
>> attached it here.
>>
>> Appreciate your help!
>
> You're welcome!
Thanks again! I'll take it from here. This wasn't my configure code, but I'm
trying my best to clean it up. Much appreciate the help.
>
>>
>> AC_DEFUN([EVENT_CHECK_ATTRIBUTES], [
>> AC_LANG(C)
>> AC_MSG_CHECKING(for __attribute__)
>>
>> AC_CACHE_VAL(_cv___attribute__, [
>> AC_TRY_COMPILE(
>> [#include <stdlib.h>
>> /* Check for the longest available __attribute__ (since gcc-2.3) */
>> struct foo {
>> char a;
>> int x[2] __attribute__ ((__packed__));
>> };
>> ],
>
> Bingo. Just as the warning said, you are missing a call to AC_LANG_PROGRAM.
> Also, you have insufficient quoting - to get an array x[2], rather than a
> variable name x2, you need more [] quoting. You want to do:
>
>
> AC_TRY_COMPILE(
> [AC_LANG_PROGRAM([[
> #include <stdlib.h>
> /* Check ... */
> struct foo {
> char a;
> int x[2] __attribute__ ((__packed__));
> };
> ]])],
>
> and then on with the rest of your .m4 file.
>
>> [],
>> [_cv___attribute__=1],
>> [_cv___attribute__=0],
>
> Also, while you're at it, it might be nice to rename your cache variables to
> have a useful prefix, rather than being in the nameless prefix namespace.
>
>> )
>>
>> if test "$_cv___attribute__" = "1" ; then
>> AC_TRY_COMPILE(
>> [#include <stdlib.h>
>
> Rinse and repeat - another missing AC_LANG_PROGRAM.
>
>> AC_DEFINE_UNQUOTED(HAVE_ATTRIBUTE, [$_cv___attribute__],
>> [Whether your compiler has __attribute__ or not])
>
> Get in the habit of proper m4 quoting:
>
> AC_DEFINE_UNQUOTED([HAVE_ATTRIBUTE], [$_cv__attribute__], ...
>
>> AC_DEFUN([IF_IFELSE], [
>> AC_COMPILE_IFELSE([#if !( $1 )
>> #error "condition $1 not met"
>> choke me
>> #endif], [$2], [$3])])
>
> Another case of missing AC_LANG_PROGRAM.
>
>> [AC_TRY_LINK([
>> #include <stdio.h>
>
> And another.
>
>> AC_CACHE_CHECK([if $CC supports -xldscope],
>> [_cv_cc_xldscope],
>> [AC_TRY_LINK([
>> #include <stdio.h>
>
> And another.
>
> I think you can go from here on fixing this.
>
> --
> Eric Blake address@hidden +1-801-349-2682
> Libvirt virtualization library http://libvirt.org