On Wed, Apr 09, 2008 at 10:40:30PM -0400, Roberto C. Sánchez wrote:
> 
> > /usr/bin/perl Makefile.PL INSTALLDIRS=vendor
> > No matching config:
> > $VAR1 = {
> >           'compiler_version' => 0,
> >           'compiler_kind' => 'nc'
> >         };
> 
> So, it appears that the Makefile.PL for Wx relies on Alien::wxWidgets to
> tell it about the g++ used to compile wxwidgets.  This is a problem
> because even when the upgrade is ABI compatible (as the 4.2 to 4.3
> upgrade is), then it is possible for this problem to manifest itself.
> 
So, it appears that I was so far off it is not even funny.  The fix was
so trivial as to be stunning.

Basically, what we have is this:

./lib/Alien/wxWidgets/Utility.pm:46:    return    scalar( awx_capture( "$cc 
--version" ) =~ m/gcc/i ) # 3.x
./lib/Alien/wxWidgets/Utility.pm:47:           || scalar( awx_capture( "$cc" ) 
=~ m/gcc/i );          # 2.95

When combined with this:

[EMAIL PROTECTED]:~$ g++ --version
g++ (GCC) 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

[EMAIL PROTECTED]:~$ gcc --version
gcc (Debian 4.3.0-3) 4.3.1 20080401 (prerelease)
Copyright (C) 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

[EMAIL PROTECTED]:~$ g++ --version
g++ (Debian 4.3.0-3) 4.3.1 20080401 (prerelease)
Copyright (C) 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.



Basically, as of version 4.3, g++ does not include the string "gcc" nor
"GCC" in its output, but only "g++".  Given the code on line 46 of
./lib/Alien/wxWidgets/Utility.pm, it is not possible to match the
compiler when using g++ version 4.3, which results in the behavior seen
here:

[EMAIL PROTECTED]:~$ CXX=g++-4.3 perl -MAlien::wxWidgets -MData::Dumper -e 
'$config = Alien::wxWidgets->config; print Dumper $config;'
No matching config:
$VAR1 = {
          'compiler_version' => 0,
          'compiler_kind' => 'nc'
        };
BEGIN failed--compilation aborted.

I have attached a trivial one line patch that fixes the problem.  Please
apply it so that future versions of Alien::wxWidgets work with g++ 4.3
and newer.

Regards,

-Roberto

-- 
Roberto C. Sánchez
http://people.connexer.com/~roberto
http://www.connexer.com
--- libalien-wxwidgets-perl.orig/lib/Alien/wxWidgets/Utility.pm
+++ libalien-wxwidgets-perl/lib/Alien/wxWidgets/Utility.pm
@@ -43,7 +43,7 @@
 sub awx_cc_is_gcc {
     my( $cc ) = @_;
 
-    return    scalar( awx_capture( "$cc --version" ) =~ m/gcc/i ) # 3.x
+    return    scalar( awx_capture( "$cc --version" ) =~ m/g(cc|\+\+)/i ) # 3.x
            || scalar( awx_capture( "$cc" ) =~ m/gcc/i );          # 2.95
 }
 

Attachment: signature.asc
Description: Digital signature

Reply via email to