X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=win32%2Fconfig_h.PL;h=ad2c9a3afa47bc532c06ff81c8f685726e4456e4;hb=cc61921f0ae7ed05d56abbd690cb97eea560d4a9;hp=a0ee22d3055277f4457d4835d618310492e385bb;hpb=8c8a4ace7996843229b7a1f2a007f1cea5c7a38d;p=p5sagit%2Fp5-mst-13.2.git diff --git a/win32/config_h.PL b/win32/config_h.PL index a0ee22d..ad2c9a3 100644 --- a/win32/config_h.PL +++ b/win32/config_h.PL @@ -1,8 +1,13 @@ # -use Config; +BEGIN { warn "Running ".__FILE__."\n" }; +BEGIN + { + require "Config.pm"; + die "Config.pm:$@" if $@; + Config::->import; + } use File::Compare qw(compare); use File::Copy qw(copy); -my $OBJ = 1 if $Config{'ccflags'} =~ /PERL_OBJECT/i; my $name = $0; $name =~ s#^(.*)\.PL$#../$1.SH#; my %opt; @@ -13,6 +18,9 @@ while (@ARGV && $ARGV[0] =~ /^([\w_]+)=(.*)$/) } $opt{CONFIG_H} ||= 'config.h'; +$opt{CORE_DIR} ||= '../lib/CORE'; + +warn "Writing $opt{CONFIG_H}\n"; my $patchlevel = $opt{INST_VER}; $patchlevel =~ s|^[\\/]||; @@ -69,11 +77,11 @@ close(H); close(SH); -chmod(0666,"../lib/CORE/config.h"); -copy("$file.new","../lib/CORE/config.h") || die "Cannot copy:$!"; -chmod(0444,"../lib/CORE/config.h"); +chmod(0666,"$opt{CORE_DIR}/$opt{CONFIG_H}"); +copy("$file.new","$opt{CORE_DIR}/$opt{CONFIG_H}") || die "Cannot copy:$!"; +chmod(0444,"$opt{CORE_DIR}/$opt{CONFIG_H}"); -if (!$OBJ && compare("$file.new",$file)) +if (compare("$file.new",$file)) { warn "$file has changed\n"; chmod(0666,$file);