diff options
author | Dan Nicholson <dbn.lists@gmail.com> | 2013-01-17 05:30:58 -0800 |
---|---|---|
committer | Dan Nicholson <dbn.lists@gmail.com> | 2013-01-17 05:39:00 -0800 |
commit | 7867cbd79cfe706b990bcc0e4c6846007be76e8a (patch) | |
tree | 840bb41d10f51fc67b45c04acc03864da9b5d65c | |
parent | ae2fef2c05bd7e875b4a84e584a183b027f53356 (diff) | |
download | pkg-config-7867cbd79cfe706b990bcc0e4c6846007be76e8a.tar.gz |
Use the standard pkg-config macros to check for glib
By using our PKG_CHECK_MODULES from our in-tree pkg.m4, the check for
glib will be done the same way pkg-config is used everywhere else. This
includes the usage of AC_PATH_TOOL in PKG_PROG_PKG_CONFIG, which will
check for $host-pkg-config when --host is set during configure.
Freedesktop #59435 (https://bugs.freedesktop.org/show_bug.cgi?id=59435)
-rw-r--r-- | configure.ac | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/configure.ac b/configure.ac index c8786b4..5499626 100644 --- a/configure.ac +++ b/configure.ac @@ -153,7 +153,10 @@ dnl dnl Find glib or use internal copy. Required version is 2.16 for dnl g_win32_get_package_installation_directory_of_module(). dnl -m4_define([glib_module], ["glib-2.0 >= 2.16"]) +dnl Pull in pkg-config macros to find external glib. +dnl +m4_include([pkg.m4]) +m4_define([glib_module], [glib-2.0 >= 2.16]) AC_ARG_WITH([internal-glib], [AS_HELP_STRING([--with-internal-glib], [use internal glib])], [with_internal_glib="$withval"], @@ -168,18 +171,11 @@ if test "x$with_internal_glib" = xyes; then AC_CONFIG_SUBDIRS([glib]) else AC_MSG_RESULT([no]) - if test "x$GLIB_CFLAGS" = "x" && test "x$GLIB_LIBS" = "x"; then - AC_CHECK_PROGS([PKG_CONFIG], [pkg-config], []) - if test -n $PKG_CONFIG && $PKG_CONFIG --exists glib_module; then - GLIB_CFLAGS=`$PKG_CONFIG --cflags glib_module` - GLIB_LIBS=`$PKG_CONFIG --libs glib_module` - else - AC_MSG_ERROR(m4_normalize([pkg-config and ]glib_module[ not found, - please set GLIB_CFLAGS and GLIB_LIBS to - the correct values or pass - --with-internal-glib to configure])) - fi - fi + PKG_CHECK_MODULES([GLIB], glib_module, [], [AC_MSG_ERROR([]dnl +[m4_normalize([Either a previously installed pkg-config or "]glib_module[" + could not be found. Please set GLIB_CFLAGS and GLIB_LIBS to + the correct values or pass --with-internal-glib to configure + to use the bundled copy.])])]) fi AC_SUBST(GLIB_LIBS) AC_SUBST(GLIB_CFLAGS) |