summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2009-09-26 21:15:34 +0100
committerNicholas Clark <nick@ccl4.org>2009-09-26 21:29:26 +0100
commita193a2dbe32848820392de0a7fd340ca82c2efd9 (patch)
treeb05d072dcaf2cf6a62c00b57eef0c1010e0e9cd8
parentfe0fb48b9e1689ad6e74e0516047f20e411bc3b4 (diff)
downloadperl-a193a2dbe32848820392de0a7fd340ca82c2efd9.tar.gz
Support building extensions in dist/ as well as cpan/ and ext/
-rwxr-xr-xConfigure4
-rw-r--r--Makefile.SH2
-rwxr-xr-xPorting/core-cpan-diff2
-rw-r--r--TestInit.pm2
-rw-r--r--configure.com8
-rw-r--r--dist/.gitignore8
-rw-r--r--make_ext.pl2
-rwxr-xr-xt/TEST4
-rw-r--r--t/pod/diag.t2
-rw-r--r--win32/Makefile14
-rw-r--r--win32/makefile.mk14
11 files changed, 42 insertions, 20 deletions
diff --git a/Configure b/Configure
index b2b92af66f..9b9d2c7593 100755
--- a/Configure
+++ b/Configure
@@ -21691,6 +21691,10 @@ cd "$rsrc/cpan"
set X
shift
eval $find_extensions
+cd "$rsrc/dist"
+set X
+shift
+eval $find_extensions
cd "$rsrc/ext"
set X
shift
diff --git a/Makefile.SH b/Makefile.SH
index 2b287876a6..623064a11b 100644
--- a/Makefile.SH
+++ b/Makefile.SH
@@ -218,7 +218,7 @@ done
nonxs_list=' '
for f in $nonxs_ext; do
p=`echo "$f" | tr / -`
- for d in ext cpan; do
+ for d in ext dist cpan; do
if test -d $d/$p; then
nonxs_list="$nonxs_list $d/$p/pm_to_blib"
fi
diff --git a/Porting/core-cpan-diff b/Porting/core-cpan-diff
index 8e3feeb09f..7dc907b46c 100755
--- a/Porting/core-cpan-diff
+++ b/Porting/core-cpan-diff
@@ -432,7 +432,7 @@ sub get_map {
my $ext;
for (@$perl_files) {
- if (m{^((?:ext|cpan)/[^/]+/)}) {
+ if (m{^((?:ext|dist|cpan)/[^/]+/)}) {
if (defined $ext and $ext ne $1) {
# more than one ext/$ext/
undef $ext;
diff --git a/TestInit.pm b/TestInit.pm
index 7eec5b4710..8513955ab7 100644
--- a/TestInit.pm
+++ b/TestInit.pm
@@ -59,7 +59,7 @@ if (-f 't/TEST' && -f 'MANIFEST' && -d 'lib' && -d 'ext') {
# We're being run from the top level. Try to change directory, and set
# things up correctly. This is a 90% solution, but for hand-running tests,
# that's good enough
- if ($0 =~ s!^((?:ext|cpan)[\\/][^\\/]+)[\//](.*\.t)$!$2!) {
+ if ($0 =~ s!^((?:ext|dist|cpan)[\\/][^\\/]+)[\//](.*\.t)$!$2!) {
# Looks like a test in ext.
chdir $1 or die "Can't chdir '$1': $!";
new_inc(@up_2_t);
diff --git a/configure.com b/configure.com
index d79d6f4377..d5ea93253c 100644
--- a/configure.com
+++ b/configure.com
@@ -2727,6 +2727,7 @@ $ OPEN/READ CONFIG 'manifestfound'
$ext_loop:
$ READ/END_OF_FILE=end_ext/ERROR=end_ext CONFIG line
$ IF F$EXTRACT(0,4,line) .NES. "ext/" .AND. -
+ F$EXTRACT(0,5,line) .NES. "dist/".AND. -
F$EXTRACT(0,5,line) .NES. "cpan/" THEN goto ext_loop
$ line = F$EDIT(line,"COMPRESS")
$ line = F$ELEMENT(0," ",line)
@@ -2735,6 +2736,11 @@ $ THEN
$ xxx = F$ELEMENT(1,"/",line)
$ IF F$SEARCH("[-.ext]''xxx'.DIR;1") .EQS. "" THEN GOTO ext_loop
$ ENDIF
+$ IF F$EXTRACT(0,5,line) .EQS. "dist/"
+$ THEN
+$ xxx = F$ELEMENT(1,"/",line)
+$ IF F$SEARCH("[-.dist]''xxx'.DIR;1") .EQS. "" THEN GOTO ext_loop
+$ ENDIF
$ IF F$EXTRACT(0,5,line) .EQS. "cpan/"
$ THEN
$ xxx = F$ELEMENT(1,"/",line)
@@ -2790,7 +2796,7 @@ $ xxx = F$EXTRACT(F$LENGTH(extspec) + 1, extlen, xxx)
$ ENDIF
$!
$ found_new_extension:
-$ IF F$SEARCH("[-.ext.''extension_dir_name']*.xs") .EQS. "" .AND. F$SEARCH("[-.cpan.''extension_dir_name']*.xs") .EQS. ""
+$ IF F$SEARCH("[-.ext.''extension_dir_name']*.xs") .EQS. "" .AND. F$SEARCH("[-.dist.''extension_dir_name']*.xs") .EQS. "" .AND. F$SEARCH("[-.cpan.''extension_dir_name']*.xs") .EQS. ""
$ THEN
$ nonxs_ext = nonxs_ext + " ''extspec'"
$ ELSE
diff --git a/dist/.gitignore b/dist/.gitignore
new file mode 100644
index 0000000000..48ab11785c
--- /dev/null
+++ b/dist/.gitignore
@@ -0,0 +1,8 @@
+# ignore generated .c files, and other module build traces
+*.c
+*.bs
+blib
+pm_to_blib
+Makefile
+Makefile.PL
+ppport.h
diff --git a/make_ext.pl b/make_ext.pl
index 5aa861dba3..04c2addedc 100644
--- a/make_ext.pl
+++ b/make_ext.pl
@@ -19,7 +19,7 @@ my @toolchain = qw(ext/constant/lib ext/Cwd ext/Cwd/lib ext/ExtUtils-Command/lib
ext/ExtUtils-Manifest/lib ext/Text-ParseWords/lib
cpan/File-Path/lib cpan/AutoLoader/lib);
-my @ext_dirs = qw(cpan ext);
+my @ext_dirs = qw(cpan dist ext);
my $ext_dirs_re = '(?:' . join('|', @ext_dirs) . ')';
# This script acts as a simple interface for building extensions.
diff --git a/t/TEST b/t/TEST
index 8883b3a5f0..0ee0dd27b6 100755
--- a/t/TEST
+++ b/t/TEST
@@ -194,7 +194,7 @@ sub _scan_test {
my $dir = $1;
my $testswitch = $dir_to_switch{$dir};
if (!defined $testswitch) {
- if ($test =~ s!^(\.\./(?:cpan|ext)/[^/]+)/t!t!) {
+ if ($test =~ s!^(\.\./(?:cpan|dist|ext)/[^/]+)/t!t!) {
$run_dir = $1;
$return_dir = '../../t';
$lib = '../../lib';
@@ -345,7 +345,7 @@ sub _tests_from_manifest {
my $mani = '../MANIFEST';
if (open(MANI, $mani)) {
while (<MANI>) {
- if (m!^((?:cpan|ext)/(\S+)/+(?:[^/\s]+\.t|test\.pl)|lib/\S+?(?:\.t|test\.pl))\s!) {
+ if (m!^((?:cpan|dist|ext)/(\S+)/+(?:[^/\s]+\.t|test\.pl)|lib/\S+?(?:\.t|test\.pl))\s!) {
my $t = $1;
my $extension = $2;
if (!$::core || $t =~ m!^lib/[a-z]!) {
diff --git a/t/pod/diag.t b/t/pod/diag.t
index eb6f10e4ea..573450d00c 100644
--- a/t/pod/diag.t
+++ b/t/pod/diag.t
@@ -31,7 +31,7 @@ while (<$diagfh>) {
my @todo = ('..');
while (@todo) {
my $todo = shift @todo;
- next if $todo ~~ ['../t', '../lib', '../ext', '../cpan'];
+ next if $todo ~~ ['../t', '../lib', '../ext', '../dist', '../cpan'];
# opmini.c is just a copy of op.c, so there's no need to check again.
next if $todo eq '../opmini.c';
if (-d $todo) {
diff --git a/win32/Makefile b/win32/Makefile
index 732b3cdc42..55a2ba9e1c 100644
--- a/win32/Makefile
+++ b/win32/Makefile
@@ -396,6 +396,7 @@ COREDIR = ..\lib\CORE
AUTODIR = ..\lib\auto
LIBDIR = ..\lib
EXTDIR = ..\ext
+DISTDIR = ..\dist
CPANDIR = ..\cpan
PODDIR = ..\pod
EXTUTILSDIR = $(LIBDIR)\ExtUtils
@@ -1037,30 +1038,30 @@ MakePPPort_clean:
# DynaLoader.pm, so this will have to do
Extensions: ..\make_ext.pl $(PERLDEP) $(CONFIGPM) $(DYNALOADER)
$(XCOPY) ..\*.h $(COREDIR)\*.*
- $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(MAKE)" --dir=$(CPANDIR) --dir=$(EXTDIR) --dynamic
+ $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(MAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) --dynamic
Extensions_reonly: ..\make_ext.pl $(PERLDEP) $(CONFIGPM) $(DYNALOADER)
$(XCOPY) ..\*.h $(COREDIR)\*.*
- $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(MAKE)" --dir=$(CPANDIR) --dir=$(EXTDIR) --dynamic +re
+ $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(MAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) --dynamic +re
Extensions_static : ..\make_ext.pl list_static_libs.pl $(PERLDEP) $(CONFIGPM)
$(XCOPY) ..\*.h $(COREDIR)\*.*
- $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(MAKE)" --dir=$(CPANDIR) --dir=$(EXTDIR) --static
+ $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(MAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) --static
$(MINIPERL) -I..\lib list_static_libs.pl > Extensions_static
Extensions_nonxs: ..\make_ext.pl $(PERLDEP) $(CONFIGPM)
$(XCOPY) ..\*.h $(COREDIR)\*.*
- $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(MAKE)" --dir=$(CPANDIR) --dir=$(EXTDIR) --nonxs
+ $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(MAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) --nonxs
$(DYNALOADER) : ..\make_ext.pl $(PERLDEP) $(CONFIGPM) Extensions_nonxs
$(XCOPY) ..\*.h $(COREDIR)\*.*
$(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(MAKE)" --dir=$(EXTDIR) --dynaloader
Extensions_clean:
- -if exist $(MINIPERL) $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(MAKE)" --dir=$(CPANDIR) --dir=$(EXTDIR) --all --target=clean
+ -if exist $(MINIPERL) $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(MAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) --all --target=clean
Extensions_realclean:
- -if exist $(MINIPERL) $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(MAKE)" --dir=$(CPANDIR) --dir=$(EXTDIR) --all --target=realclean
+ -if exist $(MINIPERL) $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(MAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) --all --target=realclean
#-------------------------------------------------------------------------------
@@ -1205,6 +1206,7 @@ distclean: realclean
-del /f perl.base
-cd .. && del /s *.lib *.map *.pdb *.ilk *.bs *$(o) .exists pm_to_blib
-cd $(EXTDIR) && del /s *.def Makefile Makefile.old
+ -cd $(DISTDIR) && del /s *.def Makefile Makefile.old
-cd $(CPANDIR) && del /s *.def Makefile Makefile.old
-if exist $(AUTODIR) rmdir /s /q $(AUTODIR)
-if exist $(COREDIR) rmdir /s /q $(COREDIR)
diff --git a/win32/makefile.mk b/win32/makefile.mk
index 78f7c87e0f..b6bfdf449a 100644
--- a/win32/makefile.mk
+++ b/win32/makefile.mk
@@ -395,6 +395,7 @@ COREDIR = ..\lib\CORE
AUTODIR = ..\lib\auto
LIBDIR = ..\lib
EXTDIR = ..\ext
+DISTDIR = ..\dist
CPANDIR = ..\cpan
PODDIR = ..\pod
EXTUTILSDIR = $(LIBDIR)\ExtUtils
@@ -1373,30 +1374,30 @@ MakePPPort_clean:
# DynaLoader.pm, so this will have to do
Extensions : ..\make_ext.pl $(PERLDEP) $(CONFIGPM) $(DYNALOADER)
$(XCOPY) ..\*.h $(COREDIR)\*.*
- $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(MAKE)" --dir=$(CPANDIR) --dir=$(EXTDIR) --dynamic
+ $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(MAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) --dynamic
Extensions_reonly : ..\make_ext.pl $(PERLDEP) $(CONFIGPM) $(DYNALOADER)
$(XCOPY) ..\*.h $(COREDIR)\*.*
- $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(MAKE)" --dir=$(CPANDIR) --dir=$(EXTDIR) --dynamic +re
+ $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(MAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) --dynamic +re
Extensions_static : ..\make_ext.pl list_static_libs.pl $(PERLDEP) $(CONFIGPM)
$(XCOPY) ..\*.h $(COREDIR)\*.*
- $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(MAKE)" --dir=$(CPANDIR) --dir=$(EXTDIR) --static
+ $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(MAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) --static
$(MINIPERL) -I..\lib list_static_libs.pl > Extensions_static
Extensions_nonxs : ..\make_ext.pl $(PERLDEP) $(CONFIGPM)
$(XCOPY) ..\*.h $(COREDIR)\*.*
- $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(MAKE)" --dir=$(CPANDIR) --dir=$(EXTDIR) --nonxs
+ $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(MAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) --nonxs
$(DYNALOADER) : ..\make_ext.pl $(PERLDEP) $(CONFIGPM) Extensions_nonxs
$(XCOPY) ..\*.h $(COREDIR)\*.*
$(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(MAKE)" --dir=$(EXTDIR) --dynaloader
Extensions_clean :
- -if exist $(MINIPERL) $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(MAKE)" --dir=$(CPANDIR) --dir=$(EXTDIR) --all --target=clean
+ -if exist $(MINIPERL) $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(MAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) --all --target=clean
Extensions_realclean :
- -if exist $(MINIPERL) $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(MAKE)" --dir=$(CPANDIR) --dir=$(EXTDIR) --all --target=realclean
+ -if exist $(MINIPERL) $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(MAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) --all --target=realclean
#-------------------------------------------------------------------------------
@@ -1538,6 +1539,7 @@ distclean: realclean
-del /f perl.base
-cd .. && del /s *$(a) *.map *.pdb *.ilk *.tds *.bs *$(o) .exists pm_to_blib
-cd $(EXTDIR) && del /s *.def Makefile Makefile.old
+ -cd $(DISTDIR) && del /s *.def Makefile Makefile.old
-cd $(CPANDIR) && del /s *.def Makefile Makefile.old
-if exist $(AUTODIR) rmdir /s /q $(AUTODIR)
-if exist $(COREDIR) rmdir /s /q $(COREDIR)