[Top][All Lists]

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

Re: How to test if a autoconf macro exists?

From: Eric Blake
Subject: Re: How to test if a autoconf macro exists?
Date: Mon, 04 Feb 2008 06:13:50 -0700
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20071031 Thunderbird/ Mnenhy/

Hash: SHA1

According to Bernd Jendrissek on 2/4/2008 4:51 AM:
|> I am using the macro  AM_PATH_XML2(2.5.0) in my which works

Please get in the habit of using proper quoting.  That should be:


|> I think I can try the following workarounds:
|> a) Copy the contents of AM_PATH_XML2 to my acinclude.m4 and redistribute it
| aclocal does that for the users of your tarball.  That's why you as
| the package maintainer need to have AM_PATH_XML2 installed where
| aclocal can find it.  As long as you don't ask your users to run
| aclocal, they won't have to have the macro installed as the
| distributed aclocal.m4 will already contain it.

This point is valid.

|> if EXISTS_MACRO( [AM_PATH_XML2] ) ; then
|> Does anything like this exists yet?

Fix your quoting again - the trailing space in your usage would be
interpreted literally, and I doubt you will find the macro
'AM_PATH_XML2 ' defined on any machine.  But yes:

m4_ifdef([AM_PATH_XML2], [code if defined], [code if undefined])

is valid in autoconf.  I would recommend the m4sugar spelling (m4_ifdef)
rather than the raw M4 spelling (ifdef), since future releases of autoconf
might disable raw spellings to be namespace clean.

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

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


reply via email to

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