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

Submitted by:  Jiři Pinkava <pinky>
Submitted on:  Thu 29 Jul 2010 03:43:04 AM UTC  
 
Category: ConfigureSeverity: 3 - Normal
Item Group: NoneStatus: Postponed
Privacy: PublicAssigned to: Thomas K. <tomk>
Open/Closed: ClosedComponent Version: simulavr

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission 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>
Project 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:

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:

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>
Project AdministratorIn charge of this item.
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 File(s):
   
   
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
  • -unavailable- added by petrh (Posted a comment)
  • -unavailable- added by logic (Posted a comment)
  • -unavailable- added by resixian (Posted a comment)
  • -unavailable- added by tomk (Updated the item)
  • -unavailable- added by pinky (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 14 Sep 2011 08:14:34 PM UTCpetrhStatusWont Fix=>Postponed
    Sat 11 Dec 2010 01:09:05 AM UTCresixianAttached File-=>Added swigpatch.diff, #22177
    Sun 01 Aug 2010 07:00:13 AM UTCtomkOpen/ClosedOpen=>Closed
    Sun 01 Aug 2010 06:43:10 AM UTCtomkStatusNone=>Wont Fix
      Assigned toNone=>tomk

    Back to the top


    Powered by Savane 3.1-cleanup1