bugSimulavr: an AVR simulator - Bugs: bug #30584, failed to configure with swig 2.0.0

 
 

bug #30584: failed to configure with swig 2.0.0

Submitter:  Jiři Pinkava <pinky>
Submitted:  Thu 29 Jul 2010 03:43:04 AM UTC
   
 
Category:  Configure Severity:  3 - Normal
Item Group:  None Status:  Postponed
Privacy:  Public Assigned to:  tomk
Open/Closed:  Closed Component Version:  * simulavr
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Wed 14 Sep 2011 08:14:34 PM UTC, comment #6: 

Although this was marked as wontfix by Thomas K. <tomk> in comment #1 I think "Postponed" status would be more appropriate.
Also Ubuntu 11.10 will finally ship with SWIG 2.0. [1]
Unless the patch does allow older versions of SWIG.

Does it allow older versions of SWIG?
(I cannot read autoconf/m4 macros.)

[1] http://packages.ubuntu.com/search?keywords=swig

Petr Hluzin <petrh>
Group Member
Tue 08 Feb 2011 10:40:48 PM UTC, comment #5: 

Er, that was a horribly incomplete version of what's needed. My apologies.

Basically, all of the swig and python macros should be updated: http://www.gnu.org/software/autoconf-archive/The-Macros.html#The-Macros

The rest are probably a bit outdated at this point as well, and could likely use a refresh. (Although that will probably generate a significant amount of new work.) Once that's done, this is what the patch to configure.ac and src/Makefile.am ends up looking like:


diff --git a/configure.ac b/configure.ac
index c785e5f..dc0b53e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -27,9 +27,9 @@ fi
 LT_INIT
 LT_PREREQ([2.2])
 AC_PROG_CXX
-AC_PROG_SWIG(1.3.18)
-SWIG_ENABLE_CXX
-SWIG_MULTI_MODULE_SUPPORT
+AX_PKG_SWIG(1.3.18)
+AX_SWIG_ENABLE_CXX
+AX_SWIG_MULTI_MODULE_SUPPORT
 AM_CONDITIONAL([USE_SWIG],[test "x$SWIG" != 'x'])

 ####
@@ -41,11 +41,11 @@ AX_TCL_ENVIRONMENT
 ####
 # python support, used for regression test and python module
 ####
-AZ_PYTHON_DEFAULT
-AZ_PYTHON_ENABLE
-AZ_PYTHON_VERSION_ENSURE([2.4.0])
-SWIG_PYTHON
-AM_PATH_PYTHON
+AX_PYTHON_DEFAULT
+AX_PYTHON_ENABLE
+AX_PYTHON_VERSION_ENSURE([2.4.0])
+AX_SWIG_PYTHON
+AX_PYTHON_PATH

 ###
 # Regression test suite support programs
diff --git a/src/Makefile.am b/src/Makefile.am
index fa47240..cec8de8 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -39,7 +39,7 @@ lib_pysimulavr_la_LIBADD= libsim.la \
   -L$(AVR_LIBBFD_LIBPATH) -lbfd -L$(AVR_LIBIBERTY_LIBPATH) -liberty

 pysimulavr_wrap.cpp: $(PYTHON_MODUL_INTERFACE)
-       $(SWIG) $(SWIG_PYTHON_OPT) $(PYTHON_XTRA_INC) -o $@ $?
+       $(SWIG) $(AX_SWIG_PYTHON_OPT) $(PYTHON_XTRA_INC) -o $@ $?

 $(PYTHON_MODUL_LIB): lib_pysimulavr.la
 if SYS_MINGW


This gets me through a "make dist". "make distcheck" is failing for an unrelated reason, but

Ed Marshall <logic>
Tue 08 Feb 2011 09:51:37 PM UTC, comment #4: 

Just FYI: the latest version of latest version of ax_pkg_swig.m4 fixes this.

configure.ac needs the following patch, once ac_pkg_swig.m4 is removed and ax_pkg_swig.m4 added:


diff --git a/configure.ac b/configure.ac
index c785e5f..c8fb533 100644
--- a/configure.ac
+++ b/configure.ac
@@ -27,9 +27,9 @@ fi
 LT_INIT
 LT_PREREQ([2.2])
 AC_PROG_CXX
-AC_PROG_SWIG(1.3.18)
-SWIG_ENABLE_CXX
-SWIG_MULTI_MODULE_SUPPORT
+AX_PROG_SWIG(1.3.18)
+AX_SWIG_ENABLE_CXX
+AX_SWIG_MULTI_MODULE_SUPPORT
 AM_CONDITIONAL([USE_SWIG],[test "x$SWIG" != 'x'])

 ####


Ed Marshall <logic>
Sat 11 Dec 2010 01:09:05 AM UTC, comment #3: 

sorry, pasting that diff was a terrible idea. very hard to read so i attached it.


(file #22177)

mela <resixian>
Sat 11 Dec 2010 01:05:59 AM UTC, comment #2: 

This is also a problem for me (Arch linux has swig 2.x)

Is this a more acceptable approach?

diff --git a/m4/ac_pkg_swig.m4 b/m4/ac_pkg_swig.m4
index cf55025..bab036a 100644
--- a/m4/ac_pkg_swig.m4
+++ b/m4/ac_pkg_swig.m4
@@ -75,7 +75,7 @@ AC_DEFUN([AC_PROG_SWIG],[
                 SWIG='echo "Error: SWIG is not installed. You should look at http://www.swig.org" ; false'
         elif test -n "$1" ; then
                 AC_MSG_CHECKING([for 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'`]
+                [swig_version=`$SWIG -version 2>&1 | grep 'SWIG Version' | sed 's/^[^0-9]*\([0-9.]*\).*$/\1/'` ]
                 AC_MSG_RESULT([$swig_version])
                 if test -n "$swig_version" ; then
                         # Calculate the required version number components
@@ -110,14 +110,21 @@ 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
+
+                        # Determine suitability.
+                        unset SWIG_LIB
+                        if test $available_major -gt $required_major; then
+                                SWIG_LIB=`$SWIG -swiglib`
+                        elif test $available_minor -gt $required_minor; then
+                                SWIG_LIB=`$SWIG -swiglib`
+                        elif test $available_patch -gt $required_patch; then
+                                SWIG_LIB=`$SWIG -swiglib`
+                        else
                                 AC_MSG_WARN([SWIG version >= $1 is required.  You have $swig_version.  You should look at http://www.swig.org])
                                 SWIG='echo "Error: SWIG version >= $1 is required.  You have '"$swig_version"'.  You should look at http://www.swig.org" ; false'
-                        else
                                 AC_MSG_NOTICE([SWIG executable is '$SWIG'])
-                                SWIG_LIB=`$SWIG -swiglib`
+                        fi
+                        if test -n $SWIG_LIB  ; then
                                 AC_MSG_NOTICE([SWIG library directory is '$SWIG_LIB'])
                         fi
                 else

mela <resixian>
Sun 01 Aug 2010 06:51:25 AM UTC, comment #1: 

Hi Jiri,

thanks for your patch. But in the moment it wouldn't a good idea to implement your patch. It would block building simulavr for the most people! Because SWIG 2.x is to fresh to occour in the most distributions. Even my Ubuntu 10.04 has a version of 1.3.x and if I'd implement your path, I couldn't build it anymore.

So, the best variant for the moment is to hols this patch in your git stash or change it, if necessary. configure.ac isn't often changed, so its not a big work ... :-)

Maybe in future, if distributions support SWIG 2.x and we get more requests, it's necessary to change. But then, I think, it's more usefull to change the m4 macro to support 1.3.x AND 2.x in simulavr or to switch it with a option in configure.

Thomas K. <tomk>
Group administrator
Thu 29 Jul 2010 03:43:04 AM UTC, original submission:  

Failed to configure with swig 2.0, but when changed by below included patch it works fine.

configl.log:
WARNING: SWIG version >= 1.3.18 is required.  You have 2.0.0.  You should look at http://www.swig.org

make:
make[3]: Entering directory `/home/work/work/simulavr/src'
echo "Error: SWIG version >= 1.3.18 is required.  You have 2.0.0.  You should look at http://www.swig.org" ; false -c++ -o simulavr_wrap.cxx ./simulavr.i
Error: SWIG version >= 1.3.18 is required.  You have 2.0.0.  You should look at http://www.swig.org
make[3]: * [simulavr_wrap.cxx] Error 1

diff --git a/configure.ac b/configure.ac
index c785e5f..98f5448 100644
--- a/configure.ac
+++ b/configure.ac
@@ -27,7 +27,7 @@ fi
 LT_INIT
 LT_PREREQ([2.2])
 AC_PROG_CXX
-AC_PROG_SWIG(1.3.18)
+AC_PROG_SWIG(2.0.0)
 SWIG_ENABLE_CXX
 SWIG_MULTI_MODULE_SUPPORT
 AM_CONDITIONAL([USE_SWIG],[test "x$SWIG" != 'x'])

Jiři Pinkava <pinky>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #22177:  swigpatch.diff added by resixian (2KiB - text/plain)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by petrh (Posted a comment)
  • -email is unavailable- added by logic (Posted a comment)
  • -email is unavailable- added by resixian (Posted a comment)
  • -email is unavailable- added by tomk (Updated the item)
  • -email is unavailable- added by pinky (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2011-09-14 petrh StatusWont Fix Postponed
    2010-12-11 resixian Attached File- Added swigpatch.diff, #22177
    2010-08-01 tomk Open/ClosedOpen Closed
    2010-08-01 tomk StatusNone Wont Fix
        Assigned toNone tomk

    Back to the top

    Powered by Savane 3.13-aa77.
    Corresponding source code