X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=win32%2Fconfig_h.PL;h=ad2c9a3afa47bc532c06ff81c8f685726e4456e4;hb=cc61921f0ae7ed05d56abbd690cb97eea560d4a9;hp=91f35a4753d4fa265405686b15aca4e2cd587ce1;hpb=4b19af017623bfa3bb72bb164598a517f586e0d3;p=p5sagit%2Fp5-mst-13.2.git diff --git a/win32/config_h.PL b/win32/config_h.PL index 91f35a4..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|^[\\/]||; @@ -45,7 +53,7 @@ eval $str; die "$str:$@" if $@; open(H,">$file.new") || die "Cannot open $file.new:$!"; -binmode H; # no CRs (which cause a spurious rebuild) +#binmode H; # no CRs (which cause a spurious rebuild) while () { last if /^$term$/o; @@ -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);