[PATCH V2] configure.ac: Fallback to older detection code if pkg-config can't find expat

Bill Spitzak spitzak at gmail.com
Tue Feb 3 12:09:37 PST 2015


On 02/02/2015 10:46 PM, Peter Hutterer wrote:

> the usual process is (used to be?):
> SAVE_LIBS="$LIBS"
> AC_SEARCH_LIBS(....)
> EXPAT_LIBS="$LIBS"
> LIBS="$SAVE_LIBS"
>
> so you save the current state and restore it after it got mangled. we do
> that for the rdp compositro CPPFLAGS already for example.

Okay I'll try that.

>>> I would advice to use AM_SUBST_NOTMAKE(LIBS) and never rely on LIBS at
>>> all. But that could be left to another patch I guess.

I think that would break everything because of the many uses of $(LIBS)

>>> Do you rely on PKG_CHECK_MODULES to AC_SUBST?
>>
>> I have no idea. I'm trying not to change the behavior when PKG_CHECK_MODULES
>> works, just to alter the behavior when it does not work.

> PKG_CHECK_MODULES does this for you, it subst's the _LIBS and CFLAGS
> variables from the first parameter, i.e. EXPAT_LIBS and EXPAT_CFLAGS in this
> case. That's why you usually don't see the subst calls when pkgconfig is
> used. Not sure it does it when it can't find the package though, so in this
> case you'll have to call it manually to make sure it's invoked regardless of
> PKG_CHECK_MODULES' success.

Got it, yes it looks like I am relying on that happening even if the 
pkg-check fails. This actually makes sense since a failed package will 
want to set those variables blank, not leave them with the label text.


More information about the wayland-devel mailing list