aboutsummaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2016-08-08 15:38:35 +0200
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2016-08-09 14:35:27 +0000
commitfef2fa224a754df3f9792d1ddcd3a6d9a73658b1 (patch)
treec2422c3728219ee88c88ae546ab7c8486fe7ae9d /configure.ac
parentd1dcda01f8c99e02a206c95d177aecd3dfb66e09 (diff)
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
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac15
1 files changed, 15 insertions, 0 deletions
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 (<arch>-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*)