Branch: refs/heads/master Author: Colomban Wendling ban@herbesfolles.org Committer: Colomban Wendling ban@herbesfolles.org Date: Thu, 28 Mar 2013 14:46:14 UTC Commit: ff92beb7c505054e54cd4d80c5c5f53ce6b194a2 https://github.com/geany/geany-plugins/commit/ff92beb7c505054e54cd4d80c5c5f5...
Log Message: ----------- Autotools: honor --with-geany-libdir when checking whether to enable GTK3
Modified Paths: -------------- build/geany.m4 build/gtk.m4
Modified: build/geany.m4 30 files changed, 27 insertions(+), 3 deletions(-) =================================================================== @@ -1,4 +1,4 @@ -AC_DEFUN([GP_CHECK_GEANY], +AC_DEFUN([_GP_GEANY_LIBDIR], [ AC_REQUIRE([PKG_PROG_PKG_CONFIG]) AC_ARG_WITH([geany-libdir], @@ -6,8 +6,33 @@ AC_DEFUN([GP_CHECK_GEANY], [Set Geany's installation libdir [[default=auto]]]), [geany_libdir=${withval}], [geany_libdir=$(${PKG_CONFIG} --variable=libdir geany)]) +])
+dnl GP_GEANY_PKG_CONFIG_PATH_PUSH +dnl Updates PKG_CONFIG_PATH to include the appropriate directory to match +dnl --with-geany-libdir option. This is useful when calling PKG_CONFIG on the +dnl geany package but should be avoided for any other package. +dnl Call GP_GEANY_PKG_CONFIG_PATH_POP to undo the action +AC_DEFUN([GP_GEANY_PKG_CONFIG_PATH_PUSH], +[ + AC_REQUIRE([_GP_GEANY_LIBDIR]) export PKG_CONFIG_PATH="$geany_libdir/pkgconfig:$PKG_CONFIG_PATH" +]) + +dnl GP_GEANY_PKG_CONFIG_PATH_POP +dnl Undoes what GP_GEANY_PKG_CONFIG_PATH_PUSH did +AC_DEFUN([GP_GEANY_PKG_CONFIG_PATH_POP], +[ + AC_REQUIRE([_GP_GEANY_LIBDIR]) + export PKG_CONFIG_PATH="${PKG_CONFIG_PATH#*:}" + test -z "${PKG_CONFIG_PATH}" && unset PKG_CONFIG_PATH +]) + +AC_DEFUN([GP_CHECK_GEANY], +[ + AC_REQUIRE([PKG_PROG_PKG_CONFIG]) + + GP_GEANY_PKG_CONFIG_PATH_PUSH
PKG_CHECK_MODULES([GEANY], [geany >= $1]) geanypluginsdir=$geany_libdir/geany @@ -15,6 +40,5 @@ AC_DEFUN([GP_CHECK_GEANY], AC_SUBST([geanypluginsdir]) AC_SUBST([GEANY_VERSION])
- export PKG_CONFIG_PATH="${PKG_CONFIG_PATH#*:}" - test -z "${PKG_CONFIG_PATH}" && unset PKG_CONFIG_PATH + GP_GEANY_PKG_CONFIG_PATH_POP ])
Modified: build/gtk.m4 4 files changed, 4 insertions(+), 0 deletions(-) =================================================================== @@ -6,6 +6,8 @@ AC_DEFUN([GP_CHECK_GTK_VERSION], AC_REQUIRE([AC_PROG_AWK]) AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+ GP_GEANY_PKG_CONFIG_PATH_PUSH + _gtk_req=$(${PKG_CONFIG} --print-requires geany | ${AWK} '/^gtk+-/{print}') GP_GTK_PACKAGE=$(echo ${_gtk_req} | ${AWK} '{print $[]1}') GP_GTK_VERSION=$(echo ${_gtk_req} | ${AWK} '{print $[]3}') @@ -15,6 +17,8 @@ AC_DEFUN([GP_CHECK_GTK_VERSION], AC_SUBST([GP_GTK_VERSION_MAJOR])
AM_CONDITIONAL([GP_GTK3], [test "x$GP_GTK_VERSION_MAJOR" = x3]) + + GP_GEANY_PKG_CONFIG_PATH_POP ])
dnl executes $1 if GTK3 is used, and $2 otherwise
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
plugins-commits@lists.geany.org