autoconf
[Top][All Lists]
Advanced

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

Re: Problem Autoconf2.59 vs 2.65


From: Eric Blake
Subject: Re: Problem Autoconf2.59 vs 2.65
Date: Thu, 17 Jun 2010 09:57:31 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100430 Fedora/3.0.4-3.fc13 Lightning/1.0b2pre Mnenhy/0.8.2 Thunderbird/3.0.4

On 06/17/2010 04:01 AM, pellegrini wrote:
> Here is the contents of the macro:
> 
> AC_DEFUN([AX_CHECK_HEADER],[
>    header=m4_toupper(AS_TR_SH($1))

Rather than doing the translation at shell time,

>    eval HAVE_${header}="no"

and using lots of eval statements, why not just do the translation at m4
time?

>    for dir in $2; do
>        AC_CHECK_HEADER($dir/$1, [got="yes"], [got="no"])
>        if test "${got}" = "yes"; then
>            eval HAVE_${header}=$dir
>            break
>        else
>            eval HAVE_${header}="no"

And why is this line here, given that you already pre-initialized the
variable before the for loop?

>        fi
>    done
>    AC_SUBST(HAVE_${header})
> ])

How about something like this (untested)?

AC_DEFUN([AX_CHECK_HEADER], [
  HAVE_[]m4_toupper(AS_TR_SH([$1]))=no
  for dir in $2 do
    AC_CHECK_HEADER([$dir/$1], [got=yes], [got=no])
    if test "$got" = yes; then
      HAVE_[]m4_toupper(AS_TR_SH([$1]))=$dir
      break
    fi
  done
  AC_SUBST([HAVE_]m4_toupper(AS_TR_SH([$1])))
])

-- 
Eric Blake   address@hidden    +1-801-349-2682
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]