automake
[Top][All Lists]
Advanced

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

Re: PKG_CHECK_MODULES on system without pkg-config installed?


From: Jef Driesen
Subject: Re: PKG_CHECK_MODULES on system without pkg-config installed?
Date: Thu, 10 Mar 2011 20:42:35 +0100
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.14) Gecko/20110223 Lightning/1.0b2 Thunderbird/3.1.8

On 10/03/11 17:14, Dave Hart wrote:
On Thu, Mar 10, 2011 at 1:53 PM, Jef Driesen<address@hidden>  wrote:
You don't have to convince me of the advantages of using pkg-config.
I want to use pkg-config for exactly the same reasons as you explain.
But when I tried to build my project on a system without pkg-config
installed it failed. Proceeding without the feature (that would be enabled
through the pkg-config checks) would be perfectly acceptable, except
that autoconf fails on the PKG_* macros and aborts. So I can't build
anything at all and that's the main problem.

I actually didn't use the PKG_ macros at all so I didn't run into this
problem -- configure.ac searches for pkg-config using AC_PATH_TOOL and
invokes it.

However, I like the idea of using PKG_* m4 macros instead, and I'm
disappointed to hear of your snag.  Do not despair, you can use the
macros on systems that have them (and not break on systems without) by
using m4_ifdef to conditionalize the use.  For example, this is how
ntp-dev enables Automake's silent rules generation without requiring
automake 1.11, which was the first release to provide AM_SILENT_RULES:

m4_ifdef(
     [AM_SILENT_RULES],
     [AM_SILENT_RULES([yes])]
)

I noticed there are projects (see for example [1]) that ship the pkg.m4 file, and then add this line in configure.ac:

AC_CONFIG_MACRO_DIR([m4])

and in the toplevel Makefile.am:

ACLOCAL_AMFLAGS = -I m4

I haven't tried this yet, but I assume it works. But I wonder what happens on a system that does have pkg-config installed. Does it use the system wide pkg.m4 file or the local one? If it's the local one, then the downside is that you have to keep this file up-to-data. But other than that it looks like the best option.

[1] 
http://mailman.videolan.org/pipermail/libbluray-devel/2011-February/000232.html



reply via email to

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