File: ax_prog_gjs.m4

package info (click to toggle)
polari 3.22.2-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 4,772 kB
  • ctags: 317
  • sloc: sh: 4,907; ansic: 867; makefile: 157; xml: 122; sed: 16
file content (56 lines) | stat: -rw-r--r-- 1,999 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# ===========================================================================
#        http://www.gnu.org/software/autoconf-archive/ax_prog_gjs.html
# ===========================================================================
#
# SYNOPSIS
#
#   AX_PROG_GJS
#
# DESCRIPTION
#
#   AX_PROG_GJS checks for the presence of the JavaScript interpreter GJS
#   (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
#
#   Copyright (c) 2013, 2016 Endless Mobile, Inc.; contributed by Philip Chimento <philip@endlessm.com>
#
#   Copying and distribution of this file, with or without modification, are
#   permitted in any medium without royalty provided the copyright notice
#   and this notice are preserved. This file is offered as-is, without any
#   warranty.

#serial 2

AC_DEFUN_ONCE([AX_PROG_GJS], [
  AC_REQUIRE([PKG_PROG_PKG_CONFIG])
  AC_ARG_VAR([GJS], [Path to GJS interpreter])
  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,
for example GJS=/path/to/gjs.])])
])

# _AX_GJS_IFELSE(program, [action-if-true], [action-if-false])
# -------------------------------------------------------------
# Comparable to AC_RUN_IFELSE(), but runs the program using GJS
# instead of trying to compile it and link it.
# Used by AX_CHECK_GIRS_GJS and AX_CHECK_GIR_SYMBOLS_GJS.

AC_DEFUN([_AX_GJS_IFELSE], [
  AC_REQUIRE([AX_PROG_GJS])
  echo "$1" >conftest.js
  $GJS conftest.js >>config.log 2>&1
  AS_IF([test $? -eq 0], [$2], [$3])
])