diff options
author | Perl 5 Porters <perl5-porters.nicoh.com> | 1996-01-02 03:34:26 +0000 |
---|---|---|
committer | Andy Dougherty <doughera.lafayette.edu> | 1996-01-02 03:34:26 +0000 |
commit | e518068a77032c4207f9b00e462857e158778ea4 (patch) | |
tree | 9065232e3dd336991481bd375d547458f2d779c2 /vms/genconfig.pl | |
parent | f50fdf038490b1573b798e1f87716e6c0df0566e (diff) | |
download | perl-e518068a77032c4207f9b00e462857e158778ea4.tar.gz |
Updated for VMS.
Diffstat (limited to 'vms/genconfig.pl')
-rw-r--r-- | vms/genconfig.pl | 148 |
1 files changed, 106 insertions, 42 deletions
diff --git a/vms/genconfig.pl b/vms/genconfig.pl index ca15aa7943..9200814ef0 100644 --- a/vms/genconfig.pl +++ b/vms/genconfig.pl @@ -6,12 +6,11 @@ # that went into your perl binary. In addition, values which change from run # to run may be supplied on the command line as key=val pairs. # -# Rev. 08-Mar-1995 Charles Bailey bailey@genetics.upenn.edu +# Rev. 13-Dec-1995 Charles Bailey bailey@genetics.upenn.edu # unshift(@INC,'lib'); # In case someone didn't define Perl_Root # before the build -require 'ctime.pl' || die "Couldn't execute ctime.pl: $!\n"; if (-f "config.vms") { $infile = "config.vms"; $outdir = "[-]"; } elsif (-f "[.vms]config.vms") { $infile = "[.vms]config.vms"; $outdir = "[]"; } @@ -28,7 +27,7 @@ $outdir = ''; open(IN,"$infile") || die "Can't open $infile: $!\n"; open(OUT,">${outdir}Config.sh") || die "Can't open ${outdir}Config.sh: $!\n"; -$time = &ctime(time()); +$time = localtime; print OUT <<EndOfIntro; # This file generated by GenConfig.pl on a VMS system. # Input obtained from: @@ -36,16 +35,82 @@ print OUT <<EndOfIntro; # $0 # Time: $time +package='perl5' +CONFIG='true' +cf_time='$time' +osname='VMS' +ld='Link' +lddlflags='/Share' +libc='' +ranlib='' +ar='' +eunicefix=':' +hintfile='' +intsize='4' +alignbytes='8' +shrplib='define' +usemymalloc='n' EndOfIntro +$cf_by = (getpwuid($<))[0]; +print OUT "cf_by='$cf_by'\nperladmin='$cf_by'\n"; + +$hw_model = `Write Sys\$Output F\$GetSyi("HW_MODEL")`; +chomp $hw_model; +if ($hw_model > 1024) { + print OUT "arch='VMS_AXP'\n"; + print OUT "archname='VMS_AXP'\n"; + $archsufx = "AXP"; +} +else { + print OUT "arch='VMS_VAX'\n"; + print OUT "archname='VMS_VAX'\n"; + $archsufx = 'VAX'; +} +$osvers = `Write Sys\$Output F\$GetSyi("VERSION")`; +$osvers =~ s/^V(\S+)\s*\n?$/$1/; +print OUT "osvers='$osvers'\n"; foreach (@ARGV) { ($key,$val) = split('=',$_,2); + if ($key eq 'cc') { # Figure out which C compiler we're using + if (`$val/NoObject/NoList _nla0:/Version` =~ /GNU/) { + print OUT "vms_cc_type='gcc'\n"; + print OUT "d_attribut='define'\n"; + } + elsif ($archsufx eq 'VAX' && + `$val/NoObject/NoList /prefix=all _nla0:` =~ /IVQUAL/) { + print OUT "vms_cc_type='vaxc'\n"; + print OUT "d_attribut='undef'\n"; + } + else { + print OUT "vms_cc_type='decc'\n"; + print OUT "d_attribut='undef'\n"; + # DECC for VAX requires filename in /object qualifier, so we + # have to remove it here. Alas, this means we lose the user's + # object file suffix if it's not .obj. + $val =~ s#/obj(?:ect)?=[^/\s]+##i if $archsufx eq 'VAX';; + } + } print OUT "$key=\'$val\'\n"; - if ($val =~/VMS_DO_SOCKETS/) { $dosock = 1; } + if ($val =~/VMS_DO_SOCKETS/i) { + $dosock = 1; + # Are there any other logicals which TCP/IP stacks use for the host name? + $myname = $ENV{'ARPANET_HOST_NAME'} || $ENV{'INTERNET_HOST_NAME'} || + $ENV{'MULTINET_HOST_NAME'} || $ENV{'UCX$INET_HOST'} || + $ENV{'TCPWARE_DOMAINNAME'} || $ENV{'NEWS_ADDRESS'}; + if (!$myname) { + ($myname) = `hostname` =~ /^(\S+)/; + if ($myname =~ /IVVERB/) { + warn "Can't determine TCP/IP hostname; skipping \$Config{'myhostname'}"; + } + } + print OUT "myhostname='$myname'\n" if $myname; + } } +if (!$dosock) { print OUT "myhostname='$ENV{'SYS$NODE'}'\n"; } while (<IN>) { # roll through the comment header in Config.VMS - last if /^#define _config_h_/; + last if /config-start/; } while (<IN>) { @@ -61,13 +126,15 @@ while (<IN>) { next if /config-skip/; $state = ($blocked || $un) ? 'undef' : 'define'; $token =~ tr/A-Z/a-z/; + $token =~ s/_exp$/exp/; # Config.pm has 'privlibexp' etc. where config.h + # has 'privlib_exp' etc. $val =~ s%/\*.*\*/\s*%%g; $val =~ s/\s*$//; # strip off trailing comment $val =~ s/^"//; $val =~ s/"$//; # remove end quotes $val =~ s/","/ /g; # make signal list look nice if ($val) { print OUT "$token=\'$val\'\n"; } else { $token = "d_$token" unless $token =~ /^i_/; - print OUT "$token=\'$state\'\n"; + print OUT "$token='$state'\n"; } } close IN; @@ -82,29 +149,34 @@ while (<DATA>) { # Add in some of the architecture-dependent stuff which has to be consistent print OUT "d_vms_do_sockets=",$dosock ? "'define'\n" : "'undef'\n"; print OUT "d_has_sockets=",$dosock ? "'define'\n" : "'undef'\n"; -$osvers = `Write Sys\$Output F\$GetSyi("VERSION")`; -chomp $osvers; -$osvers =~ s/^V//; -print OUT "osvers='$osvers'\n"; -$hw_model = `Write Sys\$Output F\$GetSyi("HW_MODEL")`; -chomp $hw_model; -if ($hw_model > 1024) { - print OUT "arch='VMS_AXP'\n"; - print OUT "archname='VMS_AXP'\n"; - $archsufx = "AXP"; -} -else { - print OUT "arch='VMS_VAX'\n"; - print OUT "archname='VMS_VAX'\n"; - $archsufx = 'VAX'; -} $archlib = &VMS::Filespec::vmspath($privlib); $archlib =~ s#\]#.VMS_$archsufx\]#; $installarchlib = &VMS::Filespec::vmspath($installprivlib); $installarchlib =~ s#\]#.VMS_$archsufx\]#; print OUT "archlib='$archlib'\n"; +print OUT "archlibexp='$archlib'\n"; print OUT "installarchlib='$installarchlib'\n"; +if (open(OPT,"${outdir}crtl.opt")) { + while (<OPT>) { + next unless m#/(sha|lib)#i; + chomp; + push(@libs,$_); + } + close OPT; + print OUT "libs='",join(' ',@libs),"'\n"; +} +else { warn "Can't read ${outdir}crtl.opt - skipping \$Config{'libs'}"; } + +# simple pager support for perldoc +if (`most nl:` =~ /IVVERB/) { + $pager = 'more'; + if (`more nl:` =~ /IVVERB/) { $pager = 'type/page'; } +} +else { $pager = 'most'; } +print OUT "pager='$pager'\n"; + +close OUT; __END__ # This list is incomplete in comparison to what ends up in config.sh, but @@ -114,37 +186,29 @@ __END__ # The definitions in this block are constant across most systems, and # should only rarely need to be changed. -osname=VMS # DO NOT CHANGE THIS! Tests elsewhere depend on this to identify - # VMS. Use the 'arch' item below to specify hardware version. -CONFIG=true -PATCHLEVEL=001 -ld=Link -lddlflags=/Share +PATCHLEVEL=002 ccdlflags= cccdlflags= -libc= -ranlib= -eunicefix=: usedl=true -dldir=/ext/dl dlobj=dl_vms.obj dlsrc=dl_vms.c +d_dlsymun=undef so=exe dlext=exe libpth=/sys$share /sys$library -hintfile= -intsize=4 -alignbytes=8 -shrplib=define +d_stdstdio=undef +usevfork=false +castflags=0 +d_castneg=define # should be same as d_castnegfloat from config.vms signal_t=void timetype=long -usemymalloc=n builddir=perl_root:[000000] +prefix=perl_root installprivlib=perl_root:[lib] privlib=perl_root:[lib] installbin=perl_root:[000000] - -# The definitions in this block are site-specific, and will probably need to -# be changed on most systems. -myhostname=nowhere.loopback.edu -libs= # This should list RTLs other than the C RTL and IMAGELIB (e.g. socket RTL) +installman1dir=perl_root:[man.man1] +installman3dir=perl_root:[man.man3] +man1ext=.rno +man3ext=.rno +binexp=perl_root:[000000] # should be same as installbin |