From 60f618409fb5ad539761598110c109008c8321fa Mon Sep 17 00:00:00 2001 From: Dwayne Litzenberger Date: Sun, 4 Aug 2013 15:17:05 -0700 Subject: [PATCH] wayland-scanner.m4: Warn when wayland-scanner.pc not found I got this mysterious build error when I tried to build Weston (from the git repo) for the first time: make[2]: *** No rule to make target `screenshooter-server-protocol.h', needed by `all'. Stop. The problem was that I had a typo in my $PKG_CONFIG_PATH, which caused the rules for generating %-server-protocol.h to be omitted from Weston's Makefile (since pkg-config couldn't the configure script where to look for wayland-scanner.m4). With this commit, we emit a warning from the configure script when wayland-scanner.pc can't be found, so that the above error (if it occurs) will seem less cryptic. --- wayland-scanner.m4 | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/wayland-scanner.m4 b/wayland-scanner.m4 index 2b87c5f..d1c3585 100644 --- a/wayland-scanner.m4 +++ b/wayland-scanner.m4 @@ -1,11 +1,20 @@ AC_DEFUN([WAYLAND_SCANNER_RULES], [ PKG_PROG_PKG_CONFIG - wayland_scanner=`$PKG_CONFIG --variable=wayland_scanner wayland-scanner` - AC_SUBST([wayland_scanner]) + dnl Check if pkg-config can find wayland-scanner.pc + dnl If not, display a warning but continue anyway, since wayland-scanner is + dnl not needed when building release tarballs. + AC_MSG_CHECKING([for WAYLAND_SCANNER]) + PKG_CHECK_EXISTS([wayland-scanner], + [AC_MSG_RESULT([yes]) + wayland_scanner=`$PKG_CONFIG --variable=wayland_scanner wayland-scanner` + wayland_scanner_rules=$wayland_scanner_datadir/wayland-scanner.mk], + [AC_MSG_RESULT([no]) + AC_MSG_WARN([wayland-scanner not found by pkg-config, *-protocol.[[ch]] will not be generated]) + wayland_scanner= + wayland_scanner_rules=]) - wayland_scanner_rules=`$PKG_CONFIG --variable=pkgdatadir wayland-scanner`/wayland-scanner.mk + AC_SUBST([wayland_scanner]) AC_SUBST_FILE([wayland_scanner_rules]) - AC_SUBST([wayland_protocoldir], [$1]) ]) -- 1.8.3.2