[Top][All Lists]

[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: Thu, 05 Mar 2009 22:17:22 -0700
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20081209 Thunderbird/ Mnenhy/

Hash: SHA1

According to Vincent Torri on 3/5/2009 8:33 AM:
> Hey,
> thanks for all the typo. Unfortunately, we want to support old versions
> of the autotools, so i will have to check that the m4 macro are not too
> recent.

Most of the m4sugar macros I referred to are quite old.  The nice thing
about git development is that it is easy to find when something was
introduced.  For example, m4_toupper was only mentioned in two commit

$ git log --pretty=oneline --abbrev-commit  --grep=m4_toupper
lib/m4sugar/m4sugar.m4 | cat
987a333... Another round of regex avoidance.
b60b89e... * m4sugar.m4: (m4_tolower, m4_toupper): New macros. *
acgeneral.m4 (AC_PREFIX_PROGRAM): Use m4_toupper(). * aclang.m4
(AC_F77_FUNC): Use m4_toupper()/m4_tolower().

Then you can determine which versions those correspond to:

$ git describe --tags b60b89e
$ git describe --tags --contains b60b89e

So m4_toupper has been around 531 commits before autoconf 2.50.

> For me, ifelse([$2], [no], [part1], [part2]) executes part1 if $2 is the
> same than the string "no", and executes part2 otherwise. But whatever
> the value of $2 is (in my cases, $2 is "yes" or "no", it is always part2
> that is executed.

Have you tried using the tracing utilities?  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?

> and what to do with m4_pushdef if i want to transform - to _. For example, I 
> use this:
> pushdef([UP], translit([$1], [-a-z], [_A-Z]))dnl
> pushdef([DOWN], translit([$1], [-A-Z], [_a-z]))dnl

[m4_]translit expands its result, so the safest approach is to
double-quote the first argument in preparation for the later expansion.  I
would write this as:

m4_pushdef([UP], m4_translit([[$1]], [-a-z], [_A-Z]))dnl

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at
Comment: Using GnuPG with Mozilla -


reply via email to

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