[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: problem with ifelse
From: |
Eric Blake |
Subject: |
Re: problem with ifelse |
Date: |
Fri, 06 Mar 2009 06:54:24 -0700 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.19) Gecko/20081209 Thunderbird/2.0.0.19 Mnenhy/0.7.6.666 |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
According to Vincent Torri on 3/5/2009 11:15 PM:
>
> autoconf -t ECORE_CHECK_MODULE
>
> Is it the good option ?
That will indeed trace the arguments that ECORE_CHECK_MODULE was called
with (although in this case, it seems like you wanted the expansion that
occurs after that call has completed).
>
>> Could you post a snippet
>> where you are actually invoking ECORE_CHECK_MODULE, to make sure there
>> aren't any obvious typos in how you called it?
>
> Here is an example of use:
>
> want_ecore_win32="no"
> ECORE_CHECK_MODULE([Win32], [${want_ecore_win32}], [yes],
> [ecore_win32_libs="-lole32 -lgdi32"])
Bingo. You are attempting to mix a shell variable ${want_ecore_win32}
(expanded at ./configure time) with an m4 argument $2 (expanded at
autoconf time). That won't work. You have to make a decision - either
the code is statically determined at autoconf time (in other words, you
pass a literal "yes" or "no" as the second argument), or you have to emit
both option choices and emit a shell conditional (AS_IF or even
if...then...fi) to choose the right code path at configure time. The
reason your code is always selecting the false path is becase
"${want_ecore_win32}" is not identical to "no" during m4 expansion at
autoconf time, and m4 has no way to predict what value that shell variable
will later have at configure time.
- --
Don't work too hard, make some time for fun as well!
Eric Blake address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAkmxKxAACgkQ84KuGfSFAYDVhgCfWXTE1W9MJ4yEsFuI+UPpoYjU
aCkAnR+iamarcXaAoi0UGDo31vIaihHr
=HGCC
-----END PGP SIGNATURE-----
Re: problem with ifelse, Vincent Torri, 2009/03/05