Hello community,
here is the log from the commit of package perl-ExtUtils-CppGuess for
openSUSE:Factory checked in at 2015-09-11 09:04:40
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/perl-ExtUtils-CppGuess (Old)
and /work/SRC/openSUSE:Factory/.perl-ExtUtils-CppGuess.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-ExtUtils-CppGuess"
Changes:
--------
---
/work/SRC/openSUSE:Factory/perl-ExtUtils-CppGuess/perl-ExtUtils-CppGuess.changes
2015-04-16 14:13:32.000000000 +0200
+++
/work/SRC/openSUSE:Factory/.perl-ExtUtils-CppGuess.new/perl-ExtUtils-CppGuess.changes
2015-09-11 09:04:47.000000000 +0200
@@ -1,0 +2,9 @@
+Thu Sep 10 09:39:07 UTC 2015 - [email protected]
+
+- updated to 0.10
+ see /usr/share/doc/packages/perl-ExtUtils-CppGuess/Changes
+
+ 0.10 Tue Sep 11 21:15:30 MDT 2015
+ - Config's ccflags must always be used. (bulk88)
+
+-------------------------------------------------------------------
Old:
----
ExtUtils-CppGuess-0.09.tar.gz
New:
----
ExtUtils-CppGuess-0.10.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ perl-ExtUtils-CppGuess.spec ++++++
--- /var/tmp/diff_new_pack.uUhlvU/_old 2015-09-11 09:04:48.000000000 +0200
+++ /var/tmp/diff_new_pack.uUhlvU/_new 2015-09-11 09:04:48.000000000 +0200
@@ -17,14 +17,14 @@
Name: perl-ExtUtils-CppGuess
-Version: 0.09
+Version: 0.10
Release: 0
%define cpan_name ExtUtils-CppGuess
Summary: Guess C++ Compiler and Flags
License: Artistic-1.0 or GPL-1.0+
Group: Development/Libraries/Perl
Url: http://search.cpan.org/dist/ExtUtils-CppGuess/
-Source0:
http://www.cpan.org/authors/id/E/ET/ETJ/%{cpan_name}-%{version}.tar.gz
+Source0:
http://www.cpan.org/authors/id/D/DA/DAVIDO/%{cpan_name}-%{version}.tar.gz
Source1: cpanspec.yml
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: perl
++++++ ExtUtils-CppGuess-0.09.tar.gz -> ExtUtils-CppGuess-0.10.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/ExtUtils-CppGuess-0.09/Changes
new/ExtUtils-CppGuess-0.10/Changes
--- old/ExtUtils-CppGuess-0.09/Changes 2015-04-11 17:08:52.000000000 +0200
+++ new/ExtUtils-CppGuess-0.10/Changes 2015-09-09 06:16:33.000000000 +0200
@@ -1,5 +1,8 @@
Revision history for Perl extension ExtUtils::CppGuess.
+0.10 Tue Sep 11 21:15:30 MDT 2015
+ - Config's ccflags must always be used. (bulk88)
+
0.09 Sat Apr 11 16:05:50 BST 2015
- Convert to EUMM
- Make tests divulge guessed options for better debugging
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/ExtUtils-CppGuess-0.09/MANIFEST
new/ExtUtils-CppGuess-0.10/MANIFEST
--- old/ExtUtils-CppGuess-0.09/MANIFEST 2015-04-11 17:10:39.000000000 +0200
+++ new/ExtUtils-CppGuess-0.10/MANIFEST 2015-09-09 06:19:41.000000000 +0200
@@ -2,6 +2,8 @@
Changes
MANIFEST This list of files
README
+META.json
+META.yml
lib/ExtUtils/CppGuess.pm
t/001_load.t
t/010_module_build.t
@@ -15,5 +17,3 @@
t/module/t/001_load.t
t/module/t/002_base.t
t/module/typemap
-META.yml Module YAML meta-data (added by
MakeMaker)
-META.json Module JSON meta-data (added by
MakeMaker)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/ExtUtils-CppGuess-0.09/META.json
new/ExtUtils-CppGuess-0.10/META.json
--- old/ExtUtils-CppGuess-0.09/META.json 2015-04-11 17:10:39.000000000
+0200
+++ new/ExtUtils-CppGuess-0.10/META.json 2015-09-09 06:20:23.000000000
+0200
@@ -4,7 +4,7 @@
"unknown"
],
"dynamic_config" : 1,
- "generated_by" : "ExtUtils::MakeMaker version 7.052, CPAN::Meta::Converter
version 2.150001",
+ "generated_by" : "ExtUtils::MakeMaker version 7.0401, CPAN::Meta::Converter
version 2.150001",
"license" : [
"perl_5"
],
@@ -58,6 +58,5 @@
"web" : "https://github.com/tsee/extutils-cppguess"
}
},
- "version" : "0.09"
+ "version" : "0.10"
}
-
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/ExtUtils-CppGuess-0.09/META.yml
new/ExtUtils-CppGuess-0.10/META.yml
--- old/ExtUtils-CppGuess-0.09/META.yml 2015-04-11 17:10:39.000000000 +0200
+++ new/ExtUtils-CppGuess-0.10/META.yml 2015-09-09 06:20:23.000000000 +0200
@@ -15,7 +15,7 @@
configure_requires:
ExtUtils::MakeMaker: '0'
dynamic_config: 1
-generated_by: 'ExtUtils::MakeMaker version 7.052, CPAN::Meta::Converter
version 2.150001'
+generated_by: 'ExtUtils::MakeMaker version 7.0401, CPAN::Meta::Converter
version 2.150001'
license: perl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -30,5 +30,4 @@
File::Basename: '0'
resources:
repository: git://github.com/tsee/extutils-cppguess
-version: '0.09'
-
+version: '0.10'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/ExtUtils-CppGuess-0.09/lib/ExtUtils/CppGuess.pm
new/ExtUtils-CppGuess-0.10/lib/ExtUtils/CppGuess.pm
--- old/ExtUtils-CppGuess-0.09/lib/ExtUtils/CppGuess.pm 2015-04-11
17:08:52.000000000 +0200
+++ new/ExtUtils-CppGuess-0.10/lib/ExtUtils/CppGuess.pm 2015-09-09
06:17:03.000000000 +0200
@@ -111,84 +111,128 @@
use File::Basename qw();
use Capture::Tiny 'capture_merged';
-our $VERSION = '0.09';
+our $VERSION = '0.10';
sub new {
my( $class, %args ) = @_;
- my $self = bless {
- cc => $Config::Config{cc},
- %args
- }, $class;
+ my $self = bless { %args }, $class;
+
+ # Allow override of default %Config::Config; useful in testing.
+ if( ! exists $self->{config} || ! defined $self->{config} ) {
+ $self->{config} = \%Config::Config;
+ }
+
+ # Allow a 'cc' %args. If not supplied, pull from {config}, or $Config{cc}.
+ if( ! exists $self->{cc} || ! defined $self->{cc} ) {
+ $self->{cc}
+ = exists $self->{config}{cc} && defined $self->{config}{cc}
+ ? $self->{config}{cc}
+ : $Config::Config{cc};
+ }
+
+ # Set up osname.
+ if( ! exists $self->{os} || ! defined $self->{os} ) {
+ $self->{os}
+ = exists $self->{config}{osname} && defined $self->{config}{osname}
+ ? $self->{config}{osname}
+ : $^O;
+ }
return $self;
}
+# Thus saith the law: All references to %Config::Config shall come through
+# $self->_config. Accessors shall provide access to key components thereof.
+# Testing shall thus grow stronger, verifying performance for platforms diverse
+# to which access we have not.
+
+sub _config { shift->{config} }
+sub _cc { shift->{cc} }
+sub _os { shift->{os} }
+
+
sub guess_compiler {
- my( $self ) = @_;
+ my $self = shift;
+
return $self->{guess} if $self->{guess};
- if( $^O =~ /^mswin/i ) {
- $self->_guess_win32() or return();
+ if( $self->_os =~ /^mswin/i ) {
+ $self->_guess_win32() or return;
} else {
- $self->_guess_unix() or return();
+ $self->_guess_unix() or return;
}
-
return $self->{guess};
}
+
sub _get_cflags {
- my( $self ) = @_;
- $self->guess_compiler || die;
- my $cflags = $self->{guess}{extra_cflags};
+ my $self = shift;
+
+ $self->guess_compiler or die;
+
+ my $cflags = $self->_config->{ccflags};
+ $cflags .= ' ' . $self->{guess}{extra_cflags};
$cflags .= ' ' . $self->{extra_compiler_flags}
if defined $self->{extra_compiler_flags};
+
return $cflags;
}
+
sub _get_lflags {
- my( $self ) = @_;
+ my $self = shift;
+
$self->guess_compiler || die;
+
my $lflags = $self->{guess}{extra_lflags};
$lflags .= ' ' . $self->{extra_linker_flags}
if defined $self->{extra_linker_flags};
+
return $lflags;
}
+
sub makemaker_options {
- my( $self ) = @_;
+ my $self = shift;
my $lflags = $self->_get_lflags;
my $cflags = $self->_get_cflags;
- return ( CCFLAGS => $cflags,
- dynamic_lib => { OTHERLDFLAGS => $lflags },
- );
+ return (
+ CCFLAGS => $cflags,
+ dynamic_lib => { OTHERLDFLAGS => $lflags },
+ );
}
+
sub module_build_options {
- my( $self ) = @_;
+ my $self = shift;
my $lflags = $self->_get_lflags;
my $cflags = $self->_get_cflags;
- return ( extra_compiler_flags => $cflags,
- extra_linker_flags => $lflags,
- );
+ return (
+ extra_compiler_flags => $cflags,
+ extra_linker_flags => $lflags,
+ );
}
+
sub _guess_win32 {
- my( $self ) = @_;
- my $c_compiler = $self->{cc};
- $c_compiler = $Config::Config{cc} if not defined $c_compiler;
+ my $self = shift;
+ my $c_compiler = $self->_cc;
+# $c_compiler = $Config::Config{cc} if not defined $c_compiler;
if( $self->_cc_is_gcc( $c_compiler ) ) {
- $self->{guess} = { extra_cflags => ' -xc++ ',
- extra_lflags => ' -lstdc++ ',
- };
+ $self->{guess} = {
+ extra_cflags => ' -xc++ ',
+ extra_lflags => ' -lstdc++ ',
+ };
} elsif( $self->_cc_is_msvc( $c_compiler ) ) {
- $self->{guess} = { extra_cflags => ' -TP -EHsc ',
- extra_lflags => ' msvcprt.lib ',
- };
+ $self->{guess} = {
+ extra_cflags => ' -TP -EHsc ',
+ extra_lflags => ' msvcprt.lib ',
+ };
} else {
die "Unable to determine a C++ compiler for '$c_compiler'";
}
@@ -196,94 +240,105 @@
return 1;
}
+
sub _guess_unix {
- my( $self ) = @_;
- my $c_compiler = $self->{cc};
- $c_compiler = $Config::Config{cc} if not defined $c_compiler;
+ my $self = shift;
+ my $c_compiler = $self->_cc;
+# $c_compiler = $Config::Config{cc} if not defined $c_compiler;
if( !$self->_cc_is_gcc( $c_compiler ) ) {
die "Unable to determine a C++ compiler for '$c_compiler'";
}
- $self->{guess} = { extra_cflags => ' -xc++ ',
- extra_lflags => ' -lstdc++ ',
- };
- $self->{guess}{extra_cflags} .= ' -D_FILE_OFFSET_BITS=64' if
$Config::Config{ccflags} =~ /-D_FILE_OFFSET_BITS=64/;
- $self->{guess}{extra_lflags} .= ' -lgcc_s' if $^O eq 'netbsd' &&
$self->{guess}{extra_lflags} !~ /-lgcc_s/;
+ $self->{guess} = {
+ extra_cflags => ' -xc++ ',
+ extra_lflags => ' -lstdc++ ',
+ };
+ $self->{guess}{extra_lflags} .= ' -lgcc_s'
+ if $self->_os eq 'netbsd' && $self->{guess}{extra_lflags} !~ /-lgcc_s/;
+
return 1;
}
# originally from Alien::wxWidgets::Utility
-
-my $quotes = $^O =~ /MSWin32/ ? '"' : "'";
+# Why was this hanging around outside of all functions, and without any other
+# use of $quotes?
+# my $quotes = $self->_os =~ /MSWin32/ ? '"' : "'";
sub _capture {
my @cmd = @_;
- my $out = capture_merged {
- system(@cmd);
- };
+
+ my $out = capture_merged { system(@cmd) };
$out = '' if not defined $out;
+
return $out;
}
# capture the output of a command that is run with piping
# to stdin of the command. We immediately close the pipe.
sub _capture_empty_stdin {
- my( $cmd ) = @_;
+ my $cmd = shift;
my $out = capture_merged {
- if (open(my $fh, '|-', $cmd)) {
+ if ( open my $fh, '|-', $cmd ) {
close $fh;
}
};
$out = '' if not defined $out;
+
return $out;
}
sub _cc_is_msvc {
my( $self, $cc ) = @_;
- $self->{is_msvc} = ($^O =~ /MSWin32/ and File::Basename::basename( $cc )
=~ /^cl/i);
+ $self->{is_msvc}
+ = ($self->_os =~ /MSWin32/ and File::Basename::basename($cc) =~ /^cl/i);
return $self->{is_msvc};
}
+
sub _cc_is_gcc {
my( $self, $cc ) = @_;
$self->{is_gcc} = 0;
my $cc_version = _capture( "$cc --version" );
if (
- $cc_version =~ m/\bg(?:cc|\+\+)/i # 3.x, some 4.x
- || scalar( _capture( "$cc" ) =~ m/\bgcc\b/i ) # 2.95
- || scalar(_capture_empty_stdin("$cc -dM -E -") =~ /__GNUC__/) # more
or less universal?
- || scalar($cc_version =~ m/\bcc\b.*Free Software Foundation/si) #
some 4.x?
- )
- {
- $self->{is_gcc} = 1;
+ $cc_version =~ m/\bg(?:cc|\+\+)/i # 3.x, some 4.x
+ || scalar( _capture( "$cc" ) =~ m/\bgcc\b/i ) # 2.95
+ || scalar(_capture_empty_stdin("$cc -dM -E -") =~ /__GNUC__/) # more or
less universal?
+ || scalar($cc_version =~ m/\bcc\b.*Free Software Foundation/si) # some
4.x?
+ ) {
+ $self->{is_gcc} = 1;
}
return $self->{is_gcc};
}
+
sub is_gcc {
- my( $self ) = @_;
+ my $self = shift;
$self->guess_compiler || die;
return $self->{is_gcc};
}
sub is_msvc {
- my( $self ) = @_;
+ my $self = shift;
+
$self->guess_compiler || die;
+
return $self->{is_msvc};
}
sub add_extra_compiler_flags {
my( $self, $string ) = @_;
+
$self->{extra_compiler_flags}
= defined($self->{extra_compiler_flags})
? $self->{extra_compiler_flags} . ' ' . $string
: $string;
}
+
sub add_extra_linker_flags {
my( $self, $string ) = @_;
$self->{extra_linker_flags}
@@ -292,4 +347,5 @@
: $string;
}
+
1;