This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perlsub - indicate version requirement for "delete local"
[perl5.git] / plan9 / setup.rc
1 #!/bin/rc
2 # This is an rc shell script puts files where they belong and does a bit of
3 # patching in order not to modify some perl core code which might impact other
4 # OSes. To use, just run it from within the plan9 subdirectory with the
5 # appropriate permissions.
6 # First modified 6/30/96 by:
7 # Luther Huffman, Strategic Computer Solutions, Inc., lutherh@stratcom.com
8 # Last modified May 2020 by:
9 # David Romano, unobe@cpan.org
10
11 # Get the Perl version information
12 awk -f versnum ../patchlevel.h
13 . buildinfo
14
15 builddir = `{ cd .. ; pwd }
16  
17 # 'typestr' is used by /sys/src/cmd/cc/lex.c, but not sure when/if it is ever used.
18 # Patch sv.c from afar, which uses 'typestr' as a variable name, and uses bit-fields.
19 # Also patch some other things:
20 status=`{cd $builddir; ape/patch -p1 <plan9/9front.patch}
21
22 if (~ $#* 0) platforms = $objtype
23 if not switch($1) {
24         case -a ; platforms = (386 68000 68020 arm arm amd64 mips power power64 sparc sparc64 spim)
25         case * ; echo 'Usage: setup.rc [-a]' >[1=2] ; exit
26 }
27
28 # Update some files
29 cp plan9.c plan9ish.h mkfile $builddir
30
31 exit;
32 # Why is this done during setup and not during 'mk install'?
33 # Build library directories
34 echo Building library directories ...
35 privroot=/sys/lib/perl
36 privlib=$privroot/$p9pvers
37 sitelib=$privlib/site_perl
38
39 if (test ! -d $privroot) mkdir $privroot
40 if (test ! -d $privlib) mkdir $privlib
41 if (test ! -d $privlib/auto) mkdir $privlib/auto
42 if (test ! -d $sitelib) mkdir $sitelib
43 for(i in $platforms){
44         archroot=/$i/lib/perl
45         archlib=$archroot/$p9pvers
46         sitearch=$archlib/site_perl
47         corelib=$archlib/CORE
48         arpalib=$corelib/arpa
49         if (test ! -d $archroot) mkdir $archroot
50         if (test ! -d $archlib) mkdir $archlib
51         if (test ! -d $sitearch) mkdir $sitearch
52         if (test ! -d $corelib) mkdir $corelib
53         if (test ! -d $arpalib) mkdir $arpalib
54         cp $builddir/*.h *.h  $corelib
55         cp arpa/*.h  $arpalib
56 }
57
58 # Populate library directories
59 {cd $builddir/lib ; tar c . } | {cd $privlib ; tar x }