summaryrefslogtreecommitdiff
path: root/h2pl/mkvars
diff options
context:
space:
mode:
authorLarry Wall <lwall@jpl-devvax.jpl.nasa.gov>1990-08-08 17:06:03 +0000
committerLarry Wall <lwall@jpl-devvax.jpl.nasa.gov>1990-08-08 17:06:03 +0000
commit450a55e4ae4b31d34735cf512c9f6c2f3a39ddad (patch)
tree752aeabe6e76da59a339e47582e399d4e5c184fe /h2pl/mkvars
parent154e51a4a1b0258759b5e901183403af515a35b9 (diff)
downloadperl-450a55e4ae4b31d34735cf512c9f6c2f3a39ddad.tar.gz
perl 3.0 patch #23 patch #19, continued
See patch #19.
Diffstat (limited to 'h2pl/mkvars')
-rw-r--r--h2pl/mkvars31
1 files changed, 31 insertions, 0 deletions
diff --git a/h2pl/mkvars b/h2pl/mkvars
new file mode 100644
index 0000000000..c6b5ad14da
--- /dev/null
+++ b/h2pl/mkvars
@@ -0,0 +1,31 @@
+#!/usr/bin/perl
+
+require 'sizeof.ph';
+
+$LIB = '/usr/local/lib/perl';
+
+foreach $include (@ARGV) {
+ printf STDERR "including %s\n", $include;
+ do $include;
+ warn "sourcing $include: $@\n" if ($@);
+ if (!open (INCLUDE,"$LIB/$include")) {
+ warn "can't open $LIB/$include: $!\n";
+ next;
+ }
+ while (<INCLUDE>) {
+ chop;
+ if (/^\s*eval\s+'sub\s+(\w+)\s.*[^{]$/ || /^\s*sub\s+(\w+)\s.*[^{]$/) {
+ $var = $1;
+ $val = eval "&$var;";
+ if ($@) {
+ warn "$@: $_";
+ print <<EOT
+warn "\$$var isn't correctly set" if defined \$_main{'$var'};
+EOT
+ next;
+ }
+ ( $nval = sprintf ("%x",$val ) ) =~ tr/a-z/A-Z/;
+ printf "\$%s = 0x%s;\n", $var, $nval;
+ }
+ }
+}