#254 ✓duplicate
Derek Linz

Swig >= 2.0 is reported as below version 1.3.21

Reported by Derek Linz | February 26th, 2012 @ 02:22 PM | in 1.2.0 Release

Fedora and Ubuntu (at least) are using swig versions above 2.0...here's the fix(I didn't know what else to do with it):

w
commit 595ad5976214c19e21ea22f50057de26c39a81d4
Author: Derek Linz dlinz@chls.selfip.biz
Date: Sun Feb 26 09:19:55 2012 -0500

Update ac_pkg_swig.m4 and configure.ac to accomodate swig 2.0 and higher.

diff --git a/configure.ac b/configure.ac
index cdfaa36..385b4ba 100644
--- a/configure.ac +++ b/configure.ac @@ -59,7 +59,7 @@ AC_ARG_WITH([swig],

        [build_swig=true])

if test "$build_swig" = "true"; then

         AM_PATH_PYTHON(2.3)
  •      AC_PROG_SWIG(1.3.21)
    
  •      AC_PROG_SWIG()
         AX_SWIG_ENABLE_CXX
         SWIG_PYTHON
    
    else diff --git a/m4/ac_pkg_swig.m4 b/m4/ac_pkg_swig.m4
    index 97244bc..3061b47 100644
    --- a/m4/ac_pkg_swig.m4 +++ b/m4/ac_pkg_swig.m4 @@ -1,39 +1,41 @@

    ===========================================================================

    -# http://autoconf-archive.cryp.to/ac_pkg_swig.html +# http://www.gnu.org/software/autoconf-archive/ax_pkg_swig.html

    ===========================================================================

    #

    SYNOPSIS

    # -# AC_PROG_SWIG([major.minor.micro]) +# 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 you -# should call SWIG via $(SWIG). 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.) +# 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. # -# If the version argument is given (e.g. 1.3.17), AC_PROG_SWIG checks that -# the swig package is this version number or higher. +# 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. # -# In configure.in, use as: -# -# AC_PROG_SWIG(1.3.17) -# SWIG_ENABLE_CXX -# SWIG_MULTI_MODULE_SUPPORT -# SWIG_PYTHON +# As usual, action-if-found is executed if SWIG is found, otherwise +# action-if-not-found is executed. # -# LAST MODIFICATION +# In configure.in, use as: # -# 2008-04-12 +# 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 # -# COPYLEFT +# LICENSE #

    Copyright (c) 2008 Sebastian Huber sebastian-huber@web.de

    Copyright (c) 2008 Alan W. Irwin irwin@beluga.phys.uvic.ca

    Copyright (c) 2008 Rafael Laboissiere rafael@laboissiere.net

    Copyright (c) 2008 Andrew Collier colliera@ukzn.ac.za

    +# Copyright (c) 2011 Murray Cumming murrayc@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

    @@ -57,17 +59,19 @@

    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 Macro 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. +# 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.

-AC_DEFUN([AC_PROG_SWIG],[ - AC_PATH_PROG([SWIG],[swig]) +#serial 8 + +AC_DEFUN([AC_PROGo_SWIG],[ + # Ubuntu has swig 2.0 as /usr/bin/swig2.0 + AC_PATH_PROGS([SWIG],[swig swig2.0])

     if test -z "$SWIG" ; then
  •          AC_MSG_WARN([cannot find 'swig' program. You should look at http://www.swig.org] or install your distribution specific swig package.)
    
  •          SWIG=false
    
  •          m4_ifval([$3],[$3],[:])
     elif test -n "$1" ; then
    
  •          AC_MSG_CHECKING([for SWIG version])
    
  •          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
    
    @@ -103,19 +107,28 @@ AC_DEFUN([AC_PROG_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
    
  •                          AC_MSG_WARN([SWIG version >= $1 is required.  You have $swig_version.  You should look at http://www.swig.org])
    
  •                          SWIG=false
    
  •                  # 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_NOTICE([SWIG executable is '$SWIG'])
    
  •                          AC_MSG_CHECKING([for SWIG library])
                             SWIG_LIB=`$SWIG -swiglib`
    
  •                          AC_MSG_NOTICE([SWIG library directory is '$SWIG_LIB'])
    
  •                          AC_MSG_RESULT([$SWIG_LIB])
    
  •                          m4_ifval([$2],[$2],[])
                     fi
             else
                     AC_MSG_WARN([cannot determine SWIG version])
    
  •                  SWIG=false
    
  •                  SWIG=''
    
  •                  m4_ifval([$3],[$3],[])
             fi
     fi
     AC_SUBST([SWIG_LIB])
    

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

A project around supporting the iPhone in Linux.

See http://libimobiledevice.org

People watching this ticket

Tags

Pages