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.

66 lines
2.0KB

  1. # ===========================================================================
  2. # https://www.gnu.org/software/autoconf-archive/ax_prog_guile_version.html
  3. # ===========================================================================
  4. #
  5. # SYNOPSIS
  6. #
  7. # AX_PROG_GUILE_VERSION([VERSION],[ACTION-IF-TRUE],[ACTION-IF-FALSE])
  8. #
  9. # DESCRIPTION
  10. #
  11. # Makes sure that guile supports the version indicated. If true the shell
  12. # commands in ACTION-IF-TRUE are executed. If not the shell commands in
  13. # ACTION-IF-FALSE are run. Note if $GUILE is not set (for example by
  14. # running AC_CHECK_PROG or AC_PATH_PROG) the macro will fail.
  15. #
  16. # Example:
  17. #
  18. # AC_PATH_PROG([GUILE],[guile])
  19. # AC_PROG_GUILE_VERSION([1.6.0],[ ... ],[ ... ])
  20. #
  21. # This will check to make sure that the guile you have supports at least
  22. # version 1.6.0.
  23. #
  24. # NOTE: This macro uses the $GUILE variable to perform the check.
  25. # AX_WITH_GUILE can be used to set that variable prior to running this
  26. # macro. The $GUILE_VERSION variable will be valorized with the detected
  27. # version.
  28. #
  29. # LICENSE
  30. #
  31. # Copyright (c) 2009 Francesco Salvestrini <salvestrini@users.sourceforge.net>
  32. #
  33. # Copying and distribution of this file, with or without modification, are
  34. # permitted in any medium without royalty provided the copyright notice
  35. # and this notice are preserved. This file is offered as-is, without any
  36. # warranty.
  37. #serial 11
  38. AC_DEFUN([AX_PROG_GUILE_VERSION],[
  39. AC_REQUIRE([AC_PROG_SED])
  40. AS_IF([test -n "$GUILE"],[
  41. ax_guile_version="$1"
  42. AC_MSG_CHECKING([for guile version])
  43. changequote(<<,>>)
  44. guile_version=`$GUILE -q --version 2>&1 | head -n 1 | $SED -e 's/.* \([0-9]*\.[0-9]*\.[0-9]*\)/\1/'`
  45. changequote([,])
  46. AC_MSG_RESULT($guile_version)
  47. AC_SUBST([GUILE_VERSION],[$guile_version])
  48. AX_COMPARE_VERSION([$ax_guile_version],[le],[$guile_version],[
  49. :
  50. $2
  51. ],[
  52. :
  53. $3
  54. ])
  55. ],[
  56. AC_MSG_WARN([could not find the guile interpreter])
  57. $3
  58. ])
  59. ])