Move constant from lib/ to ext/
Nicholas Clark [Tue, 8 Sep 2009 20:56:38 +0000 (21:56 +0100)]
This is the first step in moving dual-life toolchain modules into ext.

MANIFEST
Porting/Maintainers.pl
ext/.gitignore
ext/constant/lib/constant.pm [moved from lib/constant.pm with 100% similarity]
ext/constant/t/constant.t [moved from lib/constant.t with 98% similarity]
lib/.gitignore
make_ext.pl

index 8566305..a4fe424 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
@@ -379,6 +379,8 @@ ext/Compress-Raw-Zlib/zlib-src/zlib.h       Compress::Raw::Zlib
 ext/Compress-Raw-Zlib/zlib-src/zutil.c Compress::Raw::Zlib
 ext/Compress-Raw-Zlib/zlib-src/zutil.h Compress::Raw::Zlib
 ext/Compress-Raw-Zlib/Zlib.xs          Compress::Raw::Zlib
+ext/constant/lib/constant.pm   For "use constant"
+ext/constant/t/constant.t      See if compile-time constants work
 ext/CPAN/lib/CPAN/API/HOWTO.pod                recipe book for programming with CPAN.pm
 ext/CPAN/lib/CPAN/Author.pm            helper package for CPAN.pm
 ext/CPAN/lib/CPAN/Bundle.pm            helper package for CPAN.pm
@@ -2474,8 +2476,6 @@ lib/complete.pl                   A command completion subroutine
 lib/Config/Extensions.pm       Convenient hash lookup for built extensions
 lib/Config/Extensions.t                See if Config::Extensions works
 lib/Config.t                   See if Config works
-lib/constant.pm                        For "use constant"
-lib/constant.t                 See if compile-time constants work
 lib/CORE.pod                   document the CORE namespace
 lib/ctime.pl                   A ctime workalike
 lib/Cwd.pm                     Various cwd routines (getcwd, fastcwd, chdir)
index d1204f5..2a05539 100755 (executable)
@@ -364,7 +364,7 @@ use File::Glob qw(:case);
        {
        'MAINTAINER'    => 'saper',
        'DISTRIBUTION'  => 'SAPER/constant-1.17.tar.gz',
-       'FILES'         => q[lib/constant.{pm,t}],
+       'FILES'         => q[ext/constant],
        'EXCLUDED'      => [ qw( t/00-load.t
                                 t/more-tests.t
                                 t/pod-coverage.t
@@ -372,9 +372,6 @@ use File::Glob qw(:case);
                                 eg/synopsis.pl
                               )
                           ],
-       'MAP'           => { 'lib/' => 'lib/',
-                            't/'   => 'lib/',
-                          },
        'CPAN'          => 1,
        'UPSTREAM'      => 'blead',
        },
index e13382a..d737ff4 100644 (file)
@@ -22,6 +22,7 @@ ppport.h
 /B-Deparse/Makefile.PL
 /B-Lint/Makefile.PL
 /CGI/Makefile.PL
+/constant/Makefile.PL
 /CPANPLUS-Dist-Build/Makefile.PL
 /Data-Dumper/Makefile.PL
 /Digest/Makefile.PL
similarity index 100%
rename from lib/constant.pm
rename to ext/constant/lib/constant.pm
similarity index 98%
rename from lib/constant.t
rename to ext/constant/t/constant.t
index 10560c9..a42b7d2 100644 (file)
@@ -1,12 +1,5 @@
 #!./perl -T
 
-BEGIN {
-    if ($ENV{PERL_CORE}) {
-        chdir 't' if -d 't';
-        @INC = '../lib';
-    }
-}
-
 use warnings;
 use vars qw{ @warnings $fagwoosh $putt $kloong};
 BEGIN {                                # ...and save 'em for later
index 6ec8c4d..93be609 100644 (file)
 /attributes.pm
 /auto
 /base.pm
+/constant.pm
 /encoding.pm
 /fields.pm
 /lib.pm
index b544830..691f7b1 100644 (file)
@@ -4,6 +4,8 @@ use warnings;
 use Config;
 use Cwd;
 
+my @toolchain = qw(ext/constant/lib);
+
 # This script acts as a simple interface for building extensions.
 
 # It's actually a cut and shut of the Unix version ext/utils/makeext and the
@@ -219,7 +221,8 @@ sub build_extension {
     $perl ||= "$up/miniperl";
     my $return_dir = $up;
     my $lib_dir = "$up/lib";
-    $ENV{PERL5LIB} = $lib_dir;
+    $ENV{PERL5LIB}
+       = join $Config{path_sep}, $lib_dir, map {"$up/$_"} @toolchain;
 
     unless (chdir "$ext_dir") {
        warn "Cannot cd to $ext_dir: $!";