summaryrefslogtreecommitdiff
path: root/autogen.sh
diff options
context:
space:
mode:
authorBernd Zeimetz <bernd@bzed.de>2010-07-12 03:16:53 +0200
committerBernd Zeimetz <bernd@bzed.de>2010-07-12 03:19:57 +0200
commit5efded0d386a611a16339b0248a4c30f05c30af0 (patch)
tree07314ed9dd6f4bd3e7cfd852747d097b8cd42c12 /autogen.sh
parent2ec80ea502836e494944cf861da3e8870ae933b4 (diff)
downloadgpsd-5efded0d386a611a16339b0248a4c30f05c30af0.tar.gz
Add a check for pkg-config to autogen.sh
Diffstat (limited to 'autogen.sh')
-rwxr-xr-xautogen.sh34
1 files changed, 34 insertions, 0 deletions
diff --git a/autogen.sh b/autogen.sh
index b7a557c9..87c59449 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -68,6 +68,40 @@ if [ "$AC_ERROR" = "1" ]; then
tput sgr0
fi
+#Check for pkg-config
+if which pkg-config 1>/dev/null 2>&1; then
+ #pkg-config seems to be installed. Check for m4 macros:
+ tmpdir=`mktemp -d "./autogenXXXXXX"`
+ oldpwd=`pwd`
+ cd ${tmpdir}
+ cat > configure.ac << _EOF_
+AC_INIT
+PKG_CHECK_MODULES(QtNetwork, [QtNetwork >= 4.4], ac_qt="yes", ac_qt="no")
+_EOF_
+ aclocal
+ autoconf --force
+ grep -q PKG_CHECK_MODULES configure
+ PKG_MACRO_AVAILABLE=$?
+ cd ${oldpwd}
+ rm -rf ${tmpdir}
+ if [ ${PKG_MACRO_AVAILABLE} -eq 0 ]; then
+ echo -e '\E[31;m'
+ echo -n "pkg-config installed, but autoconf is not able to find pkg.m4. "
+ echo "Unfortunately the generated configure would not work, so we stop here."
+ echo
+ tput sgr0
+ exit 1
+ fi
+else
+ echo -e '\E[31;m'
+ echo -n "pkg-config not found. "
+ echo "pkg-config is required to create a working configure, so we stop here."
+ echo
+ tput sgr0
+ exit 1
+fi
+
+
# Check libtool version
if [ -z "$LIBTOOL" ] ; then
LIBTOOL="libtool"