1#!/bin/csh -fx
2###############################################################################
3#
4# File:           PDIST:MAKE-BARE-PSL
5# Description:    This file constructs a new  BARE-PSL
6# Author:         Leigh Stoller
7# Created:        01-Nov-86
8# Modified:
9# Mode:           C Shell
10# Package:        Tools
11#
12# (c) Copyright 1982, University of Utah
13# %
14# % Redistribution and use in source and binary forms, with or without
15# % modification, are permitted provided that the following conditions are met:
16# %
17# %    * Redistributions of source code must retain the relevant copyright
18# %      notice, this list of conditions and the following disclaimer.
19# %    * Redistributions in binary form must reproduce the above copyright
20# %      notice, this list of conditions and the following disclaimer in the
21# %      documentation and/or other materials provided with the distribution.
22# %
23# % THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
24# % AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
25# % THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
26# % PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNERS OR
27# % CONTRIBUTORS
28# % BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29# % CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30# % SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31# % INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
32# % CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33# % ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34# % POSSIBILITY OF SUCH DAMAGE.
35#
36###############################################################################
37# Revisions:
38#
39# 21.Nov 1991 (Winfried Neun)
40#  changes to support .img files (for IBM RS6000, HP Risc, etc
41#
42###############################################################################
43
44unset inprocess
45
46
47if ($MACHINE == apollo) then
48   set imagesize=3000000
49  else if ($MACHINE == sun386) then
50   set imagesize=3000000
51  else if ($MACHINE == cray-t3d) then
52   set imagesize=20000000
53  else if ($MACHINE == Alpha) then
54   set imagesize=12000000
55  else if ($MACHINE == Mips_dec) then
56   set imagesize=8000000
57  else if ($MACHINE == Mips_iris) then
58   set imagesize=8000000
59  else if ($MACHINE == Ibmrs) then
60   set imagesize=8000000
61  else if ($MACHINE == brock) then
62   set imagesize=1000
63  else if ($MACHINE == AMD64) then
64   set imagesize=1000
65  else if ($MACHINE == AMD64_ext) then
66   set imagesize=1000
67  else if ($MACHINE == macintel64) then
68   set imagesize=1000
69  else if ($MACHINE == mingw-w64) then
70   set imagesize=1000
71  else if ($MACHINE == freeBSD64) then
72   set imagesize=1000
73  else if ($MACHINE == aarch64) then
74   set imagesize=1000
75  else
76   set imagesize=10000000
77endif
78
79
80pushd $pnkl			# Go where the files to be loaded are.
81setenv SavingPSL yes		# skip user startup before savesystem
82
83if ( -e $psys/.imago) then
84    mv -f $psys/bare-psl.img $psys/old-bare-psl.img
85  else
86    mv -f $psys/bare-psl $psys/old-bare-psl
87endif
88
89$pxk/bpsl -td $imagesize << EOF
90(setq loaddirectories* '("" "$pl/"))
91(on verboseload)
92(setq symbolfilename* "$pxk/bpsl")
93(cond ((equal "cray-t3d" (getenv "MACHINE")) (copyd 'pre-main 'pre-main-2)))
94(savesystem 
95  (cond ((unboundp '**low-case) "Bare PSL 3.4")
96        (t "Bare PSL 4.2"))
97         "\$psys/bare-psl" NIL)
98(exitlisp)
99EOF
100
101cat > $psys/bare-psl << EOFFF
102#
103\$pxk/bpsl -td $imagesize -f \$psys/bare-psl.img \$*
104#
105EOFFF
106
107chmod +x $psys/bare-psl
108
109cat > $psys/tmp.sed << EOFF
110s/HERE/$PROOT/g
111EOFF
112
113## sed -f  $psys/tmp.sed  $PROOT/run-bare-psl.tmpl >  $PROOT/run-bare-psl.sh
114
115@ pslcompstatus = $status
116popd
117
118if ( -x $psys/sparsify ) then
119    if ( -e $psys/.imago) then
120        $psys/sparsify $psys/bare-psl.img
121      else
122        $psys/sparsify $psys/bare-psl
123    endif
124endif
125
126@ status = $pslcompstatus
127
128# End of file.
129