Commit | Line | Data |
---|---|---|
396e9e6f | 1 | #!/bin/rc |
a123eb89 R |
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: | |
396e9e6f | 7 | # Luther Huffman, Strategic Computer Solutions, Inc., lutherh@stratcom.com |
a123eb89 R |
8 | # Last modified May 2020 by: |
9 | # David Romano, unobe@cpan.org | |
396e9e6f | 10 | |
a123eb89 | 11 | # Get the Perl version information |
760ac839 | 12 | awk -f versnum ../patchlevel.h |
396e9e6f | 13 | . buildinfo |
a123eb89 R |
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 | ||
16da7c01 LH |
22 | if (~ $#* 0) platforms = $objtype |
23 | if not switch($1) { | |
a123eb89 | 24 | case -a ; platforms = (386 68000 68020 arm arm amd64 mips power power64 sparc sparc64 spim) |
16da7c01 LH |
25 | case * ; echo 'Usage: setup.rc [-a]' >[1=2] ; exit |
26 | } | |
396e9e6f | 27 | |
a123eb89 R |
28 | # Update some files |
29 | cp plan9.c plan9ish.h mkfile $builddir | |
396e9e6f | 30 | |
a123eb89 R |
31 | exit; |
32 | # Why is this done during setup and not during 'mk install'? | |
33 | # Build library directories | |
396e9e6f | 34 | echo Building library directories ... |
a123eb89 R |
35 | privroot=/sys/lib/perl |
36 | privlib=$privroot/$p9pvers | |
37 | sitelib=$privlib/site_perl | |
38 | ||
39 | if (test ! -d $privroot) mkdir $privroot | |
396e9e6f PP |
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){ | |
a123eb89 R |
44 | archroot=/$i/lib/perl |
45 | archlib=$archroot/$p9pvers | |
396e9e6f PP |
46 | sitearch=$archlib/site_perl |
47 | corelib=$archlib/CORE | |
48 | arpalib=$corelib/arpa | |
a123eb89 | 49 | if (test ! -d $archroot) mkdir $archroot |
396e9e6f PP |
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 | |
a123eb89 R |
54 | cp $builddir/*.h *.h $corelib |
55 | cp arpa/*.h $arpalib | |
396e9e6f PP |
56 | } |
57 | ||
a123eb89 | 58 | # Populate library directories |
396e9e6f | 59 | {cd $builddir/lib ; tar c . } | {cd $privlib ; tar x } |