]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/udis86/lib/contrib/m4/ax_prog_yasm_version.m4
Update
[l4.git] / l4 / pkg / udis86 / lib / contrib / m4 / ax_prog_yasm_version.m4
1 # SYNOPSIS
2 #
3 #   AX_PROG_YASM_VERSION([VERSION],[ACTION-IF-TRUE],[ACTION-IF-FALSE])
4 #
5 # DESCRIPTION
6 #
7 #   Makes sure that yasm supports the version indicated. If true 
8 #   the shell commands in ACTION-IF-TRUE are executed. If not the shell
9 #   commands in ACTION-IF-FALSE are run. Note if $YASM is not set
10 #   (for example by running AX_WITH_PROG) the macro will fail.
11 #
12 #   Example:
13 #
14 #     AX_WITH_PROG(YASM,yasm)
15 #     AX_PROG_YASM_VERSION([1.1.1],[ ... ],[ ... ])
16 #
17 # LICENSE
18 #
19 #   ax_prog_python_version.m4
20 #
21 #   Copyright (c) 2009 Francesco Salvestrini <salvestrini@users.sourceforge.net>
22 #
23 #   Copying and distribution of this file, with or without modification, are
24 #   permitted in any medium without royalty provided the copyright notice
25 #   and this notice are preserved. This file is offered as-is, without any
26 #   warranty.
27 #
28 #   ax_prog_yasm_version.m4
29 #
30 #   Copyright (c) 2013 Vivek Thampi <vivekthampi@users.sourceforge.net>
31
32
33 AC_DEFUN([AX_PROG_YASM_VERSION],[
34     AC_REQUIRE([AC_PROG_SED])
35     AC_REQUIRE([AC_PROG_GREP])
36
37
38     AS_IF([test -n "$YASM"],[
39         ax_yasm_version="$1"
40
41         AC_MSG_CHECKING([for yasm version])
42         changequote(<<,>>)
43         yasm_version=`$YASM --version 2>&1 | $GREP "^yasm " | $SED -e 's/^.* \([0-9]*\.[0-9]*\.[0-9]*\)/\1/'`
44         changequote([,])
45         AC_MSG_RESULT($yasm_version)
46
47         AC_SUBST([YASM_VERSION],[$yasm_version])
48
49         AX_COMPARE_VERSION([$ax_yasm_version],[le],[$yasm_version],[
50         :
51             $2
52         ],[
53         :
54             $3
55         ])
56     ],[
57         AC_MSG_WARN([could not find the yasm])
58         $3
59     ])
60 ])