summaryrefslogtreecommitdiff
path: root/configpm
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>1999-07-25 12:27:20 +0000
committerJarkko Hietaniemi <jhi@iki.fi>1999-07-25 12:27:20 +0000
commitb233458bd1d5037ce4bbbb41fb513e1b68522a4d (patch)
treec536cfd69a2b5a6fd972074b496e5ef5473cc69c /configpm
parent781b178c230df22350b5995b4bfdfeb294912a39 (diff)
downloadperl-b233458bd1d5037ce4bbbb41fb513e1b68522a4d.tar.gz
First steps of making builds outside the source
directory possible. These should get us as far as miniperl, then building DynaLoader falls into tiny twinkling pieces as MakeMaker knows nothing of VPATH mindset. p4raw-id: //depot/cfgperl@3735
Diffstat (limited to 'configpm')
-rwxr-xr-xconfigpm16
1 files changed, 14 insertions, 2 deletions
diff --git a/configpm b/configpm
index dd9e85803d..ac7f3aaec9 100755
--- a/configpm
+++ b/configpm
@@ -1,7 +1,15 @@
#!./miniperl -w
+# File::Spec?
my $config_pm = $ARGV[0] || 'lib/Config.pm';
-my $glossary = $ARGV[1] || 'Porting/Glossary';
+my $src = '.';
+# File::Dirname? File::Spec?
+if ($0 =~ m!^(?:(.+)/)configpm$!) {
+ $src = $1;
+ unshift @INC, "$1/lib";
+}
+# File::Spec?
+my $glossary = $ARGV[1] || "$src/Porting/Glossary";
@ARGV = "./config.sh";
# list names to put first (and hence lookup fastest)
@@ -85,7 +93,11 @@ print CONFIG "\n",
print CONFIG "my \$summary = <<'!END!';\n";
-open(MYCONFIG,"<myconfig.SH") || die "open myconfig.SH failed: $!";
+# File::Spec?
+my $myconfigdotSH =
+ $src eq "." ? "myconfig.SH" : "$src/myconfig.SH";
+
+open(MYCONFIG,"<$myconfigdotSH") || die "open $myconfigdotSH failed: $!";
1 while defined($_ = <MYCONFIG>) && !/^Summary of/;
do { print CONFIG $_ } until !defined($_ = <MYCONFIG>) || /^\s*$/;
close(MYCONFIG);