1 # Modified by Dustin J. Mitchell, Zmanda, Inc. as follows:
2 # - remove warnings -- Amanda tarballs ship pre-swigged, so users
3 # need not be alarmed if they don't have SWIG.
5 ##### http://autoconf-archive.cryp.to/ac_pkg_swig.html
9 # AC_PROG_SWIG([major.minor.micro])
13 # This macro searches for a SWIG installation on your system. If
14 # found you should call SWIG via $(SWIG). You can use the optional
15 # first argument to check if the version of the available SWIG is
16 # greater than or equal to the value of the argument. It should have
17 # the format: N[.N[.N]] (N is a number between 0 and 999. Only the
18 # first N is mandatory.)
20 # If the version argument is given (e.g. 1.3.17), AC_PROG_SWIG checks
21 # that the swig package is this version number or higher.
23 # In configure.in, use as:
25 # AC_PROG_SWIG(1.3.17)
27 # SWIG_MULTI_MODULE_SUPPORT
36 # Copyright (c) 2006 Sebastian Huber <sebastian-huber@web.de>
37 # Copyright (c) 2006 Alan W. Irwin <irwin@beluga.phys.uvic.ca>
38 # Copyright (c) 2006 Rafael Laboissiere <rafael@laboissiere.net>
39 # Copyright (c) 2006 Andrew Collier <colliera@ukzn.ac.za>
41 # This program is free software; you can redistribute it and/or
42 # modify it under the terms of the GNU General Public License as
43 # published by the Free Software Foundation; either version 2 of the
44 # License, or (at your option) any later version.
46 # This program is distributed in the hope that it will be useful, but
47 # WITHOUT ANY WARRANTY; without even the implied warranty of
48 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
49 # General Public License for more details.
51 # You should have received a copy of the GNU General Public License
52 # along with this program; if not, write to the Free Software
53 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
56 # As a special exception, the respective Autoconf Macro's copyright
57 # owner gives unlimited permission to copy, distribute and modify the
58 # configure scripts that are the output of Autoconf when processing
59 # the Macro. You need not follow the terms of the GNU General Public
60 # License when using or distributing such scripts, even though
61 # portions of the text of the Macro appear in them. The GNU General
62 # Public License (GPL) does govern all other use of the material that
63 # constitutes the Autoconf Macro.
65 # This special exception to the GPL applies to versions of the
66 # Autoconf Macro released by the Autoconf Macro Archive. When you
67 # make and distribute a modified version of the Autoconf Macro, you
68 # may extend this special exception to the GPL to apply to your
69 # modified version as well.
71 AC_DEFUN([AC_PROG_SWIG],[
72 AC_PATH_PROG([SWIG],[swig])
73 if test -z "$SWIG" ; then
74 SWIG='echo "Error: SWIG is not installed. You should look at http://www.swig.org" ; false'
75 elif test -n "$1" ; then
76 AC_MSG_CHECKING([for SWIG version])
77 [swig_version=`$SWIG -version 2>&1 | grep 'SWIG Version' | sed 's/.*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*/\1/g'`]
78 AC_MSG_RESULT([$swig_version])
79 if test -n "$swig_version" ; then
80 AX_COMPARE_VERSION($swig_version, ge, $1, [
82 SWIG_LIB=`$SWIG -swiglib`
85 SWIG='echo "Error: SWIG version >= $1 is required. You have '"$swig_version"'. You should look at http://www.swig.org" ; false'
88 SWIG='echo "Error: Cannot determine SWIG version. You should look at http://www.swig.org" ; false'