summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Simons <simons@cryp.to>2016-08-19 10:08:35 +0200
committerGitHub <noreply@github.com>2016-08-19 10:08:35 +0200
commit0182e6453ac535711bfd082a8b01213103f03bf0 (patch)
tree7e0744b3dd8085d19b9cc8388ab508829cdefacd
parentae88d07b44bbd211de37cd5f4cf9877a896b1d52 (diff)
parent83089b23b603b0a655d93787d988a718ba26e89d (diff)
downloadautoconf-archive-0182e6453ac535711bfd082a8b01213103f03bf0.tar.gz
Merge pull request #89 from ptomato/ax-prog-gjs-2
ax_prog_gjs: Look in pkg-config as well as path
-rw-r--r--m4/ax_prog_gjs.m420
1 files changed, 14 insertions, 6 deletions
diff --git a/m4/ax_prog_gjs.m4 b/m4/ax_prog_gjs.m4
index 364741d..6762852 100644
--- a/m4/ax_prog_gjs.m4
+++ b/m4/ax_prog_gjs.m4
@@ -9,10 +9,10 @@
# DESCRIPTION
#
# AX_PROG_GJS checks for the presence of the JavaScript interpreter GJS
-# (https://wiki.gnome.org/Projects/Gjs) in the path. If it is not found,
-# an error is issued and configure is halted. If it is found, the path of
-# the interpreter is placed into a variable named GJS, which is declared
-# precious.
+# (https://wiki.gnome.org/Projects/Gjs) in pkg-config or in the path. If
+# it is not found, an error is issued and configure is halted. If it is
+# found, the path of the interpreter is placed into a variable named GJS,
+# which is declared precious.
#
# LICENSE
#
@@ -23,11 +23,19 @@
# and this notice are preserved. This file is offered as-is, without any
# warranty.
-#serial 1
+#serial 2
AC_DEFUN_ONCE([AX_PROG_GJS], [
+ AC_REQUIRE([PKG_PROG_PKG_CONFIG])
AC_ARG_VAR([GJS], [Path to GJS interpreter])
- AC_PATH_PROG([GJS], [gjs], [notfound])
+ AC_MSG_CHECKING([for GJS])
+ AS_IF([pkg-config --exists gjs-1.0], [
+ GJS=`pkg-config --variable=gjs_console gjs-1.0`
+ AC_MSG_RESULT([(pkg-config) $GJS])
+ ], [
+ AC_PATH_PROG([GJS], [gjs], [notfound])
+ AC_MSG_RESULT([(path) $GJS])
+ ])
AS_IF([test "x$GJS" = "xnotfound"],
[AC_MSG_ERROR([GJS is required, but was not found. If GJS is
installed, try passing its path in an environment variable,