Collection of DPF-based plugins for packaging
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

57 lines
2.0KB

  1. # ===========================================================================
  2. # https://www.gnu.org/software/autoconf-archive/ax_prog_gjs.html
  3. # ===========================================================================
  4. #
  5. # SYNOPSIS
  6. #
  7. # AX_PROG_GJS
  8. #
  9. # DESCRIPTION
  10. #
  11. # AX_PROG_GJS checks for the presence of the JavaScript interpreter GJS
  12. # (https://wiki.gnome.org/Projects/Gjs) in pkg-config or in the path. If
  13. # it is not found, an error is issued and configure is halted. If it is
  14. # found, the path of the interpreter is placed into a variable named GJS,
  15. # which is declared precious.
  16. #
  17. # LICENSE
  18. #
  19. # Copyright (c) 2013, 2016 Endless Mobile, Inc.; contributed by Philip Chimento <philip@endlessm.com>
  20. #
  21. # Copying and distribution of this file, with or without modification, are
  22. # permitted in any medium without royalty provided the copyright notice
  23. # and this notice are preserved. This file is offered as-is, without any
  24. # warranty.
  25. #serial 3
  26. AC_DEFUN_ONCE([AX_PROG_GJS], [
  27. AC_REQUIRE([PKG_PROG_PKG_CONFIG])
  28. AC_ARG_VAR([GJS], [Path to GJS interpreter])
  29. AC_MSG_CHECKING([for GJS])
  30. AS_IF([pkg-config --exists gjs-1.0], [
  31. GJS=`pkg-config --variable=gjs_console gjs-1.0`
  32. AC_MSG_RESULT([(pkg-config) $GJS])
  33. ], [
  34. AC_PATH_PROG([GJS], [gjs], [notfound])
  35. AC_MSG_RESULT([(path) $GJS])
  36. ])
  37. AS_IF([test "x$GJS" = "xnotfound"],
  38. [AC_MSG_ERROR([GJS is required, but was not found. If GJS is
  39. installed, try passing its path in an environment variable,
  40. for example GJS=/path/to/gjs.])])
  41. ])
  42. # _AX_GJS_IFELSE(program, [action-if-true], [action-if-false])
  43. # -------------------------------------------------------------
  44. # Comparable to AC_RUN_IFELSE(), but runs the program using GJS
  45. # instead of trying to compile it and link it.
  46. # Used by AX_CHECK_GIRS_GJS and AX_CHECK_GIR_SYMBOLS_GJS.
  47. AC_DEFUN([_AX_GJS_IFELSE], [
  48. AC_REQUIRE([AX_PROG_GJS])
  49. echo "$1" >conftest.js
  50. $GJS conftest.js >>config.log 2>&1
  51. AS_IF([test $? -eq 0], [$2], [$3])
  52. ])