4 # Extract info from Config.VMS, and add extra data here, to generate Config.sh
5 # Edit the static information after __END__ to reflect your site and options
6 # that went into your perl binary. In addition, values which change from run
7 # to run may be supplied on the command line as key=val pairs.
9 # Rev. 08-Mar-1995 Charles Bailey bailey@genetics.upenn.edu
12 unshift(@INC,'lib'); # In case someone didn't define Perl_Root
14 require 'ctime.pl' || die "Couldn't execute ctime.pl: $!\n";
16 if (-f "config.vms") { $infile = "config.vms"; $outdir = "[-]"; }
17 elsif (-f "[.vms]config.vms") { $infile = "[.vms]config.vms"; $outdir = "[]"; }
18 elsif (-f "config.h") { $infile = "config.h"; $outdir = "[]";}
20 if ($infile) { print "Generating Config.sh from $infile . . .\n"; }
21 else { die <<EndOfGasp;
22 Can't find config.vms or config.h to read!
23 Please run this script from the perl source directory or
24 the VMS subdirectory in the distribution.
28 open(IN,"$infile") || die "Can't open $infile: $!\n";
29 open(OUT,">${outdir}Config.sh") || die "Can't open ${outdir}Config.sh: $!\n";
31 $time = &ctime(time());
32 print OUT <<EndOfIntro;
33 # This file generated by GenConfig.pl on a VMS system.
34 # Input obtained from:
42 ($key,$val) = split('=',$_,2);
43 print OUT "$key=\'$val\'\n";
44 if ($val =~/VMS_DO_SOCKETS/) { $dosock = 1; }
47 while (<IN>) { # roll through the comment header in Config.VMS
48 last if /^#define _config_h_/;
53 while (/\\\s*$/) { # pick up contination lines
60 next unless my ($blocked,$un,$token,$val) = m%(\/\*)?\s*\#\s*(un)?def\w*\s*([A-za-z0-9]\w+)\S*\s*(.*)%;
61 next if /config-skip/;
62 $state = ($blocked || $un) ? 'undef' : 'define';
63 $token =~ tr/A-Z/a-z/;
64 $val =~ s%/\*.*\*/\s*%%g; $val =~ s/\s*$//; # strip off trailing comment
65 $val =~ s/^"//; $val =~ s/"$//; # remove end quotes
66 $val =~ s/","/ /g; # make signal list look nice
67 if ($val) { print OUT "$token=\'$val\'\n"; }
69 $token = "d_$token" unless $token =~ /^i_/;
70 print OUT "$token=\'$state\'\n";
76 next if /^\s*#/ or /^\s*$/;
78 ($key,$val) = split('=',$_,2);
79 print OUT "$key='$val'\n";
80 eval "\$$key = '$val'";
82 # Add in some of the architecture-dependent stuff which has to be consistent
83 print OUT "d_vms_do_sockets=",$dosock ? "'define'\n" : "'undef'\n";
84 print OUT "d_has_sockets=",$dosock ? "'define'\n" : "'undef'\n";
85 $osvers = `Write Sys\$Output F\$GetSyi("VERSION")`;
88 print OUT "osvers='$osvers'\n";
89 $hw_model = `Write Sys\$Output F\$GetSyi("HW_MODEL")`;
91 if ($hw_model > 1024) {
92 print OUT "arch='VMS_AXP'\n";
93 print OUT "archname='VMS_AXP'\n";
97 print OUT "arch='VMS_VAX'\n";
98 print OUT "archname='VMS_VAX'\n";
101 $archlib = &VMS::Filespec::vmspath($privlib);
102 $archlib =~ s#\]#.VMS_$archsufx\]#;
103 $installarchlib = &VMS::Filespec::vmspath($installprivlib);
104 $installarchlib =~ s#\]#.VMS_$archsufx\]#;
105 print OUT "archlib='$archlib'\n";
106 print OUT "installarchlib='$installarchlib'\n";
110 # This list is incomplete in comparison to what ends up in config.sh, but
111 # should contain the essentials. Some of these definitions reflect
112 # options chosen when building perl or site-specific data; these should
113 # be hand-edited appropriately. Someday, perhaps, we'll get this automated.
115 # The definitions in this block are constant across most systems, and
116 # should only rarely need to be changed.
117 osname=VMS # DO NOT CHANGE THIS! Tests elsewhere depend on this to identify
118 # VMS. Use the 'arch' item below to specify hardware version.
134 libpth=/sys$share /sys$library
142 builddir=perl_root:[000000]
143 installprivlib=perl_root:[lib]
144 privlib=perl_root:[lib]
145 installbin=perl_root:[000000]
147 # The definitions in this block are site-specific, and will probably need to
148 # be changed on most systems.
149 myhostname=nowhere.loopback.edu
150 libs= # This should list RTLs other than the C RTL and IMAGELIB (e.g. socket RTL)