1
dnl Available from the GNU Autoconf Macro Archive at:
2
dnl http://www.gnu.org/software/ac-archive/htmldoc/ac_pkg_swig.html
4
AC_DEFUN([AC_PROG_SWIG],[
5
if test -z "$SWIG"; then
6
AC_PATH_PROG([SWIG],[swig])
8
if test -z "$SWIG" ; then
9
AC_MSG_WARN([cannot find 'swig' program. You should look at http://www.swig.org])
10
SWIG='echo "Error: SWIG is not installed. You should look at http://www.swig.org" ; false'
12
AC_MSG_NOTICE([SWIG executable is '$SWIG'])
13
if test -n "$1" ; then
14
AC_MSG_CHECKING([for SWIG version])
15
[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'`]
16
AC_MSG_RESULT([$swig_version])
17
if test -n "$swig_version" ; then
18
# Calculate the required version number components
20
[required_major=`echo $required | sed 's/[^0-9].*//'`]
21
if test -z "$required_major" ; then
24
[required=`echo $required | sed 's/[0-9]*[^0-9]//'`]
25
[required_minor=`echo $required | sed 's/[^0-9].*//'`]
26
if test -z "$required_minor" ; then
29
[required=`echo $required | sed 's/[0-9]*[^0-9]//'`]
30
[required_patch=`echo $required | sed 's/[^0-9].*//'`]
31
if test -z "$required_patch" ; then
34
# Calculate the available version number components
35
[available=$swig_version]
36
[available_major=`echo $available | sed 's/[^0-9].*//'`]
37
if test -z "$available_major" ; then
40
[available=`echo $available | sed 's/[0-9]*[^0-9]//'`]
41
[available_minor=`echo $available | sed 's/[^0-9].*//'`]
42
if test -z "$available_minor" ; then
45
[available=`echo $available | sed 's/[0-9]*[^0-9]//'`]
46
[available_patch=`echo $available | sed 's/[^0-9].*//'`]
47
if test -z "$available_patch" ; then
50
if test $available_major -ne $required_major \
51
-o $available_minor -ne $required_minor \
52
-o $available_patch -lt $required_patch ; then
53
AC_MSG_WARN([SWIG version >= $1 is required. You have $swig_version. You should look at http://www.swig.org])
54
SWIG='echo "Error: SWIG version >= $1 is required. You have '"$swig_version"'. You should look at http://www.swig.org" ; false'
56
SWIG_LIB=`$SWIG -swiglib`
57
AC_MSG_NOTICE([SWIG library directory is '$SWIG_LIB'])
60
AC_MSG_WARN([cannot determine SWIG version])
61
SWIG='echo "Error: Cannot determine SWIG version. You should look at http://www.swig.org" ; false'
70
# Enable SWIG C++ support. This affects all invocations of $(SWIG).
71
AC_DEFUN([SWIG_ENABLE_CXX],[
72
AC_REQUIRE([AC_PROG_SWIG])
73
AC_REQUIRE([AC_PROG_CXX])
77
# SWIG_MULTI_MODULE_SUPPORT()
79
# Enable support for multiple modules. This effects all invocations
80
# of $(SWIG). You have to link all generated modules against the
81
# appropriate SWIG runtime library. If you want to build Python
82
# modules for example, use the SWIG_PYTHON() macro and link the
83
# modules against $(SWIG_PYTHON_LIBS).
85
AC_DEFUN([SWIG_MULTI_MODULE_SUPPORT],[
86
AC_REQUIRE([AC_PROG_SWIG])
87
# SWIG="$SWIG -noruntime"
92
# SWIG_PYTHON([use-shadow-classes = {no, yes}])
94
# Checks for Python and provides the $(SWIG_PYTHON_CPPFLAGS),
95
# and $(SWIG_PYTHON_OPT) output variables.
97
# $(SWIG_PYTHON_OPT) contains all necessary SWIG options to generate
98
# code for Python. Shadow classes are enabled unless the value of the
99
# optional first argument is exactly 'no'. If you need multi module
100
# support (provided by the SWIG_MULTI_MODULE_SUPPORT() macro) use
101
# $(SWIG_PYTHON_LIBS) to link against the appropriate library. It
102
# contains the SWIG Python runtime library that is needed by the type
103
# check system for example.
104
AC_DEFUN([SWIG_PYTHON],[
105
AC_REQUIRE([AC_PROG_SWIG])
106
# AC_REQUIRE([AC_PYTHON_DEVEL])
107
# test "x$1" != "xno" || swig_shadow=" -noproxy"
108
# AC_SUBST([SWIG_PYTHON_OPT],[-python$swig_shadow])
109
AC_SUBST([SWIG_PYTHON_OPT],[-python])
110
AC_SUBST([SWIG_PYTHON_CPPFLAGS],[$PYTHON_CPPFLAGS])
114
dnl @synopsis AC_LIB_WAD
116
dnl This macro searches for installed WAD library.
118
AC_DEFUN([AC_LIB_WAD],
120
AC_REQUIRE([AC_PYTHON_DEVEL])
122
AC_HELP_STRING([--enable-wad], [enable wad module]),
124
case "${enableval}" in
126
*) if test "x${enableval}" = xyes;
133
if test -n "$check_wad";
135
AC_CHECK_LIB(wadpy, _init, [WADPY=-lwadpy], [], $PYTHON_LDFLAGS $PYTHON_EXTRA_LIBS)