summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorLRN <lrn1986@gmail.com>2012-05-18 08:40:38 -0700
committerDan Nicholson <dbn.lists@gmail.com>2012-05-21 21:08:49 -0700
commit7ac6f32625254a14180677694a0a98d333fc5813 (patch)
tree82ecf16d51173b58c2944dcfa3efc0e240503595 /configure.ac
parentb87359cc9b9039b30ab0f76b67fad52980b7913a (diff)
downloadpkg-config-7ac6f32625254a14180677694a0a98d333fc5813.tar.gz
Don't use deprecated glib function to construct path on win32
g_win32_get_package_installation_subdirectory() has been deprecated since GLib 2.18 and in recent (2.31) GLib versions disabled entirely by default. This patch replaces usage of that function by g_win32_get_package_installation_directory_of_module() and g_build_filename(). Use the new functions and rework the code a bit so it leaks less memory. g_win32_get_package_installation_directory_of_module() is supported since GLib 2.16. The minimal GLib version is bumped accordingly. Freedesktop #45742
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac19
1 files changed, 12 insertions, 7 deletions
diff --git a/configure.ac b/configure.ac
index 763c7d1..2c936d4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -123,6 +123,11 @@ esac
AC_MSG_RESULT([$native_win32])
AM_CONDITIONAL(NATIVE_WIN32, [test "x$native_win32" = xyes])
+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"])
AC_ARG_WITH([internal-glib],
[AS_HELP_STRING([--with-internal-glib], [use internal glib])],
[with_internal_glib="$withval"],
@@ -136,14 +141,14 @@ if test "x$with_internal_glib" = xyes; then
else
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-2.0; then
- GLIB_CFLAGS=`$PKG_CONFIG --cflags glib-2.0`
- GLIB_LIBS=`$PKG_CONFIG --libs glib-2.0`
+ 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-2.0 not found, please set
- GLIB_CFLAGS and GLIB_LIBS to the correct
- values or pass --with-internal-glib to
- configure]))
+ 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
fi