diff --git a/inc/GSLBuilder.pm b/inc/GSLBuilder.pm index 6977c7c..dac3ab0 100644 --- a/inc/GSLBuilder.pm +++ b/inc/GSLBuilder.pm @@ -207,6 +207,12 @@ sub compile_swig { my @swig_flags = defined($p->{swig_flags}) ? $self->split_like_shell($p->{swig_flags}) : (); push @swig_flags, "-I./include"; my ($major, $minor, $numerical_ver) = reformat_version($ver); + if ($numerical_ver =~ /^0+$/) { + die "Unexpected swig version: $ver"; + } + else { + $numerical_ver =~ s/^0+//; # Swig seems to have problems with leading zeros + } push @swig_flags, "-DMG_GSL_MAJOR_VERSION=$major", "-DMG_GSL_MINOR_VERSION=$minor", "-DMG_GSL_VERSION=\"$major.$minor\"", diff --git a/swig/SparseMatrix.i b/swig/SparseMatrix.i index 5442473..50005be 100644 --- a/swig/SparseMatrix.i +++ b/swig/SparseMatrix.i @@ -9,7 +9,13 @@ #include "gsl/gsl_spmatrix.h" %} -#if MG_GSL_NUM_VERSION >= 002006 +#if MG_GSL_NUM_VERSION >= 2006 +%warn "Including new GSL headers"; +#else +%warn "Including legacy GSL headers"; +#endif + +#if MG_GSL_NUM_VERSION >= 2006 // ignore gsl_spmatrix_uchar_norm1, gsl_spmatrix_char_norm1, ... %rename("%(regex:/^gsl_spmatrix_u.*_norm1$/$ignore/)s") ""; %include "gsl/gsl_spmatrix.h"