[PATCH v2] configure.ac: Change in build system to use the path from pkg-config for wayland-scanner.
Pekka Paalanen
ppaalanen at gmail.com
Thu May 15 23:13:26 PDT 2014
On Thu, 15 May 2014 14:23:20 +0100
Neil Roberts <neil at linux.intel.com> wrote:
> Hi,
>
> Srivardhan Hebbar <sri.hebbar at samsung.com> writes:
>
> > +AC_PATH_PROG([wayland_scanner], [wayland-scanner],,
> > + [${WAYLAND_SCANNER_PATH}])
>
> I don't think it makes much sense to search the path for wayland-scanner
> when pkg-config already gives you the complete filename. Instead of
> trying to derive a directory to search we could just use the filename
> directly and check whether it is executable. Then instead of AC_PATH_PROG it
> could do something like this:
>
> AC_MSG_CHECKING([for wayland-scanner])
> AS_IF([AS_EXECUTABLE_P([${wayland_scanner}])],
> [AC_MSG_RESULT([${wayland_scanner}])
> AC_SUBST(wayland_scanner)],
> [AC_MSG_RESULT([not found])
> AC_MSG_ERROR([wayland-scanner was not found])])
>
> The --wayland-scanner-path option could also be replaced with something
> that would just take the whole filename too.
Yeah, I agree.
Is it ok to use AC_SUBST inside a conditional? Should not be needed
anyway, if one goes with something like:
# implies AC_SUBST
AC_ARG_VAR(WAYLAND_SCANNER, [bla bla use AC_HELP_STRING?])
if WAYLAND_SCANNER empty
get it from pkg-config or fail (PKG_CHECK_VAR?)
fi
test for executable WAYLAND_SCANNER like Neil suggested
Note, that the name WAYLAND_SCANNER here conflicts with
PKG_CHECK_MODULES(WAYLAND_SCANNER, wayland-scanner)
but since user settable variables are usually all-caps (right?),
WAYLAND_SCANNER seems like the right name. The PKG_CHECK_MODULES
result is actually unused, it only makes sure the .pc file is there. So
we could also drop the PKG_CHECK_MODULES line if "get it from
pkg-config" fails appropriately if the .pc file is not there. That
would clean up the './configure --help' output a bit too, by removing
WAYLAND_SCANNER_CFLAGS
C compiler flags for WAYLAND_SCANNER, overriding pkg-config
WAYLAND_SCANNER_LIBS
linker flags for WAYLAND_SCANNER, overriding pkg-config
which are totally useless anyway.
Thanks,
pq
More information about the wayland-devel
mailing list