automake
[Top][All Lists]
Advanced

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

How to test if a autoconf macro exists?


From: Santiago Capel Torres
Subject: How to test if a autoconf macro exists?
Date: Mon, 04 Feb 2008 11:35:59 +0100
User-agent: Thunderbird 2.0.0.6 (X11/20070914)

I am using the macro AM_PATH_XML2(2.5.0) in my configure.ac which works fine provided the libxml2-devel package is installed. But when this package is not installed, I get errors:

aclocal
configure.in:62: warning: macro `AM_PATH_XML2' not found in library
autoheader
automake
autoconf
configure.in:62: error: possibly undefined macro: AM_PATH_XML2
    If this token and others are legitimate, please use m4_pattern_allow.
    See the Autoconf documentation.

So, it looks like I can not use AM_PATH_XML2 before installing libxml2-devel, so I can not test if it is installed :(

I think I can try the following workarounds:
a) Copy the contents of AM_PATH_XML2 to my acinclude.m4 and redistribute it
b) Create a customized test that checks if AM_PATH_XML2 is installed

But I don't like any of them. I would prefer to have something in autoconf like

if EXISTS_MACRO( [AM_PATH_XML2] ) ; then

Does anything like this exists yet?

Thanks a lot
-- santilin




reply via email to

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