Merge branch 'master' of ssh://git.sv.gnu.org/srv/git/gnash
[gnash.git] / macros / swfmill.m4
blob15099c4c5eb84bac9f75915d4df24a051e74002f
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_SWFMILL
23 # Provides:
24 #       SWFMILL   - Path to swfmill executable
27 AC_DEFUN([AC_PATH_SWFMILL], [
28   SWFMILL=""
30   AC_ARG_WITH(swfmill, AC_HELP_STRING([--with-swfmill=<path>], [Path to the swfmill executable]), [
31     case "${withval}" in
32       yes|no) ;;
33       *) SWFMILL=${withval} ;;
34     esac
35   ], SWFMILL="")
37   if test x"$SWFMILL" = "x"; then
38     AC_PATH_PROG(SWFMILL, swfmill, ,[${pathlist}])
39   fi
41   if test x"$SWFMILL" != "x"; then
42     sm=`$SWFMILL -h 2>&1 | head -n 4`
43     version=`echo "$sm" | grep 'swfmill [[0-9]]\{1,2\}\(\.[[0-9]]\{1,2\}\)\{2,3\}' | cut -d' ' -f2`
44     major=`echo $version | cut -d'.' -f1`
45     minor=`echo $version | cut -d'.' -f2`
46     micro=`echo $version | cut -d'.' -f3`
47     beta=`echo $version | cut -d'.' -f4`
48     if test -z $beta; then
49       beta=0
50     fi
51     SWFMILL_VERSION=`printf %2.2d%2.2d%2.2d%2.2d $major $minor $micro $beta`
52   fi
54   AC_SUBST(SWFMILL_VERSION)
55   AC_SUBST(SWFMILL)
58 # Local Variables:
59 # c-basic-offset: 2
60 # tab-width: 2
61 # indent-tabs-mode: nil
62 # End: