use the VERSION instead of master in the revno.h generated from a src tarball
[gnash.git] / macros / haxe.m4
blobf1570f240b2b54ae88b22396dba9fcd311a2f582
1 dnl
2 dnl    Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
3 dnl
4 dnl  This program is free software; you can redistribute it and/or modify
5 dnl  it under the terms of the GNU General Public License as published by
6 dnl  the Free Software Foundation; either version 3 of the License, or
7 dnl  (at your option) any later version.
8 dnl
9 dnl  This program is distributed in the hope that it will be useful,
10 dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of
11 dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 dnl  GNU General Public License for more details.
13 dnl  You should have received a copy of the GNU General Public License
14 dnl  along with this program; if not, write to the Free Software
15 dnl  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
16 dnl
20 # Use: 
21 #       AC_PATH_HAXE
23 # Provides:
24 #       HAXE             - Path to haxe executable
25 #       HAXE_CLASSPATH   - Classpath for haxe
28 AC_DEFUN([AC_PATH_HAXE], [
29   HAXE=""
30   HAXE_CLASSPATH=""
32   AC_ARG_WITH(haxe, AC_HELP_STRING([--with-haxe=<path>], [Path to the haxe executable]), [
33     case "${withval}" in
34       yes|no) ;;
35       *) HAXE=${withval} ;;
36     esac
37   ], HAXE="")
39   AC_ARG_WITH(haxe-classpath, AC_HELP_STRING([--with-haxe-classpath=<path>], [CLASSPATH for haxe]), [
40     case "${withval}" in
41       yes|no) ;;
42       *) HAXE_CLASSPATH=${withval} ;;
43     esac
44   ], HAXE_CLASSPATH="")
46   if test x"$HAXE" = "x"; then
47     AC_PATH_PROG(HAXE, haxe, ,[${pathlist}])
48   fi
50   if test x"$HAXE" != "x"; then
51     AC_MSG_CHECKING([for HAXE version])
52     HAXE_VERSION=`$HAXE -help | grep -i ^haxe | awk '{print $'3'}'`
53     AC_MSG_RESULT([${HAXE_VERSION}])
55     major=`echo $HAXE_VERSION | cut -d '.' -f 1`
56     minor=`echo $HAXE_VERSION | cut -d '.' -f 2`
58     dnl
59     dnl we need 2.00 or higher
60     dnl 1.19 was tested as failing to build some testcases
61     dnl preventing 'make check' from completing
62     dnl
63     if test $major -lt 2; then
64         AC_MSG_WARN([Haxe ${HAXE_VERSION} is too old to be used])
65         unset HAXE
66     fi
67   fi
69   if test x"$HAXE" != "x" -a x"$HAXE_CLASSPATH" = "x"; then
70     # cross your fingers !
71     if test -d "`dirname ${HAXE}`/std"; then
72     dir="`dirname ${HAXE}`/std"
73     elif test -d "/usr/share/haxe"; then
74     dir="/usr/share/haxe/"
75     else
76     dnl FIXME
77     dir="/usr/share/haxe/"
78     fi
79     HAXE_CLASSPATH=$dir
80   fi
83   AC_SUBST(HAXE)
84   AC_SUBST(HAXE_CLASSPATH)
87 # Local Variables:
88 # c-basic-offset: 2
89 # tab-width: 2
90 # indent-tabs-mode: nil
91 # End: