summaryrefslogtreecommitdiff
path: root/m4/ax_pkg_swig.m4
diff options
context:
space:
mode:
authorTorsten Landschoff <torsten@landschoff.net>2010-05-13 20:00:51 +0200
committerPeter Simons <simons@cryp.to>2010-05-14 12:40:52 +0200
commita30921d407d4cfc9343809cfad4acbae6ef6f6d8 (patch)
tree091ac1538949e00867337147a3efd53fcaa5e1f3 /m4/ax_pkg_swig.m4
parent9e3bd0889a454a7d34d57e73d36858b6ff8c09cc (diff)
downloadautoconf-archive-a30921d407d4cfc9343809cfad4acbae6ef6f6d8.tar.gz
AX_PKG_SWIG: Fix the version detection of AX_PKG_SWIG to support SWIG >= 2.0.
The version detection in the AX_PKG_SWIG macro was incorrect and failed to accept SWIG 2.0 where SWIG >= 1.3.x is requested. Patch submitted in <http://savannah.gnu.org/patch/?7187>.
Diffstat (limited to 'm4/ax_pkg_swig.m4')
-rw-r--r--m4/ax_pkg_swig.m414
1 files changed, 10 insertions, 4 deletions
diff --git a/m4/ax_pkg_swig.m4 b/m4/ax_pkg_swig.m4
index 88da5ee..81226fb 100644
--- a/m4/ax_pkg_swig.m4
+++ b/m4/ax_pkg_swig.m4
@@ -62,7 +62,7 @@
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.
-#serial 6
+#serial 7
AC_DEFUN([AX_PKG_SWIG],[
AC_PATH_PROG([SWIG],[swig])
@@ -105,9 +105,15 @@ AC_DEFUN([AX_PKG_SWIG],[
if test -z "$available_patch" ; then
[available_patch=0]
fi
- if test $available_major -ne $required_major \
- -o $available_minor -ne $required_minor \
- -o $available_patch -lt $required_patch ; then
+ # 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],[])