summaryrefslogtreecommitdiff
path: root/utils/Makefile.PL
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2013-07-03 18:31:02 +0200
committerNicholas Clark <nick@ccl4.org>2013-07-07 12:42:02 +0200
commit145bbcacfa5da244463c1a32e9230278dd2eff31 (patch)
treef92b6eafd7dd9c7adcec7cc9de9fa5d535fe4d00 /utils/Makefile.PL
parentf1f44974ad7245157b1b472771053946362694f8 (diff)
downloadperl-145bbcacfa5da244463c1a32e9230278dd2eff31.tar.gz
Replace utils/Makefile.SH with utils/Makefile.PL
This shares all the existing deficiencies of utils/Makefile.SH, and generates a byte-for-byte identical utils/Makefile, including boilerplate that claims it was generated by utils/Makefile.SH utils/Makefile remains as a file checked into the repository, and is not (yet) deleted, because as-was only *nix platforms could run utils/Makefile.SH to generate utils/Makefile. This messy state of affairs means that if you build with static linking, the checked-out utils/Makefile is modified ('../miniperl' is replaced with '../perl') The next commit will resolve just these bugs. In turn, it seems that the pre-generated utils/Makefile is only used by Win32, as VMS contains rules in descrip_mms.template to build the utilities. Probably the next thing to unpick is the build on VMS, but it seems better to reduce the size of the "problem" in both utils/Makefile.PL and vms/descrip_mms.template by attempting to move the work from them to the extension directories and ExtUtils::MakeMaker.
Diffstat (limited to 'utils/Makefile.PL')
-rw-r--r--utils/Makefile.PL107
1 files changed, 107 insertions, 0 deletions
diff --git a/utils/Makefile.PL b/utils/Makefile.PL
new file mode 100644
index 0000000000..7e33806034
--- /dev/null
+++ b/utils/Makefile.PL
@@ -0,0 +1,107 @@
+#!./miniperl -w
+use strict;
+use Config;
+
+if (@ARGV) {
+ my $dir = shift;
+ chdir $dir or die "Can't chdir '$dir': $!";
+}
+
+require 'regen/regen_lib.pl';
+
+my $target = 'utils/Makefile';
+print "Extracting $target (with variable substitutions)\n";
+my $fh = open_new($target, undef, undef, 1);
+
+# These use the Cwd extension. For statically-built perls, we
+# need perl, not just miniperl.
+my $perl = defined $Config{usedl} ? '../miniperl' : '../perl';
+
+print $fh <<"EOT";
+# Generated from utils/Makefile.SH. The generated file is
+# shipped with the source kit for systems such as win32
+# which don't do .SH extraction.
+
+PERL = $perl
+REALPERL = ../perl
+RUN = $Config{run} # Used mainly cross-compilation setups.
+
+EOT
+
+print $fh <<'EOT';
+
+# Files to be built with variable substitution after miniperl is
+# available. Dependencies handled manually below (for now).
+
+pl = c2ph.PL config_data.PL corelist.PL cpan.PL h2ph.PL h2xs.PL instmodsh.PL json_pp.PL perlbug.PL perldoc.PL perlivp.PL pl2pm.PL prove.PL ptar.PL ptardiff.PL ptargrep.PL shasum.PL splain.PL libnetcfg.PL piconv.PL enc2xs.PL xsubpp.PL pod2html.PL zipdetails.PL
+plextract = c2ph config_data corelist cpan h2ph h2xs instmodsh json_pp perlbug perldoc perlivp pl2pm prove ptar ptardiff ptargrep shasum splain libnetcfg piconv enc2xs xsubpp pod2html zipdetails
+plextractexe = ./c2ph ./config_data ./corelist ./cpan ./h2ph ./h2xs ./json_pp ./instmodsh ./perlbug ./perldoc ./perlivp ./pl2pm ./prove ./ptar ./ptardiff ./ptargrep ./shasum ./splain ./libnetcfg ./piconv ./enc2xs ./xsubpp ./pod2html ./zipdetails
+
+all: $(plextract)
+
+$(plextract):
+ $(RUN) $(PERL) -I../lib $@.PL
+
+c2ph: c2ph.PL ../config.sh
+
+cpan: cpan.PL ../config.sh
+
+config_data: config_data.PL ../config.sh
+
+corelist: corelist.PL ../config.sh
+
+h2ph: h2ph.PL ../config.sh
+
+h2xs: h2xs.PL ../config.sh
+
+instmodsh: instmodsh.PL ../config.sh
+
+json_pp: json_pp.PL ../config.sh
+
+perlbug: perlbug.PL ../config.sh ../patchlevel.h
+
+perldoc: perldoc.PL ../config.sh
+
+perlivp: perlivp.PL ../config.sh
+
+prove: prove.PL ../config.sh
+
+ptar: ptar.PL ../config.sh
+
+ptardiff: ptardiff.PL ../config.sh
+
+ptargrep: ptargrep.PL ../config.sh
+
+pl2pm: pl2pm.PL ../config.sh
+
+shasum: shasum.PL ../config.sh
+
+splain: splain.PL ../config.sh ../lib/diagnostics.pm
+
+libnetcfg: libnetcfg.PL ../config.sh
+
+piconv: piconv.PL ../config.sh
+
+enc2xs: enc2xs.PL ../config.sh
+
+xsubpp: xsubpp.PL ../config.sh
+
+zipdetails: zipdetails.PL ../config.sh
+
+pod2html: pod2html.PL ../config.sh ../ext/Pod-Html/bin/pod2html
+
+clean:
+
+realclean:
+ rm -rf $(plextract) pstruct $(plextractexe)
+ rm -f ../t/_h2ph_pre.ph
+
+clobber: realclean
+
+distclean: clobber
+
+veryclean: distclean
+ -rm -f *~ *.org
+EOT
+
+close_and_rename($fh);