Only compile Perl_hv_assert with DEBUGGING.
[p5sagit/p5-mst-13.2.git] / wince / config_h.PL
index b5f5e38..9a23252 100644 (file)
@@ -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;
@@ -14,6 +19,8 @@ while (@ARGV && $ARGV[0] =~ /^([\w_]+)=(.*)$/)
 
 $opt{CONFIG_H} ||= 'config.h';
 
+warn "Writing $opt{CONFIG_H}\n";
+
 my $patchlevel = $opt{INST_VER};
 $patchlevel =~ s|^[\\/]||;
 $patchlevel =~ s|~VERSION~|$Config{version}|g;
@@ -69,11 +76,11 @@ close(H);
 close(SH);
 
 
-chmod(0666,"config.h");
-copy("$file.new","config.h") || die "Cannot copy:$!";
-chmod(0444,"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);