[Debian-astro-commits] [gyoto] 176/221: Check for Swig in configure, fix glitches so python extension compiles under MacOS (w/ macports)

Thibaut Jean-Claude Paumard thibaut at moszumanska.debian.org
Fri May 22 20:52:44 UTC 2015


This is an automated email from the git hooks/post-receive script.

thibaut pushed a commit to branch master
in repository gyoto.

commit afcfaef4bd1ac997186522cacbda5766d0981e7c
Author: Thibaut Paumard <paumard at users.sourceforge.net>
Date:   Mon Jan 5 18:07:00 2015 +0100

    Check for Swig in configure, fix glitches so python extension compiles under MacOS (w/ macports)
---
 Makefile.in                 |  13 +++--
 aclocal.m4                  |   1 +
 bin/Makefile.in             |  13 +++--
 configure                   | 122 +++++++++++++++++++++++++++++++++++++++
 configure.ac                |   3 +
 include/GyotoScenery.h      |   2 +-
 lib/Makefile.in             |  13 +++--
 lib/Scenery.C               |   2 +-
 lib/gyoto-uninstalled.pc.in |   1 +
 lib/gyoto.pc.in             |   1 +
 m4/ax_pkg_swig.m4           | 135 ++++++++++++++++++++++++++++++++++++++++++++
 python/Makefile.in          |  21 ++++---
 python/gyoto_std.i          |   2 +
 13 files changed, 304 insertions(+), 25 deletions(-)

diff --git a/Makefile.in b/Makefile.in
index e96396c..686c5a4 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -100,11 +100,12 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_append_compile_flags.m4 \
 	$(top_srcdir)/m4/ax_append_flag.m4 \
 	$(top_srcdir)/m4/ax_check_compile_flag.m4 \
 	$(top_srcdir)/m4/ax_cxx_compile_stdcxx_11.m4 \
-	$(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/boost.m4 \
-	$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
-	$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
-	$(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \
-	$(top_srcdir)/m4/python.m4 $(top_srcdir)/configure.ac
+	$(top_srcdir)/m4/ax_pkg_swig.m4 $(top_srcdir)/m4/ax_pthread.m4 \
+	$(top_srcdir)/m4/boost.m4 $(top_srcdir)/m4/libtool.m4 \
+	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+	$(top_srcdir)/m4/pkg.m4 $(top_srcdir)/m4/python.m4 \
+	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
 am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
@@ -315,6 +316,8 @@ SED = @SED@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 STRIP = @STRIP@
+SWIG = @SWIG@
+SWIG_LIB = @SWIG_LIB@
 SYS = @SYS@
 UDUNITS_CFLAGS = @UDUNITS_CFLAGS@
 UDUNITS_CPPFLAGS = @UDUNITS_CPPFLAGS@
diff --git a/aclocal.m4 b/aclocal.m4
index 3fb170d..c954787 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1152,6 +1152,7 @@ m4_include([m4/ax_append_compile_flags.m4])
 m4_include([m4/ax_append_flag.m4])
 m4_include([m4/ax_check_compile_flag.m4])
 m4_include([m4/ax_cxx_compile_stdcxx_11.m4])
+m4_include([m4/ax_pkg_swig.m4])
 m4_include([m4/ax_pthread.m4])
 m4_include([m4/boost.m4])
 m4_include([m4/libtool.m4])
diff --git a/bin/Makefile.in b/bin/Makefile.in
index b01ee19..383b42b 100644
--- a/bin/Makefile.in
+++ b/bin/Makefile.in
@@ -98,11 +98,12 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_append_compile_flags.m4 \
 	$(top_srcdir)/m4/ax_append_flag.m4 \
 	$(top_srcdir)/m4/ax_check_compile_flag.m4 \
 	$(top_srcdir)/m4/ax_cxx_compile_stdcxx_11.m4 \
-	$(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/boost.m4 \
-	$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
-	$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
-	$(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \
-	$(top_srcdir)/m4/python.m4 $(top_srcdir)/configure.ac
+	$(top_srcdir)/m4/ax_pkg_swig.m4 $(top_srcdir)/m4/ax_pthread.m4 \
+	$(top_srcdir)/m4/boost.m4 $(top_srcdir)/m4/libtool.m4 \
+	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+	$(top_srcdir)/m4/pkg.m4 $(top_srcdir)/m4/python.m4 \
+	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
 mkinstalldirs = $(install_sh) -d
@@ -325,6 +326,8 @@ SED = @SED@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 STRIP = @STRIP@
+SWIG = @SWIG@
+SWIG_LIB = @SWIG_LIB@
 SYS = @SYS@
 UDUNITS_CFLAGS = @UDUNITS_CFLAGS@
 UDUNITS_CPPFLAGS = @UDUNITS_CPPFLAGS@
diff --git a/configure b/configure
index aa4efea..f30c4cc 100755
--- a/configure
+++ b/configure
@@ -697,6 +697,8 @@ BOOST_CPPFLAGS
 DISTCHECK_CONFIGURE_FLAGS
 BOOST_ROOT
 HAVE_CXX11
+SWIG_LIB
+SWIG
 PYTHON_ABI_FLAGS
 PYTHON_EXTENSION_SUFFIX
 PYTHON_LDFLAGS
@@ -16198,6 +16200,126 @@ PYTHON_ABI_FLAGS=$pc_cv_python_abi_flags
 
 
 fi
+
+
+        # Ubuntu has swig 2.0 as /usr/bin/swig2.0
+        for ac_prog in swig swig2.0
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_SWIG+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $SWIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_SWIG="$SWIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_SWIG="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+SWIG=$ac_cv_path_SWIG
+if test -n "$SWIG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SWIG" >&5
+$as_echo "$SWIG" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$SWIG" && break
+done
+
+        if test -z "$SWIG" ; then
+                :
+        elif test -n "2.0" ; then
+                { $as_echo "$as_me:${as_lineno-$LINENO}: checking SWIG version" >&5
+$as_echo_n "checking SWIG version... " >&6; }
+                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'`
+                { $as_echo "$as_me:${as_lineno-$LINENO}: result: $swig_version" >&5
+$as_echo "$swig_version" >&6; }
+                if test -n "$swig_version" ; then
+                        # Calculate the required version number components
+                        required=2.0
+                        required_major=`echo $required | sed 's/[^0-9].*//'`
+                        if test -z "$required_major" ; then
+                                required_major=0
+                        fi
+                        required=`echo $required | sed 's/[0-9]*[^0-9]//'`
+                        required_minor=`echo $required | sed 's/[^0-9].*//'`
+                        if test -z "$required_minor" ; then
+                                required_minor=0
+                        fi
+                        required=`echo $required | sed 's/[0-9]*[^0-9]//'`
+                        required_patch=`echo $required | sed 's/[^0-9].*//'`
+                        if test -z "$required_patch" ; then
+                                required_patch=0
+                        fi
+                        # Calculate the available version number components
+                        available=$swig_version
+                        available_major=`echo $available | sed 's/[^0-9].*//'`
+                        if test -z "$available_major" ; then
+                                available_major=0
+                        fi
+                        available=`echo $available | sed 's/[0-9]*[^0-9]//'`
+                        available_minor=`echo $available | sed 's/[^0-9].*//'`
+                        if test -z "$available_minor" ; then
+                                available_minor=0
+                        fi
+                        available=`echo $available | sed 's/[0-9]*[^0-9]//'`
+                        available_patch=`echo $available | sed 's/[^0-9].*//'`
+                        if test -z "$available_patch" ; then
+                                available_patch=0
+                        fi
+                        # Convert the version tuple into a single number for easier comparison.
+                        # Using base 100 should be safe since SWIG internally uses BCD values
+                        # to encode its version number.
+                        required_swig_vernum=`expr $required_major \* 10000 \
+                            \+ $required_minor \* 100 \+ $required_patch`
+                        available_swig_vernum=`expr $available_major \* 10000 \
+                            \+ $available_minor \* 100 \+ $available_patch`
+
+                        if test $available_swig_vernum -lt $required_swig_vernum; then
+                                { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: SWIG version >= 2.0 is required.  You have $swig_version." >&5
+$as_echo "$as_me: WARNING: SWIG version >= 2.0 is required.  You have $swig_version." >&2;}
+                                SWIG=''
+
+                        else
+                                { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SWIG library" >&5
+$as_echo_n "checking for SWIG library... " >&6; }
+                                SWIG_LIB=`$SWIG -swiglib`
+                                { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SWIG_LIB" >&5
+$as_echo "$SWIG_LIB" >&6; }
+
+                        fi
+                else
+                        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot determine SWIG version" >&5
+$as_echo "$as_me: WARNING: cannot determine SWIG version" >&2;}
+                        SWIG=''
+
+                fi
+        fi
+
+
+
 # DONE WITH PYTHON STUFF
 
 # Checks for programs.
diff --git a/configure.ac b/configure.ac
index a0d3483..60d185a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -57,6 +57,9 @@ AS_IF([test "x$PYTHON" != "x"],
    PC_PYTHON_CHECK_ABI_FLAGS
   ]
 )
+
+AX_PKG_SWIG(2.0)
+
 # DONE WITH PYTHON STUFF
 
 # Checks for programs.
diff --git a/include/GyotoScenery.h b/include/GyotoScenery.h
index 22eb5d8..ce781a3 100644
--- a/include/GyotoScenery.h
+++ b/include/GyotoScenery.h
@@ -485,7 +485,7 @@ class Gyoto::Scenery
   // Override fillProperty() to issue InitCoord only if it was set
   void fillProperty(FactoryMessenger *fmp, Property const &p) const ;
   // Override fillElement to fill metric, screen and astrobj first
-  void fillElement(FactoryMessenger *fmp);
+  void fillElement(FactoryMessenger *fmp) const;
   /// Instanciate Scenery from an XML description.
   static SmartPointer<Scenery> Subcontractor(Gyoto::FactoryMessenger*);
 
diff --git a/lib/Makefile.in b/lib/Makefile.in
index 8987e1d..6d57435 100644
--- a/lib/Makefile.in
+++ b/lib/Makefile.in
@@ -94,11 +94,12 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_append_compile_flags.m4 \
 	$(top_srcdir)/m4/ax_append_flag.m4 \
 	$(top_srcdir)/m4/ax_check_compile_flag.m4 \
 	$(top_srcdir)/m4/ax_cxx_compile_stdcxx_11.m4 \
-	$(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/boost.m4 \
-	$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
-	$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
-	$(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \
-	$(top_srcdir)/m4/python.m4 $(top_srcdir)/configure.ac
+	$(top_srcdir)/m4/ax_pkg_swig.m4 $(top_srcdir)/m4/ax_pthread.m4 \
+	$(top_srcdir)/m4/boost.m4 $(top_srcdir)/m4/libtool.m4 \
+	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+	$(top_srcdir)/m4/pkg.m4 $(top_srcdir)/m4/python.m4 \
+	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
 mkinstalldirs = $(install_sh) -d
@@ -344,6 +345,8 @@ SED = @SED@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 STRIP = @STRIP@
+SWIG = @SWIG@
+SWIG_LIB = @SWIG_LIB@
 SYS = @SYS@
 UDUNITS_CFLAGS = @UDUNITS_CFLAGS@
 UDUNITS_CPPFLAGS = @UDUNITS_CPPFLAGS@
diff --git a/lib/Scenery.C b/lib/Scenery.C
index b67df42..07e573f 100644
--- a/lib/Scenery.C
+++ b/lib/Scenery.C
@@ -71,7 +71,7 @@ void Scenery::fillProperty(Gyoto::FactoryMessenger *fmp,
   } else Object::fillProperty(fmp, p);
 }
 
-void Scenery::fillElement(FactoryMessenger *fmp) {
+void Scenery::fillElement(FactoryMessenger *fmp) const {
   if (metric())     fmp -> metric (metric()) ;
   if (screen_)      fmp -> screen (screen_) ;
   if (astrobj())    fmp -> astrobj (astrobj()) ;
diff --git a/lib/gyoto-uninstalled.pc.in b/lib/gyoto-uninstalled.pc.in
index bb9314c..8cebc4d 100644
--- a/lib/gyoto-uninstalled.pc.in
+++ b/lib/gyoto-uninstalled.pc.in
@@ -13,6 +13,7 @@ Y_INST_HOME=@Y_INST_HOME@
 Y_INST_SITE=@Y_INST_SITE@
 
 PYTHON=@PYTHON@
+SWIG=@SWIG@
 
 HOME_LORENE=@HOME_LORENE@
 LORENECPPFLAGS=@LORENECPPFLAGS@
diff --git a/lib/gyoto.pc.in b/lib/gyoto.pc.in
index 1f2d2b3..e32bbd9 100644
--- a/lib/gyoto.pc.in
+++ b/lib/gyoto.pc.in
@@ -12,6 +12,7 @@ Y_INST_HOME=@Y_INST_HOME@
 Y_INST_SITE=@Y_INST_SITE@
 
 PYTHON=@PYTHON@
+SWIG=@SWIG@
 
 HOME_LORENE=@HOME_LORENE@
 LORENECPPFLAGS=@LORENECPPFLAGS@
diff --git a/m4/ax_pkg_swig.m4 b/m4/ax_pkg_swig.m4
new file mode 100644
index 0000000..d836eec
--- /dev/null
+++ b/m4/ax_pkg_swig.m4
@@ -0,0 +1,135 @@
+# ===========================================================================
+#        http://www.gnu.org/software/autoconf-archive/ax_pkg_swig.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+#   AX_PKG_SWIG([major.minor.micro], [action-if-found], [action-if-not-found])
+#
+# DESCRIPTION
+#
+#   This macro searches for a SWIG installation on your system. If found,
+#   then SWIG is AC_SUBST'd; if not found, then $SWIG is empty.  If SWIG is
+#   found, then SWIG_LIB is set to the SWIG library path, and AC_SUBST'd.
+#
+#   You can use the optional first argument to check if the version of the
+#   available SWIG is greater than or equal to the value of the argument. It
+#   should have the format: N[.N[.N]] (N is a number between 0 and 999. Only
+#   the first N is mandatory.) If the version argument is given (e.g.
+#   1.3.17), AX_PKG_SWIG checks that the swig package is this version number
+#   or higher.
+#
+#   As usual, action-if-found is executed if SWIG is found, otherwise
+#   action-if-not-found is executed.
+#
+#   In configure.in, use as:
+#
+#     AX_PKG_SWIG(1.3.17, [], [ AC_MSG_ERROR([SWIG is required to build..]) ])
+#     AX_SWIG_ENABLE_CXX
+#     AX_SWIG_MULTI_MODULE_SUPPORT
+#     AX_SWIG_PYTHON
+#
+# LICENSE
+#
+#   Copyright (c) 2008 Sebastian Huber <sebastian-huber at web.de>
+#   Copyright (c) 2008 Alan W. Irwin
+#   Copyright (c) 2008 Rafael Laboissiere <rafael at laboissiere.net>
+#   Copyright (c) 2008 Andrew Collier
+#   Copyright (c) 2011 Murray Cumming <murrayc at openismus.com>
+#
+#   This program is free software; you can redistribute it and/or modify it
+#   under the terms of the GNU General Public License as published by the
+#   Free Software Foundation; either version 2 of the License, or (at your
+#   option) any later version.
+#
+#   This program is distributed in the hope that it will be useful, but
+#   WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+#   Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License along
+#   with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+#   As a special exception, the respective Autoconf Macro's copyright owner
+#   gives unlimited permission to copy, distribute and modify the configure
+#   scripts that are the output of Autoconf when processing the Macro. You
+#   need not follow the terms of the GNU General Public License when using
+#   or distributing such scripts, even though portions of the text of the
+#   Macro appear in them. The GNU General Public License (GPL) does govern
+#   all other use of the material that constitutes the Autoconf Macro.
+#
+#   This special exception to the GPL applies to versions of the Autoconf
+#   Macro released by the Autoconf Archive. When you make and distribute a
+#   modified version of the Autoconf Macro, you may extend this special
+#   exception to the GPL to apply to your modified version as well.
+
+#serial 11
+
+AC_DEFUN([AX_PKG_SWIG],[
+        # Ubuntu has swig 2.0 as /usr/bin/swig2.0
+        AC_PATH_PROGS([SWIG],[swig swig2.0])
+        if test -z "$SWIG" ; then
+                m4_ifval([$3],[$3],[:])
+        elif test -n "$1" ; then
+                AC_MSG_CHECKING([SWIG version])
+                [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'`]
+                AC_MSG_RESULT([$swig_version])
+                if test -n "$swig_version" ; then
+                        # Calculate the required version number components
+                        [required=$1]
+                        [required_major=`echo $required | sed 's/[^0-9].*//'`]
+                        if test -z "$required_major" ; then
+                                [required_major=0]
+                        fi
+                        [required=`echo $required | sed 's/[0-9]*[^0-9]//'`]
+                        [required_minor=`echo $required | sed 's/[^0-9].*//'`]
+                        if test -z "$required_minor" ; then
+                                [required_minor=0]
+                        fi
+                        [required=`echo $required | sed 's/[0-9]*[^0-9]//'`]
+                        [required_patch=`echo $required | sed 's/[^0-9].*//'`]
+                        if test -z "$required_patch" ; then
+                                [required_patch=0]
+                        fi
+                        # Calculate the available version number components
+                        [available=$swig_version]
+                        [available_major=`echo $available | sed 's/[^0-9].*//'`]
+                        if test -z "$available_major" ; then
+                                [available_major=0]
+                        fi
+                        [available=`echo $available | sed 's/[0-9]*[^0-9]//'`]
+                        [available_minor=`echo $available | sed 's/[^0-9].*//'`]
+                        if test -z "$available_minor" ; then
+                                [available_minor=0]
+                        fi
+                        [available=`echo $available | sed 's/[0-9]*[^0-9]//'`]
+                        [available_patch=`echo $available | sed 's/[^0-9].*//'`]
+                        if test -z "$available_patch" ; then
+                                [available_patch=0]
+                        fi
+                        # Convert the version tuple into a single number for easier comparison.
+                        # Using base 100 should be safe since SWIG internally uses BCD values
+                        # to encode its version number.
+                        required_swig_vernum=`expr $required_major \* 10000 \
+                            \+ $required_minor \* 100 \+ $required_patch`
+                        available_swig_vernum=`expr $available_major \* 10000 \
+                            \+ $available_minor \* 100 \+ $available_patch`
+
+                        if test $available_swig_vernum -lt $required_swig_vernum; then
+                                AC_MSG_WARN([SWIG version >= $1 is required.  You have $swig_version.])
+                                SWIG=''
+                                m4_ifval([$3],[$3],[])
+                        else
+                                AC_MSG_CHECKING([for SWIG library])
+                                SWIG_LIB=`$SWIG -swiglib`
+                                AC_MSG_RESULT([$SWIG_LIB])
+                                m4_ifval([$2],[$2],[])
+                        fi
+                else
+                        AC_MSG_WARN([cannot determine SWIG version])
+                        SWIG=''
+                        m4_ifval([$3],[$3],[])
+                fi
+        fi
+        AC_SUBST([SWIG_LIB])
+])
diff --git a/python/Makefile.in b/python/Makefile.in
index 20900d6..baf499f 100644
--- a/python/Makefile.in
+++ b/python/Makefile.in
@@ -49,11 +49,16 @@ pkgincludedir = $(includedir)/@PACKAGE_NAME@
 pkgpythondir = @pkgpythondir@
 pkgpyexecdir = @pkgpyexecdir@
 PYTHONPATH = $(pythondir)$(PATH_SEPARATOR)$(DESTDIR)$(pythondir)
+SWIG=@SWIG@
 
 CFITSIO_CFLAGS = @CFITSIO_CFLAGS@
 CFITSIO_LIBS = @CFITSIO_LIBS@
 XERCES_CFLAGS = @XERCES_CFLAGS@
 XERCES_LIBS = @XERCES_LIBS@
+UDUNITS_CFLAGS = @UDUNITS_CFLAGS@
+UDUNITS_CPPFLAGS = @UDUNITS_CPPFLAGS@
+UDUNITS_LDFLAGS = @UDUNITS_LDFLAGS@
+UDUNITS_LIBS = @UDUNITS_LIBS@
 
 CXX=@CXX@
 CC=$(CXX)
@@ -70,9 +75,9 @@ PYTHON_PREFIX = @PYTHON_PREFIX@
 
 FEATURES=@FEATURES@
 
-LDFLAGS=-L../lib/.libs -lgyoto$(FEATURES) $(CFITSIO_LIBS) $(XERCES_LIBS)
-CPPFLAGS=-I../include $(CFITSIO_CFLAGS) $(XERCES_CFLAGS)
-CXXFLAGS=@CXXFLAGS@ $(CFITSIO_CFLAGS) $(XERCES_CFLAGS)
+LDFLAGS=-L../lib/.libs -lgyoto$(FEATURES) $(CFITSIO_LIBS) $(XERCES_LIBS) $(UDUNITS_LIBS)
+CPPFLAGS=-I../include $(CFITSIO_CFLAGS) $(XERCES_CFLAGS) $(UDUNITS_CFLAGS)
+CXXFLAGS=@CXXFLAGS@ $(CFITSIO_CFLAGS) $(XERCES_CFLAGS) $(UDUNITS_CFLAGS)
 CFLAGS=$(CXXFLAGS)
 
 export LDFLAGS
@@ -107,16 +112,16 @@ _gyoto_lorene$(PYTHON_EXTENSION_SUFFIX): gyoto_lorene_wrap.cxx
 	$(PYTHON) $(srcdir)/setup_lorene.py build_ext
 
 gyoto.py gyoto_wrap.cxx: gyoto.i header.py gyoto_doc.i
-	swig2.0 -I$(srcdir)/../include -c++ -python  $(srcdir)/gyoto.i
+	$(SWIG) -I$(srcdir)/../include -c++ -python  $(srcdir)/gyoto.i
 	mv gyoto.py trailer.py
 	cat header.py trailer.py > gyoto.py
 	rm trailer.py
 
 gyoto_std.py gyoto_std_wrap.cxx: gyoto_std.i gyoto.i
-	swig2.0 -I$(srcdir)/../include -c++ -python  $(srcdir)/gyoto_std.i
+	$(SWIG) -I$(srcdir)/../include -c++ -python  $(srcdir)/gyoto_std.i
 
 gyoto_lorene.py gyoto_lorene_wrap.cxx: gyoto_std.i gyoto.i
-	swig2.0 -I$(srcdir)/../include -c++ -python  $(srcdir)/gyoto_lorene.i
+	$(SWIG) -I$(srcdir)/../include -c++ -python  $(srcdir)/gyoto_lorene.i
 
 .PHONY: all install uninstall distclean info install-html html install-pdf pdf install-dvi dvi install-ps ps clean dist check installdirs
 
@@ -156,10 +161,10 @@ uninstall:
 clean:
 	$(PYTHON) setup.py clean
 	-rm -Rf build
-	-rm gyoto*.py gyoto_wrap*.cxx *.pyc gyoto_doc.i
+	-rm gyoto*.py gyoto*_wrap.cxx *.pyc gyoto_doc.i
 
 # Clean up the output of configure
-distclean: 
+distclean: clean 
 	-rm -v $(builddir)/setup*.py
 	-rm -v $(builddir)/Makefile
 
diff --git a/python/gyoto_std.i b/python/gyoto_std.i
index f1712be..3651649 100644
--- a/python/gyoto_std.i
+++ b/python/gyoto_std.i
@@ -11,6 +11,7 @@
 #include "GyotoPhoton.h"
 #include "GyotoScenery.h"
 #include "GyotoSpectrometer.h"
+#include "GyotoUniformSpectrometer.h"
 #include "GyotoComplexSpectrometer.h"
 #include "GyotoValue.h"
 
@@ -41,6 +42,7 @@
 #include "GyotoPowerLawSpectrum.h"
 #include "GyotoBlackBodySpectrum.h"
 #include "GyotoThermalBremsstrahlungSpectrum.h"
+using namespace Gyoto;
 %}
 
 %array_class(double, array_double)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-astro/packages/gyoto.git



More information about the Debian-astro-commits mailing list