On Sat, Apr 12, 2008 at 02:15:06PM -0400, Roberto C. Sánchez wrote: > > 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. > So it turns out to have been slightly more complex than that. In practice, Debian (and I am sure other distros) create a symlink at /usr/bin/cc (or something similar) that points to their "favorite" C or C++ compiler. Debian does this so that in practice, automated builds fail because with gcc/g++ 4.3, the program only outputs $0 as the program string. So, there is no guarantee that the "gcc" or "g++" will appear in the output unless that is explicitely how you call it.
I have attached a slightly more complete patch that changes occurrences
of $Config{cc} to $Config{ccname}. From the Config.pm documentation:
"ccname"
From Checkcc.U:
This can set either by hints files or by Configure. If using
gcc, this is gcc, and if not, usually equal to cc,
unimpressive, no? Some platforms, however, make good use of
this by storing the flavor of the C compiler being used here.
For example if using the Sun WorkShop suite, ccname will be
"workshop".
It appears to me that this is the desired information.
Please apply the attached patch.
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
}
@@ -184,7 +184,7 @@
# the key already identifies the configuration
return %args if $args{key};
- my $cc = $ENV{CXX} || $ENV{CC} || $Config{cc};
+ my $cc = $ENV{CXX} || $ENV{CC} || $Config{ccname};
my $kind = awx_compiler_kind( $cc );
my $version = awx_cc_abi_version( $cc );
--- libalien-wxwidgets-perl.orig/inc/My/Build/Any_wx_config.pm
+++ libalien-wxwidgets-perl/inc/My/Build/Any_wx_config.pm
@@ -183,7 +183,7 @@
sub _key {
my $self = shift;
- my $compiler = $ENV{CXX} || $Config{cc};
+ my $compiler = $ENV{CXX} || $Config{ccname};
my $key = $self->awx_get_name
( toolkit => $self->awx_build_toolkit,
version => $self->_version_2_dec
--- libalien-wxwidgets-perl.orig/inc/My/Build/Win32.pm
+++ libalien-wxwidgets-perl/inc/My/Build/Win32.pm
@@ -204,7 +204,7 @@
return 'WinCE' if $INC{'Cross.pm'};
SWITCH: {
- local $_ = $Config{cc};
+ local $_ = $Config{ccname};
/^cl/i and $package = 'Win32_MSVC' and last SWITCH;
/^gcc/i and $package = 'Win32_MinGW' and last SWITCH;
signature.asc
Description: Digital signature
