From: Rafael Garcia-Suarez Date: Fri, 17 Mar 2006 13:18:38 +0000 (+0000) Subject: Upgrade to ExtUtils::CBuilder 0.17 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ea2e65188a6601dcbaa0912ec6b5cf4806638424;p=p5sagit%2Fp5-mst-13.2.git Upgrade to ExtUtils::CBuilder 0.17 p4raw-id: //depot/perl@27531 --- diff --git a/MANIFEST b/MANIFEST index 077041e..a9357c2 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1577,6 +1577,7 @@ lib/Exporter/Heavy.pm Complicated routines for Exporter lib/Exporter.pm Exporter base class lib/Exporter.t See if Exporter works lib/ExtUtils/CBuilder/Base.pm Base class for ExtUtils::CBuilder methods +lib/ExtUtils/CBuilder/Changes Changes for ExtUtils::CBuilder lib/ExtUtils/CBuilder/Platform/aix.pm CBuilder methods for AIX lib/ExtUtils/CBuilder/Platform/cygwin.pm CBuilder methods for cygwin lib/ExtUtils/CBuilder/Platform/darwin.pm CBuilder methods for darwin diff --git a/lib/ExtUtils/CBuilder.pm b/lib/ExtUtils/CBuilder.pm index 42be355..e2c6cf3 100644 --- a/lib/ExtUtils/CBuilder.pm +++ b/lib/ExtUtils/CBuilder.pm @@ -5,7 +5,7 @@ use File::Path (); use File::Basename (); use vars qw($VERSION @ISA); -$VERSION = '0.15'; +$VERSION = '0.17'; $VERSION = eval $VERSION; # Okay, this is the brute-force method of finding out what kind of @@ -117,6 +117,12 @@ by the object, as in the following example: my $b = ExtUtils::CBuilder->new( config => { ld => 'gcc' } ); +A C parameter tells C to not print its C +commands before executing them: + + # Be quieter than normal + my $b = ExtUtils::CBuilder->new( quiet => 1 ); + =item have_compiler Returns true if the current system has a working C compiler and diff --git a/lib/ExtUtils/CBuilder/Base.pm b/lib/ExtUtils/CBuilder/Base.pm index 4ab8378..b06d358 100644 --- a/lib/ExtUtils/CBuilder/Base.pm +++ b/lib/ExtUtils/CBuilder/Base.pm @@ -240,11 +240,11 @@ sub perl_src { return unless $ENV{PERL_CORE}; - my $Updir = File::Spec->updir; - my $dir = $Updir; + my $Updir = File::Spec->updir; + my $dir = File::Spec->curdir; # Try up to 5 levels upwards - for (1..5) { + for (0..5) { if ( -f File::Spec->catfile($dir,"config_h.SH") && @@ -257,9 +257,9 @@ sub perl_src { $dir = File::Spec->catdir($dir, $Updir); } - + warn "PERL_CORE is set but I can't find your perl source!\n"; - return; + return ''; # return empty string if $ENV{PERL_CORE} but can't find dir ??? } # directory of perl's include files diff --git a/lib/ExtUtils/CBuilder/Changes b/lib/ExtUtils/CBuilder/Changes new file mode 100644 index 0000000..460f628 --- /dev/null +++ b/lib/ExtUtils/CBuilder/Changes @@ -0,0 +1,164 @@ +Revision history for Perl extension ExtUtils::CBuilder. + +0.17 Wed Mar 15 22:46:15 CST 2006 + + - When we're being run from an uninstalled perl distribution + (e.g. one that's in the process of being built and tested), we + search for perl first in the current working directory. [Randy + Sims] + + - More fixing of the arg_defines() method on VMS. [Craig A. Berry and + John E. Malmberg] + +0.16 Mon Mar 13 17:08:21 CST 2006 + + - Fix quoting of command line arguments on Windows. [Yitzchak + Scott-Thoennes] + + - Provided a custom arg_defines() on VMS that does essentially the + same thing for /define that version 0.14 did for /include. [Craig + A. Berry] + + - Documented the existing 'quiet' parameter, which silences the + printing of system() commands. [Suggested by Yitzchak + Scott-Thoennes] + +0.15 Mon Oct 3 17:10:32 CDT 2005 + + - Several OS/2 fixes have been made, including: 1) adding the + necessary version string to DLLs, 2) passing the executable's name + to 'ldopts' without the .exe extension, 3) avoiding calling 'env' + via the 'shrpenv' thingy, since it triggers a fork() bug. [Ilya + Zakharevich] + + - Integrate a couple cleanup-related changes from bleadperl that + somehow never got into this copy. [Steve Hay] + + - Added a new 'defines' parameter to compile(), which gives a + platform-independant way to specify various -Dfoo=bar (or the + equivalent) compiler defines. [Randy W. Sims] + +0.14 Mon Sep 19 13:40:37 CDT 2005 + + - Several fixes have been made for VMS, including: 1) there can only + be one /include qualifier, so merge multiple /includes into one; 2) + make sure the executable is named the same way that dynaloader will + look for it; 3) make sure the option files for the exported symbols + and the PERLSHR image are passed properly to the linker. [John + E. Malmberg] + +0.13 Wed Aug 24 20:05:59 CDT 2005 + + - Several temporary files weren't being cleaned up during testing, + because the 'cleanup' mechanism was never properly implemented. + This is now fixed. [Steve Hay] + +0.12 Mon May 30 16:40:10 CDT 2005 + + - In order to integrate into the perl core, patches were contributed + that a) put a $VERSION variable in each .pm file, b) add a 'quiet' + parameter to new() to shut up some of the command-echoing, c) + checks for the perl source headers in the CORE/ directory in the + perl source tree, not in the post-installation location, and d) + adjusts the CWD when running the regression tests under the perl + core. [Yitzchak Scott-Thoennes] + + - Various parts of the code were looking for the CORE/ directory in + $Config{archlib}, $Config{installarchlib}, and $Config{archlibexp}. + Only the latter is correct, so we use that everywhere now. + [Curt Tilmes] + + - For Unix-ish platforms, link_executable() will now prefer + $Config{cc} to $Config{ld}, because that typically works + better. [Jarkko Hietaniemi and H.Merijn Brand] + + - Prelinking (invoking ExtUtils::Mksymlists to create options-files) + is now only done when we're building dynamic libraries. [Yitzchak + Scott-Thoennes] + +0.11 Tue Apr 5 20:58:41 CDT 2005 + + - Added a licensing statement to CBuilder.pm. [Spotted by Chip + Salzenberg] + +0.10 Mon Mar 14 20:18:19 CST 2005 + + - Split out a few simple routines that format how compile switches + are formatted, so that we can override them for platforms like VMS + where they're very different. + + - Fix compile() and link() on VMS. [Help from Michael Schwern and + Peter Prymmer] + +0.09 Tue Feb 8 17:57:41 CST 2005 + + - Fixed a broken link_executable() method on cygwin - it now uses + 'gcc' instead of $Config{ld} for the linking, because the latter is + actually a shell script which calls a perl script which calls gcc + in a way that only works for creating shared libraries, not + executables. + +0.08 Tue Jan 18 21:54:11 CST 2005 + + - Fixed a testing error in which I had the prototype wrong for the + main() function. [Jose Pedro Oliveira] + +0.07 Wed Jan 12 21:50:34 CST 2005 + + - Added the link_executable() method, which provides the ability to + create standalone executables. This is NOT yet implemented on + Windows, and therefore the tests for it are skipped on Win32. + [Alberto Manuel Brandao Simoes] + + - Integrated the latest split_like_shell() for Windows from + Module::Build (really need to find a better home for this code...), + which now does a much better job of handling quotes and backslashes + and so on. [Randy Sims] + + - Fixed a couple of Windows problems related to the output-file name + in link(), and some clobbering of the 'include_dirs' parameter to + compile(). [Randy Sims] + +0.06 Mon Dec 27 22:51:36 CST 2004 + + - Fixed a bug on Unix environments in which our work-around for + shell-commands like "FOO=BAR cc" (which is supposed to be turned + into "env FOO=BAR cc" to actually work) wasn't being called. + +0.05 Wed Oct 13 23:09:09 CDT 2004 + + - Fixed a bug in split_like_shell() in which leading whitespace was + creating an empty word, manifesting as something like "gcc - no + such file or directory" during tests. [Spotted by Warren L. Dodge] + + - Incorporate another split_like_shell() fix from Module::Build. + +0.04 Sun Oct 10 00:31:08 CDT 2004 + + - Changed the split_like_shell() method to use the shellwords() + function from Text::ParseWords (a core module since 5.0), which + does a much better job than the split() we were using. + + +0.03 Fri May 14 23:12:23 CDT 2004 + + - Fixed minor problems with the Build.PL file, the module names + should be quoted. + + - The VMS module declared itself with the wrong package name. + + +0.02 Fri Feb 20 10:17:40 CST 2004 + + - Fixed a bug in .../Platform/Windows.pm, in which compile() was + ignoring an 'include_dirs' argument. [Randy Sims] + + - Fixed a bug in .../Platform/Windows.pm, in which output files were + being created in the root directory \ when they should be created + in the current directory. [Randy Sims] + + +0.01 Mon Jan 12 08:12:35 CST 2004 + + - Original release, taken from Module::Build's C-building code, with + patching help from Randy Sims. diff --git a/lib/ExtUtils/CBuilder/Platform/VMS.pm b/lib/ExtUtils/CBuilder/Platform/VMS.pm index b69d699..56285a5 100644 --- a/lib/ExtUtils/CBuilder/Platform/VMS.pm +++ b/lib/ExtUtils/CBuilder/Platform/VMS.pm @@ -9,6 +9,28 @@ $VERSION = '0.12'; sub need_prelink { 0 } +sub arg_defines { + my ($self, %args) = @_; + + s/"/""/g foreach values %args; + + my $config_defines; + + # VMS can only have one define qualifier; add the one from config, if any. + if ($self->{config}{ccflags} =~ s{/def[^=]+(?:=)+(?:\()?([^\/\)]*)} {}i) { + $config_defines = $1; + } + + return unless (scalar keys %args) || $config_defines; + + return ('/define=(' + . (defined $config_defines ? "$config_defines," : '') + . join(',', + map "\"$_" . ( length($args{$_}) ? "=$args{$_}" : '') . "\"", + keys %args) + . ')'); +} + sub arg_include_dirs { my ($self, @dirs) = @_; diff --git a/lib/ExtUtils/CBuilder/Platform/Windows.pm b/lib/ExtUtils/CBuilder/Platform/Windows.pm index b4bb22c..1ec89ee 100644 --- a/lib/ExtUtils/CBuilder/Platform/Windows.pm +++ b/lib/ExtUtils/CBuilder/Platform/Windows.pm @@ -93,7 +93,7 @@ sub split_like_shell { sub arg_defines { my ($self, %args) = @_; s/"/\\"/g foreach values %args; - return map "-D$_=$args{$_}", keys %args; + return map qq{"-D$_=$args{$_}"}, keys %args; } sub compile {