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.

61 lines
1.8KB

  1. # ===========================================================================
  2. # https://www.gnu.org/software/autoconf-archive/ax_prog_haxe_version.html
  3. # ===========================================================================
  4. #
  5. # SYNOPSIS
  6. #
  7. # AX_PROG_HAXE_VERSION([VERSION],[ACTION-IF-TRUE],[ACTION-IF-FALSE])
  8. #
  9. # DESCRIPTION
  10. #
  11. # Makes sure that haxe 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. The $HAXE_VERSION variable will be filled with
  14. # the detected version.
  15. #
  16. # This macro uses the $HAXE variable to perform the check. If $HAXE is not
  17. # set prior to calling this macro, the macro will fail.
  18. #
  19. # Example:
  20. #
  21. # AC_PATH_PROG([HAXE],[haxe])
  22. # AC_PROG_HAXE_VERSION([3.1.3],[ ... ],[ ... ])
  23. #
  24. # Searches for Haxe, then checks if at least version 3.1.3 is present.
  25. #
  26. # LICENSE
  27. #
  28. # Copyright (c) 2015 Jens Geyer <jensg@apache.org>
  29. #
  30. # Copying and distribution of this file, with or without modification, are
  31. # permitted in any medium without royalty provided the copyright notice
  32. # and this notice are preserved. This file is offered as-is, without any
  33. # warranty.
  34. #serial 2
  35. AC_DEFUN([AX_PROG_HAXE_VERSION],[
  36. AC_REQUIRE([AC_PROG_SED])
  37. AS_IF([test -n "$HAXE"],[
  38. ax_haxe_version="$1"
  39. AC_MSG_CHECKING([for haxe version])
  40. haxe_version=`$HAXE -version 2>&1 | $SED -e 's/^.* \( @<:@0-9@:>@*\.@<:@0-9@:>@*\.@<:@0-9@:>@*\) .*/\1/'`
  41. AC_MSG_RESULT($haxe_version)
  42. AC_SUBST([HAXE_VERSION],[$haxe_version])
  43. AX_COMPARE_VERSION([$ax_haxe_version],[le],[$haxe_version],[
  44. :
  45. $2
  46. ],[
  47. :
  48. $3
  49. ])
  50. ],[
  51. AC_MSG_WARN([could not find Haxe])
  52. $3
  53. ])
  54. ])