summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Schermer <nick@xfce.org>2011-07-03 19:42:38 +0200
committerNick Schermer <nick@xfce.org>2011-07-03 19:42:38 +0200
commitf2eb2c2e9ca7d042eb35fa56f392df4dbaf9924c (patch)
treef76d08847fbcc23ad203360ebad117921a629ccb
parent874bfb8234ab1d3af08dea0ce4aa037cbddf996f (diff)
downloadxfce4-dev-tools-f2eb2c2e9ca7d042eb35fa56f392df4dbaf9924c.tar.gz
Use pkg-config macro for detection (bug #7787).
Use the macro shipped with pkg-config for detection of $PKG_CONFIG. This to fix cross-build compatibility.
-rw-r--r--m4macros/xdt-depends.m442
1 files changed, 18 insertions, 24 deletions
diff --git a/m4macros/xdt-depends.m4 b/m4macros/xdt-depends.m4
index ccf5a44..e5f6b8c 100644
--- a/m4macros/xdt-depends.m4
+++ b/m4macros/xdt-depends.m4
@@ -43,11 +43,23 @@ AC_DEFUN([XDT_PROG_PKG_CONFIG],
# minimum supported version of pkg-config
xdt_cv_PKG_CONFIG_MIN_VERSION=0.9.0
- # lookup pkg-config utility
- if test x"$PKG_CONFIG" = x""; then
- AC_PATH_PROG([PKG_CONFIG], [pkg-config], [no])
-
- if test x"$PKG_CONFIG" = x"no"; then
+ m4_ifdef([PKG_PROG_PKG_CONFIG],
+ [
+ PKG_PROG_PKG_CONFIG([$xdt_cv_PKG_CONFIG_MIN_VERSION])
+
+ if test x"$PKG_CONFIG" = x""; then
+ echo
+ echo "*** Your version of pkg-config is too old. You need atleast"
+ echo "*** pkg-config $xdt_cv_PKG_CONFIG_MIN_VERSION or newer. You can download pkg-config"
+ echo "*** from the freedesktop.org software repository at"
+ echo "***"
+ echo "*** http://www.freedesktop.org/software/pkgconfig"
+ echo "***"
+ exit 1;
+ fi
+ ],
+ [
+ echo
echo "*** The pkg-config utility could not be found on your system."
echo "*** Make sure it is in your path, or set the PKG_CONFIG"
echo "*** environment variable to the full path to pkg-config."
@@ -57,25 +69,7 @@ AC_DEFUN([XDT_PROG_PKG_CONFIG],
echo "*** http://www.freedesktop.org/software/pkgconfig"
echo "***"
exit 1
- fi
-
- # check pkg-config version
- AC_MSG_CHECKING([for pkg-config >= $xdt_cv_PKG_CONFIG_MIN_VERSION])
- if $PKG_CONFIG --atleast-pkgconfig-version $xdt_cv_PKG_CONFIG_MIN_VERSION; then
- xdt_cv_PKG_CONFIG_VERSION=`$PKG_CONFIG --version`
- AC_MSG_RESULT([$xdt_cv_PKG_CONFIG_VERSION])
- else
- xdt_cv_PKG_CONFIG_VERSION=`$PKG_CONFIG --version`
- AC_MSG_RESULT([$xdt_cv_PKG_CONFIG_VERSION])
- echo "*** Your version of pkg-config is too old. You need atleast"
- echo "*** pkg-config $xdt_cv_PKG_CONFIG_MIN_VERSION or newer. You can download pkg-config "
- echo "*** from the freedesktop.org software repository at"
- echo "***"
- echo "*** http://www.freedesktop.org/software/pkgconfig"
- echo "***"
- exit 1
- fi
- fi
+ ])
])