X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=vms%2Fgen_shrfls.pl;h=caba95c04bc04f39426af5dd31fc973de12e8891;hb=6bf425089316a32726a25ea317fa3faa951fb073;hp=ac923749955e0af379c9bbe36fdcd2f6aed49b98;hpb=bd3fa61ce4cf706aee95ff3241fb1c7b94ddf61a;p=p5sagit%2Fp5-mst-13.2.git diff --git a/vms/gen_shrfls.pl b/vms/gen_shrfls.pl index ac92374..caba95c 100644 --- a/vms/gen_shrfls.pl +++ b/vms/gen_shrfls.pl @@ -73,8 +73,9 @@ if ($docc) { open CONFIG, "< $config"; while() { $debugging_enabled++ if /define\s+DEBUGGING/; - $hide_mymalloc++ if /define\s+EMBEDMYMALLOC/; $use_mymalloc++ if /define\s+MYMALLOC/; + $hide_mymalloc++ if /define\s+EMBEDMYMALLOC/; + $use_threads++ if /define\s+USE_THREADS/; } # put quotes back onto defines - they were removed by DCL on the way in @@ -189,21 +190,21 @@ sub scan_func { my($line) = @_; print "\tchecking for global routine\n" if $debug > 1; - if ( $line =~ /(\w+)\s+\(/ ) { + if ( $line =~ /(\w+)\s*\(/ ) { print "\troutine name is \\$1\\\n" if $debug > 1; if ($1 eq 'main' || $1 eq 'perl_init_ext') { print "\tskipped\n" if $debug > 1; } - else { $fcns{$1}++ } + else { $fcns{uc($1)}++ } } } # Go add some right up front if we need 'em if ($use_mymalloc) { - $fcns{'Perl_malloc'}++; - $fcns{'Perl_calloc'}++; - $fcns{'Perl_realloc'}++; - $fcns{'Perl_myfree'}++; + $fcns{uc('Perl_malloc')}++; + $fcns{uc('Perl_calloc')}++; + $fcns{uc('Perl_realloc')}++; + $fcns{uc('Perl_mfree')}++; } $used_expectation_enum = $used_opcode_enum = 0; # avoid warnings @@ -262,18 +263,13 @@ LINE: while () { } close CPP; - -# Kluge to determine whether we need to add EMBED prefix to -# symbols read from local list. vmsreaddirversions() is a VMS- -# specific function whose Perl_ prefix is added in vmsish.h -# if EMBED is #defined. -$embed = exists($fcns{'Perl_vmsreaddirversions'}) ? 'Perl_' : ''; while () { next if /^#/; s/\s+#.*\n//; next if /^\s*$/; ($key,$array) = split('=',$_); - $key = "$embed$key"; + if ($array eq 'vars') { $key = "PL_$key"; } + else { $key = "Perl_$key"; } print "Adding $key to \%$array list\n" if $debug > 1; ${$array}{$key}++; } @@ -300,14 +296,6 @@ if ($isvaxc) { print STDERR "Unrecognized enum constant \"$_\" ignored\n"; } } -elsif ($isgcc) { - # gcc creates this as a SHR,WRT psect in globals.c, but we - # don't see it in the perl.h scan, since it's only declared - # if DOINIT is #defined. Bleah. It's cheaper to just add - # it by hand than to add /Define=DOINIT to the preprocessing - # run and wade through all the extra junk. - $vars{"${embed}Error"}++; -} # Eventually, we'll check against existing copies here, so we can add new # symbols to an existing options file in an upwardly-compatible manner. @@ -320,6 +308,7 @@ if ($isvax) { or die "$0: Can't write to ${dir}perlshr_gbl${marord}.mar: $!\n"; print MAR "\t.title perlshr_gbl$marord\n"; } + unless ($isgcc) { print OPTBLD "PSECT_ATTR=\$GLOBAL_RO_VARS,PIC,NOEXE,RD,NOWRT,SHR\n"; print OPTBLD "PSECT_ATTR=\$GLOBAL_RW_VARS,PIC,NOEXE,RD,WRT,NOSHR\n"; @@ -405,9 +394,26 @@ if ($isvax) { # Initial hack to permit building of compatible shareable images for a # given version of Perl. if ($ENV{PERLSHR_USE_GSMATCH}) { - my $major = int($] * 1000) & 0xFF; # range 0..255 - my $minor = int(($] * 1000 - $major) * 100 + 0.5) & 0xFF; # range 0..255 - print OPTBLD "GSMATCH=LEQUAL,$major,$minor\n"; + if ($ENV{PERLSHR_USE_GSMATCH} eq 'INCLUDE_COMPILE_OPTIONS') { + # Build up a major ID. Since it can only be 8 bits, we encode the version + # number in the top four bits and use the bottom four for build options + # that'll cause incompatibilities + ($ver, $sub) = $] =~ /\.(\d\d\d)(\d\d)/; + $gsmatch = ($sub >= 50) ? "equal" : "lequal"; # Force an equal match for + # dev, but be more forgiving + # for releases + + $ver *=16; + $ver += 8 if $debugging_enabled; # If DEBUGGING is set + $ver += 4 if $use_threads; # if we're threaded + $ver += 2 if $use_mymalloc; # if we're using perl's malloc + print OPTBLD "GSMATCH=$gsmatch,$ver,$sub\n"; + } + else { + my $major = int($] * 1000) & 0xFF; # range 0..255 + my $minor = int(($] * 1000 - $major) * 100 + 0.5) & 0xFF; # range 0..255 + print OPTBLD "GSMATCH=LEQUAL,$major,$minor\n"; + } print OPTBLD 'CLUSTER=$$TRANSFER_VECTOR,,', map(",$_$objsuffix",@symfiles), "\n"; } @@ -430,22 +436,3 @@ __END__ regkind=vars # declared in regcomp.h simple=vars # declared in regcomp.h varies=vars # declared in regcomp.h -watchaddr=vars # declared in run.c -watchok=vars # declared in run.c -yychar=vars # generated by byacc in perly.c -yycheck=vars # generated by byacc in perly.c -yydebug=vars # generated by byacc in perly.c -yydefred=vars # generated by byacc in perly.c -yydgoto=vars # generated by byacc in perly.c -yyerrflag=vars # generated by byacc in perly.c -yygindex=vars # generated by byacc in perly.c -yylen=vars # generated by byacc in perly.c -yylhs=vars # generated by byacc in perly.c -yylval=vars # generated by byacc in perly.c -yyname=vars # generated by byacc in perly.c -yynerrs=vars # generated by byacc in perly.c -yyrindex=vars # generated by byacc in perly.c -yyrule=vars # generated by byacc in perly.c -yysindex=vars # generated by byacc in perly.c -yytable=vars # generated by byacc in perly.c -yyval=vars # generated by byacc in perly.c