xref: /openbsd/gnu/usr.bin/perl/plan9/setup.rc (revision 256a93a4)
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
12awk -f versnum ../patchlevel.h
13. buildinfo
14
15builddir = `{ 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:
20status=`{cd $builddir; ape/patch -p1 <plan9/9front.patch}
21
22if (~ $#* 0) platforms = $objtype
23if 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
29cp plan9.c plan9ish.h mkfile $builddir
30
31exit;
32# Why is this done during setup and not during 'mk install'?
33# Build library directories
34echo Building library directories ...
35privroot=/sys/lib/perl
36privlib=$privroot/$p9pvers
37sitelib=$privlib/site_perl
38
39if (test ! -d $privroot) mkdir $privroot
40if (test ! -d $privlib) mkdir $privlib
41if (test ! -d $privlib/auto) mkdir $privlib/auto
42if (test ! -d $sitelib) mkdir $sitelib
43for(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 }
60