chiark / gitweb /
build-sys: better test for pkg-config/pkg.m4
authorTollef Fog Heen <tfheen@err.no>
Fri, 30 Apr 2010 15:44:43 +0000 (17:44 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 6 May 2010 19:42:46 +0000 (21:42 +0200)
In some cases, people will run autoreconf rather than bootstrap.sh, or
they will uninstall pkg-config.  This is now detected properly rather
than relying on bootstrap.sh checking for us.

bootstrap.sh
configure.ac

index 73243ed4405a0f14069d55727111484c6bdf07aa..cb87bf782c4bf3b01489e852bc36d94af85b5625 100755 (executable)
@@ -48,15 +48,6 @@ if [ -f .git/hooks/pre-commit.sample -a ! -f .git/hooks/pre-commit ] ; then
     echo "Activated pre-commit hook."
 fi
 
-# We check for this here, because if pkg-config is not found in the
-# system, it's likely that the pkg.m4 macro file is also not present,
-# which will make PKG_PROG_PKG_CONFIG be undefined and the generated
-# configure file faulty.
-if ! pkg-config --version &>/dev/null; then
-    echo "pkg-config is required to bootstrap this program" &>/dev/null
-    exit 1
-fi
-
 if type -p colorgcc > /dev/null ; then
    export CC=colorgcc
 fi
index f4e10367e01425f683075b0687a538c00576d3ce..7d73ed27b2e1157fed220e6a66f6ed60b3543752 100644 (file)
@@ -49,6 +49,8 @@ AC_SEARCH_LIBS([clock_gettime], [rt], [], [AC_MSG_ERROR([*** POSIX RT library no
 AC_SEARCH_LIBS([cap_init], [cap], [], [AC_MSG_ERROR([*** POSIX caps library not found])])
 AC_CHECK_HEADERS([sys/capability.h], [], [AC_MSG_ERROR([*** POSIX caps headers not found])])
 
+# This makes sure pkg.m4 is available.
+m4_pattern_forbid([^_?PKG_[A-Z_]+$],[pkg.m4 missing, please install pkg-config])
 PKG_CHECK_MODULES(UDEV, [ libudev ])
 AC_SUBST(UDEV_CFLAGS)
 AC_SUBST(UDEV_LIBS)