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

Bill Spitzak spitzak at gmail.com
Thu Feb 5 10:47:38 PST 2015


I was pretty much giving up on this and trying to add instructions on 
how to build expat from scratch to the build instructions.

I was just restoring text that was there before, but unfortunatly that 
old version was apparently not proper autoconf. I did not want to debug 
autoconf either.

On 02/04/2015 10:57 PM, Bryce Harrington wrote:
> On Tue, Feb 03, 2015 at 02:26:58PM -0800, Bill Spitzak wrote:
>> This paritally reverts commit a4afd90f9f0c27ed5f3f313b915c260673f8be34.
>>
>> On older expat versions (ie the one on Ubuntu 12.04) there is no pkg-config
>> file, so fall back to a test for the header and library. In addition the
>> source for expat does not seem to be in a git repository but in cvs instead
>> and it seems preferrable to not require cvs to build wayland.
>>
>> The restored test has been updated to use AC_SEARCH_LIBS. This version
>> uses empty square brackets for the unused branches, similar to many other
>> if statements in configure.ac.
>> ---
>>   configure.ac |   11 ++++++++++-
>>   1 file changed, 10 insertions(+), 1 deletion(-)
>>
>> diff --git a/configure.ac b/configure.ac
>> index 0426b53..5a8e915 100644
>> --- a/configure.ac
>> +++ b/configure.ac
>> @@ -85,7 +85,16 @@ AC_ARG_WITH(icondir, [  --with-icondir=<dir>    Look for cursor icons here],
>>   AC_SUBST([ICONDIR])
>>
>>   if test "x$enable_scanner" = "xyes"; then
>> -	PKG_CHECK_MODULES(EXPAT, [expat])
>> +	PKG_CHECK_MODULES(EXPAT, [expat], [],
>> +		[AC_CHECK_HEADERS(expat.h, [],
>> +			[AC_MSG_ERROR([Can't find expat.h. Please install expat.])])
>> +		 SAVE_LIBS="$LIBS"
>> +		 AC_SEARCH_LIBS(XML_ParserCreate, expat, [],
>> +			[AC_MSG_ERROR([Can't find expat library. Please install expat.])])
>> +		 EXPAT_LIBS="$LIBS"
>> +		 LIBS="$SAVE_LIBS"
>> +		 AC_SUBST(EXPAT_LIBS)
>> +		])
>>   fi
>
> Okay, I think I follow all the logic but am not an autoconf guru by a
> long shot, so I'd love to see a second RB from peter, jon, or someone
> else comfortable with autoconf before this is landed.
>
> Reviewed-by: Bryce Harrington <bryce at osg.samsung.com>
>
>>   AC_PATH_PROG(XSLTPROC, xsltproc)
>> --
>> 1.7.9.5
>>
>> _______________________________________________
>> wayland-devel mailing list
>> wayland-devel at lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/wayland-devel


More information about the wayland-devel mailing list