diff options
author | Romano <unobe@cpan.org> | 2020-06-25 15:08:04 -0700 |
---|---|---|
committer | Nicolas R <nicolas@atoomic.org> | 2020-08-03 16:33:11 -0600 |
commit | a123eb892ee6a30b5910abc29fbccf2386306e08 (patch) | |
tree | 8bf7db7128ed831c0452e5151b38820e6c7a440c /plan9/genconfig.pl | |
parent | be2a5c504c374b2061df9780050f2d8223cf27ff (diff) | |
download | perl-a123eb892ee6a30b5910abc29fbccf2386306e08.tar.gz |
Plan9/9front i386 fixes
Diffstat (limited to 'plan9/genconfig.pl')
-rw-r--r-- | plan9/genconfig.pl | 52 |
1 files changed, 30 insertions, 22 deletions
diff --git a/plan9/genconfig.pl b/plan9/genconfig.pl index ebd97db018..14c1faed25 100644 --- a/plan9/genconfig.pl +++ b/plan9/genconfig.pl @@ -7,17 +7,21 @@ # to run may be supplied on the command line as key=val pairs. # # Last Modified: 28-Jun-1996 Luther Huffman lutherh@stratcom.com +# Last Modified: May 2020 David Romano unobe@cpan.org # +my $VERBOSE = 0; + #==== Locations of installed Perl components $p9pvers="_P9P_VERSION"; +$version="$p9pvers"; $prefix=''; $p9p_objtype=$ENV{'objtype'}; $builddir="/sys/src/cmd/perl/$p9pvers"; $installbin="/$p9p_objtype/bin"; $installman1dir="/sys/man/1"; $installman3dir="/sys/man/2"; -$installprivlib="/sys/lib/perl"; +$installprivlib="/sys/lib/perl/$p9pvers"; $installarchlib = "/$p9p_objtype/lib/perl/$p9pvers"; $archname="plan9_$p9p_objtype"; $installsitelib="$installprivlib/site_perl"; @@ -28,13 +32,15 @@ unshift(@INC,'lib'); # In case someone didn't define Perl_Root # before the build if ($ARGV[0] eq '-f') { + shift @ARGV; open(ARGS,'<',$ARGV[1]) or die "Can't read data from $ARGV[1]: $!\n"; - @ARGV = (); + shift @ARGV; while (<ARGS>) { push(@ARGV,split(/\|/,$_)); } close ARGS; } +my @extensions = @ARGV; if (-f "config.h") { $infile = "config.h"; $outdir = "../"; } elsif (-f "plan9/config.h") { $infile = "plan9/config.h"; $outdir = "./"; } @@ -54,11 +60,9 @@ $time = localtime; $cf_by = $ENV{'user'}; ($vers = $]) =~ tr/./_/; -# Plan 9 doesn't actually use version numbering. Following the original Unix -# precedent of assigning a Unix edition number based on the edition number -# of the manuals, I am referring to this as Plan 9, 1st edition. -$osvers = '1'; - +# 9front as Plan 9, 5th edition. +$osvers = '5'; + print OUT <<EndOfIntro; # This file generated by genconfig.pl on a Plan 9 system. # Input obtained from: @@ -67,13 +71,15 @@ print OUT <<EndOfIntro; # Time: $time package='perl5' -CONFIG='true' +PERL_CONFIG_SH='true' cf_time='$time' cf_by='$cf_by' ccdlflags='' cccdlflags='' libpth='$installprivlib' ld='pcc' +cppflags='' +cppstdin='cpp' lddlflags='' ranlib='' ar='ar' @@ -96,7 +102,8 @@ man3ext='' arch='$archname' archname='$archname' osname='plan9' -extensions='IO Socket Opcode Fcntl POSIX DynaLoader FileHandle' +version='$p9pvers' +extensions='@extensions' osvers='$osvers' sig_maxsig='19' sig_name='ZERO HUP INT QUIT ILL ABRT FPE KILL SEGV PIPE ALRM TERM USR1 USR2 CHLD CONT STOP TSTP TTIN TTOU' @@ -176,7 +183,9 @@ print OUT "myuname='Plan9 $myname $osvers $p9p_objtype'\n"; # equivalent to the C preprocessor macros if (open(SH,'<',"${outdir}config_h.SH")) { while (<SH>) { - next unless m%^#(?!if).*\$%; + # suicide @ regcomp.c:22117 + #next unless m%^#(?!if).*\$%; + next unless !index($_, '#') && index($_, '#if') == -1 && rindex($_, '$') == length($_)-1; s/^#//; s!(.*?)\s*/\*.*!$1!; my(@words) = split; $words[1] =~ s/\(.*//; # Clip off args from macro @@ -195,7 +204,7 @@ if (open(SH,'<',"${outdir}config_h.SH")) { } close SH; } -else { warn "Couldn't read ${outfile}config_h.SH: $!\n"; } +elsif ($VERBOSE) { warn "Couldn't read ${outfile}config_h.SH: $!\n"; } $pp_vars{PLAN9} = 'define'; #Plan 9 specific # OK, now read the C header file, and retcon statements into config.sh @@ -233,7 +242,7 @@ while (<IN>) { } elsif (not length $val and not $had_val) { # Wups -- should have been shell var for C preprocessor directive - warn "Constant $token not found in config_h.SH\n"; + warn "Constant $token not found in config_h.SH\n" if $VERBOSE; $token =~ tr/A-Z/a-z/; $token = "d_$token" unless $token =~ /^i_/; print OUT "$token='$state'\n"; @@ -248,7 +257,7 @@ while (<IN>) { delete $val_vars{$token}; } elsif (!$pp_vars{$token}) { # Haven't seen it previously, either - warn "Constant $token not found in config_h.SH (val=|$val|)\n"; + warn "Constant $token not found in config_h.SH (val=|$val|)\n" if $VERBOSE; $token =~ tr/A-Z/a-z/; print OUT "$token='$val'\n"; if ($token =~ s/exp$//) {print OUT "$token='$val'\n";} @@ -256,14 +265,15 @@ while (<IN>) { } close IN; -foreach (sort keys %pp_vars) { - warn "Didn't see $_ in $infile\n"; -} -foreach (sort keys %val_vars) { - warn "Didn't see $_ in $infile(val)\n"; +if ($VERBOSE) { + foreach (sort keys %pp_vars) { + warn "Didn't see $_ in $infile\n"; + } + foreach (sort keys %val_vars) { + warn "Didn't see $_ in $infile(val)\n"; + } } - # print OUT "libs='",join(' ',@libs),"'\n"; # print OUT "libc='",join(' ',@crtls),"'\n"; @@ -280,10 +290,8 @@ if (open(PL,'<',"${outdir}patchlevel.h")) { } close PL; } -else { warn "Can't read ${outdir}patchlevel.h - skipping 'PERL_VERSION'"; } +elsif ($VERBOSE) { warn "Can't read ${outdir}patchlevel.h - skipping 'PERL_VERSION'" } print OUT "pager='/bin/p'\n"; close OUT; - - |