[gtksourceview] build: use AX_PKG_CHECK_MODULES
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtksourceview] build: use AX_PKG_CHECK_MODULES
- Date: Sun, 30 Aug 2015 12:52:32 +0000 (UTC)
commit 36713af3207fbd7379554d524d137b0bc299c4ed
Author: Sébastien Wilmet <swilmet gnome org>
Date: Sun Aug 30 14:07:05 2015 +0200
build: use AX_PKG_CHECK_MODULES
It simplifies the pkg-config file.
https://tecnocode.co.uk/2014/12/09/a-checklist-for-writing-pkg-config-files/
https://wiki.gnome.org/Initiatives/GnomeGoals/ModernAutotools
Makefile.am | 1 +
configure.ac | 22 ++++++++--------------
gtksourceview-3.0.pc.in | 4 ++--
3 files changed, 11 insertions(+), 16 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index fef1c27..bd09291 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -40,6 +40,7 @@ MAINTAINERCLEANFILES = \
m4/ax_compiler_flags_ldflags.m4 \
m4/ax_compiler_flags.m4 \
m4/ax_is_release.m4 \
+ m4/ax_pkg_check_modules.m4 \
m4/ax_require_defined.m4 \
m4/codeset.m4 \
m4/extern-inline.m4 \
diff --git a/configure.ac b/configure.ac
index 7f14bf0..d83dbd2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -37,13 +37,10 @@ GSV_LT_VERSION="$GSV_LT_CURRENT:$GSV_LT_REVISION:$GSV_LT_AGE"
AC_SUBST(GSV_LT_VERSION)
# Dependencies
-GLIB_REQUIRED_VERSION=2.44
-GTK_REQUIRED_VERSION=3.16
-LIBXML_REQUIRED_VERSION=2.6.0
-GLADE_UI_REQUIRED=3.9
-
-AC_SUBST(GTK_REQUIRED_VERSION)
-AC_SUBST(LIBXML_REQUIRED_VERSION)
+glib_req=2.44
+gtk_req=3.16
+libxml_req=2.6.0
+gladeui_req=3.9
AC_CONFIG_SRCDIR([gtksourceview/gtksourcebuffer.h])
AC_CONFIG_HEADER([config.h])
@@ -88,12 +85,9 @@ if test "$enable_deprecations" = "no"; then
AC_SUBST(DISABLE_DEPRECATED_CFLAGS)
fi
-PKG_CHECK_MODULES(DEP, [
- glib-2.0 >= $GLIB_REQUIRED_VERSION
- gio-2.0 >= $GLIB_REQUIRED_VERSION
- gtk+-3.0 >= $GTK_REQUIRED_VERSION
- libxml-2.0 >= $LIBXML_REQUIRED_VERSION
-])
+AX_PKG_CHECK_MODULES(DEP,
+ [glib-2.0 >= $glib_req gio-2.0 >= $glib_req gtk+-3.0 >= $gtk_req],
+ [libxml-2.0 >= $libxml_req])
dnl Check to enable completion providers
AC_ARG_ENABLE(providers,
@@ -124,7 +118,7 @@ AC_ARG_ENABLE([glade-catalog],
AM_CONDITIONAL([GLADE_CATALOG], [ test "$glade_catalog" = "yes" ])
AS_IF([ test "$glade_catalog" = "yes" ],
- [PKG_CHECK_MODULES(GLADE, [gladeui-2.0 >= $GLADE_UI_REQUIRED])
+ [PKG_CHECK_MODULES(GLADE, [gladeui-2.0 >= $gladeui_req])
AC_MSG_CHECKING([whether to install Glade catalog])
GLADE_CATALOG_DIR=`$PKG_CONFIG --variable=catalogdir gladeui-2.0 2>&AS_MESSAGE_LOG_FD`
AC_MSG_RESULT([$GLADE_CATALOG_DIR])
diff --git a/gtksourceview-3.0.pc.in b/gtksourceview-3.0.pc.in
index 7e19a99..8cc0d6a 100644
--- a/gtksourceview-3.0.pc.in
+++ b/gtksourceview-3.0.pc.in
@@ -6,7 +6,7 @@ includedir= includedir@
Name: @PACKAGE_NAME@
Description: GTK+ 3.0 Source Editing Widget
Version: @PACKAGE_VERSION@
-Requires: gtk+-3.0 >= @GTK_REQUIRED_VERSION@
-Requires.private: libxml-2.0 >= @LIBXML_REQUIRED_VERSION@
+Requires: @AX_PACKAGE_REQUIRES@
+Requires.private: @AX_PACKAGE_REQUIRES_PRIVATE@
Libs: -L${libdir} -lgtksourceview-3.0
Cflags: -I${includedir}/gtksourceview-3.0
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]