X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=configpm;h=1fb9c3e09c8a9e6d0301e7301fbbd0b6a18d57e6;hb=cf6c151c4d1b7ed05e154d608f547018d54674bc;hp=cb6122cf668c0512fa896b7717fbcb7f7a30f1d2;hpb=8d962fa19aed5e09e2a40f248faf69d89e34ac51;p=p5sagit%2Fp5-mst-13.2.git diff --git a/configpm b/configpm index cb6122c..1fb9c3e 100755 --- a/configpm +++ b/configpm @@ -2,8 +2,8 @@ # # configpm # -# Copyright (C) 1994, 1995, 1996 1997, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006 Larry Wall and others. +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, +# 2002, 2003, 2004, 2005, 2006, 2007 Larry Wall and others. # # # Regenerate the files @@ -13,6 +13,7 @@ # lib/Config.pod # lib/Cross.pm (optionally) # +# # from the contents of the static files # # Porting/Glossary @@ -22,18 +23,17 @@ # # config.sh # +# Note that output directory is xlib/[cross-name]/ for cross-compiling +# # It will only update Config.pm and Config_heavy.pl if the contents of # either file would be different. Note that *both* files are updated in # this case, since for example an extension makefile that has a dependency # on Config.pm should trigger even if only Config_heavy.pl has changed. sub usage { die < '', # --cross=PLATFORM - crosscompiling for PLATFORM 'glossary' => 1, # --no-glossary - no glossary file inclusion, # for compactness - 'heavy' => '', # pathname of the Config_heavy.pl file ); sub opts { @@ -86,26 +85,25 @@ sub opts { my %Opts = opts(); -my ($Config_PM, $Config_heavy); -my $Glossary = $ARGV[1] || 'Porting/Glossary'; +my ($Config_SH, $Config_PM, $Config_heavy, $Config_POD); +my $Glossary = 'Porting/Glossary'; if ($Opts{cross}) { # creating cross-platform config file mkdir "xlib"; mkdir "xlib/$Opts{cross}"; - $Config_PM = $ARGV[0] || "xlib/$Opts{cross}/Config.pm"; -} -else { - $Config_PM = $ARGV[0] || 'lib/Config.pm'; -} -if ($Opts{heavy}) { - $Config_heavy = $Opts{heavy}; + $Config_PM = "xlib/$Opts{cross}/Config.pm"; + $Config_POD = "xlib/$Opts{cross}/Config.pod"; + $Config_SH = "Cross/config-$Opts{cross}.sh"; } else { - ($Config_heavy = $Config_PM) =~ s!\.pm$!_heavy.pl!; - die "Can't automatically determine name for Config_heavy.pl from '$Config_PM'" - if $Config_heavy eq $Config_PM; + $Config_PM = "lib/Config.pm"; + $Config_POD = "lib/Config.pod"; + $Config_SH = "config.sh"; } +($Config_heavy = $Config_PM) =~ s/\.pm$/_heavy.pl/; +die "Can't automatically determine name for Config_heavy.pl from '$Config_PM'" + if $Config_heavy eq $Config_PM; my $config_txt; my $heavy_txt; @@ -184,7 +182,7 @@ my %Data = (); my %seen_quotes; { my ($name, $val); - open(CONFIG_SH, 'config.sh') || die "Can't open config.sh: $!"; + open(CONFIG_SH, $Config_SH) || die "Can't open $Config_SH: $!"; while () { next if m:^#!/bin/sh:; @@ -717,7 +715,7 @@ tie %%Config, 'Config', { ENDOFTIE -open(CONFIG_POD, ">lib/Config.pod") or die "Can't open lib/Config.pod: $!"; +open(CONFIG_POD, ">$Config_POD") or die "Can't open $Config_POD: $!"; print CONFIG_POD <<'ENDOFTAIL'; =head1 NAME @@ -917,7 +915,7 @@ ENDOFTAIL close(GLOS) if $Opts{glossary}; close(CONFIG_POD); -print "written lib/Config.pod\n"; +print "written $Config_POD\n"; my $orig_config_txt = ""; my $orig_heavy_txt = "";