X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=vms%2Fgenconfig.pl;h=6e9df703ebd9cad3c0aa368fbbbe28b7b3a5d6c3;hb=abdc98d4d1d4977a2f117cdf04cc23b0bad1e031;hp=97679d5e488d709316796f5bc6aa7a42881693ee;hpb=44a8e56aa037ed0f03f0506f6f85f5ed290c78e1;p=p5sagit%2Fp5-mst-13.2.git diff --git a/vms/genconfig.pl b/vms/genconfig.pl index 97679d5..6e9df70 100644 --- a/vms/genconfig.pl +++ b/vms/genconfig.pl @@ -6,7 +6,7 @@ # 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. 3-Dec-1996 Charles Bailey bailey@genetics.upenn.edu +# Rev. 16-Feb-1998 Charles Bailey bailey@newman.upenn.edu # #==== Locations of installed Perl components @@ -26,6 +26,7 @@ if ($ARGV[0] eq '-f') { open(ARGS,$ARGV[1]) or die "Can't read data from $ARGV[1]: $!\n"; @ARGV = (); while () { + chomp; push(@ARGV,split(/\|/,$_)); } close ARGS; @@ -67,23 +68,20 @@ package='perl5' CONFIG='true' cf_time='$time' cf_by='$cf_by' -ccdlflags='' -cccdlflags='' -mab='' +ccdlflags='undef' +cccdlflags='undef' +mab='undef' libpth='/sys\$share /sys\$library' ld='Link' lddlflags='/Share' -ranlib='' -ar='' +ranlib='undef' +ar='undef' eunicefix=':' hint='none' -hintfile='' -intsize='4' -alignbytes='8' -shrplib='define' +hintfile='undef' +useshrplib='define' usemymalloc='n' usevfork='true' -useposix='false' spitshell='write sys\$output ' dlsrc='dl_vms.c' binexp='$installbin' @@ -91,6 +89,8 @@ man1ext='rno' man3ext='rno' arch='VMS_$archsufx' archname='VMS_$archsufx' +bincompat3='undef' +d_bincompat3='undef' osvers='$osvers' prefix='$prefix' builddir='$builddir' @@ -102,10 +102,9 @@ installprivlib='$installprivlib' installarchlib='$installarchlib' installsitelib='$installsitelib' installsitearch='$installsitearch' -startperl='\$ perl 'f\$env("procedure")' - ! q# - 'p1' 'p2' 'p3' 'p4' 'p5' 'p6' 'p7' 'p8' -$ exit !# -' +path_sep='|' +startperl='\$ perl 'f\$env("procedure")' 'p1' 'p2' 'p3' 'p4' 'p5' 'p6' 'p7' 'p8' ! +\$ exit++ + ++\$status != 0 and \$exit = \$status = undef;' EndOfIntro foreach (@ARGV) { @@ -141,7 +140,14 @@ foreach (@ARGV) { $d_attr = 'undef'; } print OUT "vms_cc_type='$cctype'\n"; - print OUT "d_attribut='$d_attr'\n"; + print OUT "d_attribute_format='$d_attr'\n"; + # XXX The following attributes may be able to use $d_attr, too. + print OUT "d_attribute_malloc='undef'\n"; + print OUT "d_attribute_nonnull='undef'\n"; + print OUT "d_attribute_noreturn='undef'\n"; + print OUT "d_attribute_pure='undef'\n"; + print OUT "d_attribute_unused='undef'\n"; + print OUT "d_attribute_warn_unused_result='undef'\n"; print OUT "cc='$cc'\n"; if ( ($cctype eq 'decc' and $archsufx eq 'VAX') || $cctype eq 'gcc') { # gcc and DECC for VAX requires filename in /object qualifier, so we @@ -149,24 +155,93 @@ foreach (@ARGV) { # object file suffix if it's not .obj. $ccflags =~ s#/obj(?:ect)?=[^/\s]+##i; } + $debug = $optimize = ''; + while ( ($qual) = $ccflags =~ m|(/(No)?Deb[^/]*)|i ) { + $debug = $qual; + $ccflags =~ s/$qual//; + } + while ( ($qual) = $ccflags =~ m|(/(No)?Opt[^/]*)|i ) { + $optimize = $qual; + $ccflags =~ s/$qual//; + } + $usethreads = ($ccflags =~ m!/DEF[^/]+USE_5005THREADS!i and + $ccflags !~ m!/UND[^/]+USE_5005THREADS!i); + print OUT "usethreads='",($usethreads ? 'define' : 'undef'),"'\n";; + $optimize = "$debug$optimize"; print OUT "ccflags='$ccflags'\n"; + print OUT "optimize='$optimize'\n"; $dosock = ($ccflags =~ m!/DEF[^/]+VMS_DO_SOCKETS!i and $ccflags !~ m!/UND[^/]+VMS_DO_SOCKETS!i); print OUT "d_vms_do_sockets=",$dosock ? "'define'\n" : "'undef'\n"; print OUT "d_socket=",$dosock ? "'define'\n" : "'undef'\n"; print OUT "d_sockpair=",$dosock ? "'define'\n" : "'undef'\n"; print OUT "d_gethent=",$dosock ? "'define'\n" : "'undef'\n"; + print OUT "d_sethent=",$dosock ? "'define'\n" : "'undef'\n"; print OUT "d_select=",$dosock ? "'define'\n" : "'undef'\n"; + print OUT "i_netdb=",$dosock ? "'define'\n" : "'undef'\n"; print OUT "i_niin=",$dosock ? "'define'\n" : "'undef'\n"; print OUT "i_neterrno=",$dosock ? "'define'\n" : "'undef'\n"; + print OUT "d_gethbyname=",$dosock ? "'define'\n" : "'undef'\n"; + print OUT "d_gethbyaddr=",$dosock ? "'define'\n" : "'undef'\n"; + print OUT "d_getpbyname=",$dosock ? "'define'\n" : "'undef'\n"; + print OUT "d_getpbynumber=",$dosock ? "'define'\n" : "'undef'\n"; + print OUT "d_getsbyname=",$dosock ? "'define'\n" : "'undef'\n"; + print OUT "d_getsbyport=",$dosock ? "'define'\n" : "'undef'\n"; + print OUT "d_endhent=",$dosock ? "'define'\n" : "'undef'\n"; + print OUT "d_getpent=",$dosock ? "'define'\n" : "'undef'\n"; + print OUT "d_setpent=",$dosock ? "'define'\n" : "'undef'\n"; + print OUT "d_endpent=",$dosock ? "'define'\n" : "'undef'\n"; + print OUT "d_getsent=",$dosock ? "'define'\n" : "'undef'\n"; + print OUT "d_setsent=",$dosock ? "'define'\n" : "'undef'\n"; + print OUT "d_endsent=",$dosock ? "'define'\n" : "'undef'\n"; + print OUT "netdb_name_type=",$dosock ? "'char *'\n" : "'undef'\n"; + print OUT "netdb_host_type=",$dosock ? "'char *'\n" : "'undef'\n"; + print OUT "netdb_hlen_type=",$dosock ? "'int'\n" : "'undef'\n"; + print OUT "d_gethostprotos=",$dosock ? "'define'\n" : "'undef'\n"; + print OUT "d_getnetprotos=",$dosock ? "'define'\n" : "'undef'\n"; + print OUT "d_getservprotos=",$dosock ? "'define'\n" : "'undef'\n"; + print OUT "d_getprotoprotos=",$dosock ? "'define'\n" : "'undef'\n"; + + if ($dosock and $cctype eq 'decc' and $ccflags =~ /DECCRTL_SOCKETS/) { + print OUT "selecttype='fd_set'\n"; + print OUT "d_getnbyaddr='define'\n"; + print OUT "d_getnbyname='define'\n"; + print OUT "d_getnent='define'\n"; + print OUT "d_setnent='define'\n"; + print OUT "d_endnent='define'\n"; + print OUT "netdb_net_type='long'\n"; + } + else { + print OUT "selecttype='int'\n"; + print OUT "d_getnybname='undef'\n"; + print OUT "d_getnybaddr='undef'\n"; + print OUT "d_getnent='undef'\n"; + print OUT "d_setnent='undef'\n"; + print OUT "d_endnent='undef'\n"; + print OUT "netdb_net_type='undef'\n"; + } - if ($cctype eq 'decc') { $rtlhas = 'define'; } - else { $rtlhas = 'undef'; } + if ($cctype eq 'decc') { + $rtlhas = 'define'; + print OUT "useposix='true'\n"; + ($ccver,$vmsver) = `$cc/VERSION` =~ /V(\S+) on .*V(\S+)$/; + # Best guess; the may be wrong on systems which have separately + # installed the new CRTL. + if ($ccver >= 5.2 and $vmsver >= 7) { $rtlnew = 'define'; } + else { $rtlnew = 'undef'; } + } + else { $rtlhas = $rtlnew = 'undef'; print OUT "useposix='false'\n"; } foreach (qw[ d_stdstdio d_stdio_ptr_lval d_stdio_cnt_lval d_stdiobase d_locconv d_setlocale i_locale d_mbstowcs d_mbtowc d_wcstombs d_wctomb d_mblen d_mktime d_strcoll d_strxfrm ]) { print OUT "$_='$rtlhas'\n"; } + print OUT "d_stdio_ptr_lval_sets_cnt='undef'\n"; + print OUT "d_stdio_ptr_lval_nochange_cnt='undef'\n"; + foreach (qw[ d_gettimeod d_uname d_truncate d_wait4 d_index + d_pathconf d_fpathconf d_sysconf d_sigsetjmp ]) { + print OUT "$_='$rtlnew'\n"; + } next; } elsif ($key eq 'exe_ext') { @@ -255,13 +330,15 @@ while () { $val =~ s!\s*/\*.*!!; # strip off trailing comment my($had_val); # Maybe a macro with args that we just #undefd or commented if (!length($val) and $val_vars{$token} and ($un || $blocked)) { - print OUT "$val_vars{$token}=''\n"; + print OUT "$val_vars{$token}=''\n" unless exists $done{$val_vars{$token}}; + $done{$val_vars{$token}}++; delete $val_vars{$token}; $had_val = 1; } $state = ($blocked || $un) ? 'undef' : 'define'; if ($pp_vars{$token}) { - print OUT "$pp_vars{$token}='$state'\n"; + print OUT "$pp_vars{$token}='$state'\n" unless exists $done{$pp_vars{$token}}; + $done{$pp_vars{$token}}++; delete $pp_vars{$token}; } elsif (not length $val and not $had_val) { @@ -277,8 +354,11 @@ while () { # Library directory; convert to VMS syntax $val = VMS::Filespec::vmspath($val) if ($token =~ /EXP$/); if ($val_vars{$token}) { - print OUT "$val_vars{$token}='$val'\n"; - if ($val_vars{$token} =~ s/exp$//) {print OUT "$val_vars{$token}='$val'\n";} + print OUT "$val_vars{$token}='$val'\n" unless exists $done{$val_vars{$token}}; + if ($val_vars{$token} =~ s/exp$//) { + print OUT "$val_vars{$token}='$val'\n" unless exists $done{$val_vars{$token}};; + } + $done{$val_vars{$token}}++; delete $val_vars{$token}; } elsif (!$pp_vars{$token}) { # Haven't seen it previously, either @@ -294,6 +374,9 @@ close IN; # as the manifest for the obsolete variable $d_eunice. print OUT "d_eunice='undef'\n"; delete $pp_vars{VMS}; +# XXX temporary -- USE_5005THREADS is currently on CC command line +delete $pp_vars{'USE_5005THREADS'}; + foreach (sort keys %pp_vars) { warn "Didn't see $_ in $infile\n"; } @@ -317,8 +400,14 @@ else { warn "Can't read ${outdir}crtl.opt - skipping 'libs' & 'libc'"; } if (open(PL,"${outdir}patchlevel.h")) { while () { - if (/^#define PATCHLEVEL\s+(\S+)/) { print OUT "PATCHLEVEL='$1'\n"; } - elsif (/^#define SUBVERSION\s+(\S+)/) { print OUT "SUBVERSION='$1'\n"; } + if (/^#define PERL_VERSION\s+(\S+)/) { + print OUT "PERL_VERSION='$1'\n"; + print OUT "PATCHLEVEL='$1'\n"; # XXX compat + } + elsif (/^#define PERL_SUBVERSION\s+(\S+)/) { + print OUT "PERL_SUBVERSION='$1'\n"; + print OUT "SUBVERSION='$1'\n"; # XXX compat + } } close PL; }