r60287 - in /branches/upstream/libmodule-install-xsutil-perl/current: ./ example/ inc/Module/ inc/Module/Install/ lib/Module/Install/

ansgar-guest at users.alioth.debian.org ansgar-guest at users.alioth.debian.org
Wed Jul 14 11:28:25 UTC 2010


Author: ansgar-guest
Date: Wed Jul 14 11:28:14 2010
New Revision: 60287

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=60287
Log:
[svn-upgrade] new version libmodule-install-xsutil-perl (0.25)

Modified:
    branches/upstream/libmodule-install-xsutil-perl/current/Changes
    branches/upstream/libmodule-install-xsutil-perl/current/META.yml
    branches/upstream/libmodule-install-xsutil-perl/current/example/MyMakefile.PL
    branches/upstream/libmodule-install-xsutil-perl/current/inc/Module/Install.pm
    branches/upstream/libmodule-install-xsutil-perl/current/inc/Module/Install/Base.pm
    branches/upstream/libmodule-install-xsutil-perl/current/inc/Module/Install/Makefile.pm
    branches/upstream/libmodule-install-xsutil-perl/current/inc/Module/Install/Metadata.pm
    branches/upstream/libmodule-install-xsutil-perl/current/inc/Module/Install/WriteAll.pm
    branches/upstream/libmodule-install-xsutil-perl/current/lib/Module/Install/XSUtil.pm

Modified: branches/upstream/libmodule-install-xsutil-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmodule-install-xsutil-perl/current/Changes?rev=60287&op=diff
==============================================================================
--- branches/upstream/libmodule-install-xsutil-perl/current/Changes (original)
+++ branches/upstream/libmodule-install-xsutil-perl/current/Changes Wed Jul 14 11:28:14 2010
@@ -1,4 +1,8 @@
 Revision history for Perl extension Module::Install::XSUtil
+
+0.25 Tue Jul 13 19:43:34 2010
+    - Add requires_c99() to assert that the compiler supports C99
+    - Fix Win32 problems, hopefully
 
 0.24 Sun May 16 13:24:58 2010
     - Compliant with Module::Install 0.97

Modified: branches/upstream/libmodule-install-xsutil-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmodule-install-xsutil-perl/current/META.yml?rev=60287&op=diff
==============================================================================
--- branches/upstream/libmodule-install-xsutil-perl/current/META.yml (original)
+++ branches/upstream/libmodule-install-xsutil-perl/current/META.yml Wed Jul 14 11:28:14 2010
@@ -12,7 +12,7 @@
 configure_requires:
   ExtUtils::MakeMaker: 6.42
 distribution_type: module
-generated_by: 'Module::Install version 0.97'
+generated_by: 'Module::Install version 1.00'
 license: perl
 meta-spec:
   url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -31,4 +31,4 @@
 resources:
   license: http://dev.perl.org/licenses/
   repository: git://github.com/gfx/Perl-Module-Install-XSUtil.git
-version: 0.24
+version: 0.25

Modified: branches/upstream/libmodule-install-xsutil-perl/current/example/MyMakefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmodule-install-xsutil-perl/current/example/MyMakefile.PL?rev=60287&op=diff
==============================================================================
--- branches/upstream/libmodule-install-xsutil-perl/current/example/MyMakefile.PL (original)
+++ branches/upstream/libmodule-install-xsutil-perl/current/example/MyMakefile.PL Wed Jul 14 11:28:14 2010
@@ -5,6 +5,7 @@
 use FindBin qw($Bin);
 use File::Spec;
 use lib File::Spec->join($Bin, '..', 'lib');
+use Config;
 
 use inc::Module::Install;
 
@@ -20,6 +21,8 @@
 
 cc_warnings;
 
+requires_c99 if $Config{gccversion};
+
 cc_include_paths 'include';
 cc_src_paths     'src';
 

Modified: branches/upstream/libmodule-install-xsutil-perl/current/inc/Module/Install.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmodule-install-xsutil-perl/current/inc/Module/Install.pm?rev=60287&op=diff
==============================================================================
--- branches/upstream/libmodule-install-xsutil-perl/current/inc/Module/Install.pm (original)
+++ branches/upstream/libmodule-install-xsutil-perl/current/inc/Module/Install.pm Wed Jul 14 11:28:14 2010
@@ -22,7 +22,6 @@
 use Cwd        ();
 use File::Find ();
 use File::Path ();
-use FindBin;
 
 use vars qw{$VERSION $MAIN};
 BEGIN {
@@ -32,7 +31,7 @@
 	# This is not enforced yet, but will be some time in the next few
 	# releases once we can make sure it won't clash with custom
 	# Module::Install extensions.
-	$VERSION = '0.97';
+	$VERSION = '1.00';
 
 	# Storage for the pseudo-singleton
 	$MAIN    = undef;
@@ -231,7 +230,12 @@
 sub new {
 	my ($class, %args) = @_;
 
-	FindBin->again;
+	delete $INC{'FindBin.pm'};
+	{
+		# to suppress the redefine warning
+		local $SIG{__WARN__} = sub {};
+		require FindBin;
+	}
 
 	# ignore the prefix on extension modules built from top level.
 	my $base_path = Cwd::abs_path($FindBin::Bin);

Modified: branches/upstream/libmodule-install-xsutil-perl/current/inc/Module/Install/Base.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmodule-install-xsutil-perl/current/inc/Module/Install/Base.pm?rev=60287&op=diff
==============================================================================
--- branches/upstream/libmodule-install-xsutil-perl/current/inc/Module/Install/Base.pm (original)
+++ branches/upstream/libmodule-install-xsutil-perl/current/inc/Module/Install/Base.pm Wed Jul 14 11:28:14 2010
@@ -4,7 +4,7 @@
 use strict 'vars';
 use vars qw{$VERSION};
 BEGIN {
-	$VERSION = '0.97';
+	$VERSION = '1.00';
 }
 
 # Suspend handler for "redefined" warnings

Modified: branches/upstream/libmodule-install-xsutil-perl/current/inc/Module/Install/Makefile.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmodule-install-xsutil-perl/current/inc/Module/Install/Makefile.pm?rev=60287&op=diff
==============================================================================
--- branches/upstream/libmodule-install-xsutil-perl/current/inc/Module/Install/Makefile.pm (original)
+++ branches/upstream/libmodule-install-xsutil-perl/current/inc/Module/Install/Makefile.pm Wed Jul 14 11:28:14 2010
@@ -4,10 +4,11 @@
 use strict 'vars';
 use ExtUtils::MakeMaker   ();
 use Module::Install::Base ();
+use Fcntl qw/:flock :seek/;
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '0.97';
+	$VERSION = '1.00';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }
@@ -364,9 +365,9 @@
 		. ($self->postamble || '');
 
 	local *MAKEFILE;
-	open MAKEFILE, "< $makefile_name" or die "fix_up_makefile: Couldn't open $makefile_name: $!";
+	open MAKEFILE, "+< $makefile_name" or die "fix_up_makefile: Couldn't open $makefile_name: $!";
+	eval { flock MAKEFILE, LOCK_EX };
 	my $makefile = do { local $/; <MAKEFILE> };
-	close MAKEFILE or die $!;
 
 	$makefile =~ s/\b(test_harness\(\$\(TEST_VERBOSE\), )/$1'inc', /;
 	$makefile =~ s/( -I\$\(INST_ARCHLIB\))/ -Iinc$1/g;
@@ -386,7 +387,8 @@
 	# XXX - This is currently unused; not sure if it breaks other MM-users
 	# $makefile =~ s/^pm_to_blib\s+:\s+/pm_to_blib :: /mg;
 
-	open  MAKEFILE, "> $makefile_name" or die "fix_up_makefile: Couldn't open $makefile_name: $!";
+	seek MAKEFILE, 0, SEEK_SET;
+	truncate MAKEFILE, 0;
 	print MAKEFILE  "$preamble$makefile$postamble" or die $!;
 	close MAKEFILE  or die $!;
 
@@ -410,4 +412,4 @@
 
 __END__
 
-#line 539
+#line 541

Modified: branches/upstream/libmodule-install-xsutil-perl/current/inc/Module/Install/Metadata.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmodule-install-xsutil-perl/current/inc/Module/Install/Metadata.pm?rev=60287&op=diff
==============================================================================
--- branches/upstream/libmodule-install-xsutil-perl/current/inc/Module/Install/Metadata.pm (original)
+++ branches/upstream/libmodule-install-xsutil-perl/current/inc/Module/Install/Metadata.pm Wed Jul 14 11:28:14 2010
@@ -6,7 +6,7 @@
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '0.97';
+	$VERSION = '1.00';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }
@@ -616,8 +616,15 @@
 	return $v;
 }
 
-
-
+sub add_metadata {
+    my $self = shift;
+    my %hash = @_;
+    for my $key (keys %hash) {
+        warn "add_metadata: $key is not prefixed with 'x_'.\n" .
+             "Use appopriate function to add non-private metadata.\n" unless $key =~ /^x_/;
+        $self->{values}->{$key} = $hash{$key};
+    }
+}
 
 
 ######################################################################

Modified: branches/upstream/libmodule-install-xsutil-perl/current/inc/Module/Install/WriteAll.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmodule-install-xsutil-perl/current/inc/Module/Install/WriteAll.pm?rev=60287&op=diff
==============================================================================
--- branches/upstream/libmodule-install-xsutil-perl/current/inc/Module/Install/WriteAll.pm (original)
+++ branches/upstream/libmodule-install-xsutil-perl/current/inc/Module/Install/WriteAll.pm Wed Jul 14 11:28:14 2010
@@ -6,7 +6,7 @@
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '0.97';;
+	$VERSION = '1.00';
 	@ISA     = qw{Module::Install::Base};
 	$ISCORE  = 1;
 }

Modified: branches/upstream/libmodule-install-xsutil-perl/current/lib/Module/Install/XSUtil.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmodule-install-xsutil-perl/current/lib/Module/Install/XSUtil.pm?rev=60287&op=diff
==============================================================================
--- branches/upstream/libmodule-install-xsutil-perl/current/lib/Module/Install/XSUtil.pm (original)
+++ branches/upstream/libmodule-install-xsutil-perl/current/lib/Module/Install/XSUtil.pm Wed Jul 14 11:28:14 2010
@@ -2,7 +2,7 @@
 
 use 5.005_03;
 
-$VERSION = '0.24';
+$VERSION = '0.25';
 
 use Module::Install::Base;
 @ISA     = qw(Module::Install::Base);
@@ -45,8 +45,8 @@
         $self->{xsu_initialized} = 1;
 
         if(!$self->cc_available()){
-            print "This package requires a C compiler, but it's not available.\n";
-            exit(0);
+            warn "This distribution requires a C compiler, but it's not available, stopped.\n";
+            exit;
         }
 
         $self->configure_requires(%ConfigureRequires);
@@ -168,6 +168,44 @@
         # TODO: support other compilers
     }
 
+    return;
+}
+
+sub c99_available {
+    my($self) = @_;
+    $self->_xs_initialize();
+
+    require File::Temp;
+    require File::Basename;
+
+    my $tmpfile = File::Temp->new(SUFFIX => '.c');
+
+    $tmpfile->print(<<'C99');
+inline // a C99 keyword with C99 style comments
+int test_c99() {
+    int i = 0;
+    i++;
+    int j = i - 1; // another C99 feature: declaration after statement
+    return j;
+}
+C99
+
+    $tmpfile->close();
+
+    system $Config{cc}, '-c', $tmpfile->filename;
+
+    (my $objname = File::Basename::basename($tmpfile->filename)) =~ s/\Q.c\E$/$Config{_o}/;
+    unlink $objname or warn "Cannot unlink $objname (ignored): $!";
+
+    return $? == 0;
+}
+
+sub requires_c99 {
+    my($self) = @_;
+    if(!$self->c99_available) {
+        warn "This distribution requires a C99 compiler, but $Config{cc} seems not to support C99, stopped.\n";
+        exit;
+    }
     return;
 }
 
@@ -338,7 +376,7 @@
     $self->cc_append_to_inc (grep{ !$uniq{ $_ }++ } @inc);
 
     %uniq = ();
-    $self->cc_append_to_libs(grep{ !$uniq{ $_->[0] }++ } @libs);
+    $self->cc_libs(grep{ !$uniq{ $_->[0] }++ } @libs);
 
     return %added;
 }
@@ -589,7 +627,7 @@
 
 =head1 VERSION
 
-This document describes Module::Install::XSUtil version 0.24.
+This document describes Module::Install::XSUtil version 0.25.
 
 =head1 SYNOPSIS
 
@@ -694,6 +732,10 @@
 Takes exactly what Devel::CheckLib takes. Note that you must pass
 the path names explicitly.
 
+=head2 requires_c99
+
+Checks if the C compiler supports C99 features.
+
 =head2 install_headers ?@header_files
 
 Declares providing header files, extracts functions from these header files,




More information about the Pkg-perl-cvs-commits mailing list