root / config / gr_swig.m4 @ 3b0db383
History | View | Annotate | Download (3.1 kB)
| 1 | 5d69a524 | jcorgan | dnl |
|---|---|---|---|
| 2 | 5d69a524 | jcorgan | dnl Copyright 2003 Free Software Foundation, Inc. |
| 3 | 5d69a524 | jcorgan | dnl |
| 4 | 5d69a524 | jcorgan | dnl This file is part of GNU Radio |
| 5 | 5d69a524 | jcorgan | dnl |
| 6 | 5d69a524 | jcorgan | dnl GNU Radio is free software; you can redistribute it and/or modify |
| 7 | 5d69a524 | jcorgan | dnl it under the terms of the GNU General Public License as published by |
| 8 | 937b719d | eb | dnl the Free Software Foundation; either version 3, or (at your option) |
| 9 | 5d69a524 | jcorgan | dnl any later version. |
| 10 | 5d69a524 | jcorgan | dnl |
| 11 | 5d69a524 | jcorgan | dnl GNU Radio is distributed in the hope that it will be useful, |
| 12 | 5d69a524 | jcorgan | dnl but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | 5d69a524 | jcorgan | dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | 5d69a524 | jcorgan | dnl GNU General Public License for more details. |
| 15 | 5d69a524 | jcorgan | dnl |
| 16 | 5d69a524 | jcorgan | dnl You should have received a copy of the GNU General Public License |
| 17 | 5d69a524 | jcorgan | dnl along with GNU Radio; see the file COPYING. If not, write to |
| 18 | 86f5c924 | eb | dnl the Free Software Foundation, Inc., 51 Franklin Street, |
| 19 | 86f5c924 | eb | dnl Boston, MA 02110-1301, USA. |
| 20 | 5d69a524 | jcorgan | dnl |
| 21 | 5d69a524 | jcorgan | |
| 22 | 5d69a524 | jcorgan | # SWIG_PROG([required-version]) |
| 23 | 5d69a524 | jcorgan | # |
| 24 | 5d69a524 | jcorgan | # Checks for the SWIG program. If found you can (and should) call SWIG via $(SWIG). |
| 25 | 5d69a524 | jcorgan | # You can use the optional first argument to check if the version of the available SWIG |
| 26 | 5d69a524 | jcorgan | # is greater or equal to the value of the argument. It should have the format: |
| 27 | 5d69a524 | jcorgan | # N[.N[.N]] (N is a number between 0 and 999. Only the first N is mandatory.) |
| 28 | 5d69a524 | jcorgan | AC_DEFUN([SWIG_PROG],[ |
| 29 | 5d69a524 | jcorgan | AC_REQUIRE([AC_PROG_MAKE_SET]) |
| 30 | 5d69a524 | jcorgan | AC_CHECK_PROG(SWIG,swig,[`which swig`]) |
| 31 | 5d69a524 | jcorgan | if test -z "$SWIG" ; then |
| 32 | 5d69a524 | jcorgan | AC_MSG_ERROR([Cannot find 'swig' program. SWIG version >= $1 required]) |
| 33 | 5d69a524 | jcorgan | SWIG=false |
| 34 | 5d69a524 | jcorgan | elif test -n "$1" ; then |
| 35 | 5d69a524 | jcorgan | AC_MSG_CHECKING([for SWIG version]) |
| 36 | 5d69a524 | jcorgan | swig_version=`$SWIG -version 2>&1 | \ |
| 37 | 5d69a524 | jcorgan | awk '/^SWIG Version [[0-9]+\.[0-9]+\.[0-9]]+.*$/ { split($[3],a,"[[^.0-9]]"); print a[[1]] }'`
|
| 38 | 5d69a524 | jcorgan | AC_MSG_RESULT([$swig_version]) |
| 39 | 5d69a524 | jcorgan | if test -n "$swig_version" ; then |
| 40 | 5d69a524 | jcorgan | swig_version=`echo $swig_version | \ |
| 41 | 5d69a524 | jcorgan | awk '{ split($[1],a,"\."); print [a[1]*1000000+a[2]*1000+a[3]] }' 2>/dev/null`
|
| 42 | 5d69a524 | jcorgan | swig_required_version=`echo $1 | \ |
| 43 | 5d69a524 | jcorgan | awk '{ split($[1],a,"\."); print [a[1]*1000000+a[2]*1000+a[3]] }' 2>/dev/null`
|
| 44 | 5d69a524 | jcorgan | if test $swig_required_version -gt $swig_version ; then |
| 45 | 5d69a524 | jcorgan | AC_MSG_ERROR([SWIG version >= $1 required]) |
| 46 | 5d69a524 | jcorgan | fi |
| 47 | 5d69a524 | jcorgan | else |
| 48 | 5d69a524 | jcorgan | AC_MSG_ERROR([cannot determine SWIG version]) |
| 49 | 5d69a524 | jcorgan | fi |
| 50 | 5d69a524 | jcorgan | fi |
| 51 | 5d69a524 | jcorgan | ]) |
| 52 | 5d69a524 | jcorgan | |
| 53 | 5d69a524 | jcorgan | # SWIG_ENABLE_CXX() |
| 54 | 5d69a524 | jcorgan | # |
| 55 | 5d69a524 | jcorgan | # Enable swig C++ support. This effects all invocations of $(SWIG). |
| 56 | 5d69a524 | jcorgan | AC_DEFUN([SWIG_ENABLE_CXX],[ |
| 57 | 5d69a524 | jcorgan | AC_REQUIRE([SWIG_PROG]) |
| 58 | 5d69a524 | jcorgan | AC_REQUIRE([AC_PROG_CXX]) |
| 59 | 5d69a524 | jcorgan | if test "$SWIG" != "false" ; then |
| 60 | 5d69a524 | jcorgan | SWIG="$SWIG -c++" |
| 61 | 5d69a524 | jcorgan | fi |
| 62 | 5d69a524 | jcorgan | ]) |
| 63 | 5d69a524 | jcorgan | |
| 64 | 5d69a524 | jcorgan | # SWIG_PYTHON([use-shadow-classes]) |
| 65 | 5d69a524 | jcorgan | # |
| 66 | 5d69a524 | jcorgan | # Checks for Python and provides the $(SWIG_PYTHON_CPPFLAGS), |
| 67 | 5d69a524 | jcorgan | # $(SWIG_PYTHON_LIB) and $(SWIG_PYTHON_OPT) output variables. |
| 68 | 5d69a524 | jcorgan | # $(SWIG_PYTHON_OPT) contains all necessary swig options to generate |
| 69 | 5d69a524 | jcorgan | # code for Python. If you need multi module support use |
| 70 | 5d69a524 | jcorgan | # $(SWIG_PYTHON_LIB) (provided by the SWIG_MULTI_MODULE_SUPPORT() |
| 71 | 5d69a524 | jcorgan | # macro) to link against the appropriate library. It contains the |
| 72 | 5d69a524 | jcorgan | # SWIG Python runtime library that is needed by the type check system |
| 73 | 5d69a524 | jcorgan | # for example. |
| 74 | 5d69a524 | jcorgan | |
| 75 | 5d69a524 | jcorgan | AC_DEFUN([SWIG_PYTHON],[ |
| 76 | 5d69a524 | jcorgan | AC_REQUIRE([SWIG_PROG]) |
| 77 | 5d69a524 | jcorgan | AC_REQUIRE([PYTHON_DEVEL]) |
| 78 | 5d69a524 | jcorgan | if test "$SWIG" != "false" ; then |
| 79 | 5d69a524 | jcorgan | AC_SUBST(SWIG_PYTHON_LIB,[-lswigpy]) |
| 80 | 5d69a524 | jcorgan | dnl test ! "x$1" = "xno" && swig_shadow=" -shadow" || swig_shadow="" |
| 81 | 5d69a524 | jcorgan | dnl AC_SUBST(SWIG_PYTHON_OPT,[-python$swig_shadow]) |
| 82 | 5d69a524 | jcorgan | AC_SUBST(SWIG_PYTHON_OPT,[-python]) |
| 83 | 5d69a524 | jcorgan | fi |
| 84 | 5d69a524 | jcorgan | AC_SUBST(SWIG_PYTHON_CPPFLAGS,[$PYTHON_CPPFLAGS]) |
| 85 | 5d69a524 | jcorgan | ]) |