From fef2fa224a754df3f9792d1ddcd3a6d9a73658b1 Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Mon, 8 Aug 2016 15:38:35 +0200 Subject: configure: check for pkg-config presence On a fresh installation, I was puzzled by a configure.ac 'syntax error' for PKG_CHECK_MODULES(TALLOC). It took me some time to figure out that merely pkg-config was missing. Add a check for pkg-config, which isn't as straightforward as I would wish, so comment generously. Change-Id: I2e7cdc37eb59f9947a45fbc5baddbaf71b655bc0 --- configure.ac | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 33c9b5c2..1b62278f 100644 --- a/configure.ac +++ b/configure.ac @@ -17,6 +17,21 @@ LT_INIT([pic-only disable-static]) AC_CONFIG_MACRO_DIR([m4]) +dnl check for pkg-config +dnl * If pkg-config is missing, we get a "syntax error" for PKG_CHECK_MODULES. +dnl Instead, we want to say that pkg-config and pkg.m4 are missing. +dnl * The proper way is PKG_PROG_PKG_CONFIG() but unfortunately that does not +dnl produce an intelligible error message if pkg-config is missing entirely +dnl ("syntax error near unexpected token `0.20'"). +dnl * To produce a hint that pkg-config is missing, check for the pkg-config +dnl binary; but AC_PATH_PROG breaks if the distribution provides only +dnl prefixed (-pkg-config) versions, so just print a warning. +AC_PATH_PROG(PKG_CONFIG_INSTALLED, pkg-config, no) +if test "x$PKG_CONFIG_INSTALLED" = "xno"; then + AC_MSG_WARN([You need to install pkg-config]) +fi +PKG_PROG_PKG_CONFIG([0.20]) + dnl check os: some linker flags not available on osx case $host in *-darwin*) -- cgit v1.2.3