[PATCH weston] configure.ac: honour the wayland-scanner.pc

Emil Velikov emil.l.velikov at gmail.com
Sat Feb 14 10:04:33 PST 2015


On 13 February 2015 at 18:58, Bill Spitzak <spitzak at gmail.com> wrote:
>
>
> On 02/10/2015 06:42 AM, Emil Velikov wrote:
>>
>> Currently we use the wayland-scanner executable as found with
>> AC_PATH_PROG, and after that check the presence of wayland-scanner.pc
>>
>> Even if the latter is pointing to another wayland-scanner we silently
>> ignore it. Rework things to check for the relevant variable in the *.pc
>> file first, and then fall back to checking via AC_PATH_PROG.
>>
>> XXX: Should we just drop the AC_PATH_PROG check altogether ?
>>
>> Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
>> ---
>>   configure.ac | 10 ++++++++--
>>   1 file changed, 8 insertions(+), 2 deletions(-)
>>
>> diff --git a/configure.ac b/configure.ac
>> index 1db9f79..ee08cfc 100644
>> --- a/configure.ac
>> +++ b/configure.ac
>> @@ -501,9 +501,15 @@ if test "x$have_lcms" = xyes; then
>>   fi
>>   AM_CONDITIONAL(HAVE_LCMS, [test "x$have_lcms" = xyes])
>>
>> -AC_PATH_PROG([wayland_scanner], [wayland-scanner])
>> +PKG_CHECK_MODULES(WAYLAND_SCANNER, [wayland-scanner],
>> +       wayland-scanner=`$PKG_CONFIG --variable=wayland-scanner
>> wayland-scanner,
>> +       wayland-scanner='')
>> +
>>   if test x$wayland_scanner = x; then
>> -       AC_MSG_ERROR([wayland-scanner is needed to compile weston])
>> +       AC_PATH_PROG([wayland_scanner], [wayland-scanner])
>> +       if test x$wayland_scanner = x; then
>> +               AC_MSG_ERROR([wayland-scanner is needed to compile
>> weston])
>> +       fi
>>   fi
>
>
> I would prefer using the else clase of PKG_CHECK_MODULES rather than this
> strange x$foo==x stuff.
>
I'm curious about the functionality change - without this patch
configure will error out if the wayland-scanner package is not found,
but with it we add the fall-back to AC_PATH_PROG. Is this ok with you
guys ? Will send out v2 addressing all the comments shortly.

>>   PKG_CHECK_MODULES(WAYLAND_SCANNER, wayland-scanner)
>
>
> Looks like you left a redundant PKG_CHECK_MODULES there at the end, or you
> should merge whatever it does into your existing one.
Went to terminal to commit the change before actually saving the file.
It tends to happen to me a bit too often :-\

Cheers,
Emil


More information about the wayland-devel mailing list