#! /bin/csh -fx
##############################################################################
#
# File: 	PDIST:MAKE-LAP
# Discription:	Make a fasfile and put it in the $pl directory. The first
#		argument is the directory where the source file is located.
#		The second argument is the name of the file with no extension.
# Author:	Leigh Stoller
# Created:      31-Oct-86
# Mode:		Text
#
# (c) Copyright 1982, University of Utah
# %
# % Redistribution and use in source and binary forms, with or without
# % modification, are permitted provided that the following conditions are met:
# %
# %    * Redistributions of source code must retain the relevant copyright
# %      notice, this list of conditions and the following disclaimer.
# %    * Redistributions in binary form must reproduce the above copyright
# %      notice, this list of conditions and the following disclaimer in the
# %      documentation and/or other materials provided with the distribution.
# %
# % THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# % AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
# % THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# % PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNERS OR
# % CONTRIBUTORS
# % BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# % CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# % SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# % INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# % CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# % ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# % POSSIBILITY OF SUCH DAMAGE.
#
##############################################################################
# Revisions
#
# 27-Apr-87 (Leigh Stoller)
#  Turn on fastcar operations when compiling PSL files.
##############################################################################

pushd $1    # cd into the directory where the .sl file is

$psys/pslcomp << EOF
% For automated scripts, put "" at end to avoid name collisions on machines
%  with 14 character filenames. Also add ulap for use in porting.
%%(reload 386-cmac)
(on verboseload)
(off usermode)

%% For machines that require the carcdr.sl fix for car/cdr of NIL, make sure
%% we turn on fastcar to ensure optimized code. Since PSL was written with
%% the assumption that car/car of NIL was illegal, it is not necessary
%% to generate code to test for this, slowing down all car/cdr operations
%% in the process. For user code though, it defaults to off for safety.
(on fastcar)

%(setq loaddirectories!* (cons "$pl/cross/" loaddirectories!*))
%(load macintel64-cmac)
%(load macintel64-lap)
%(compiletime (remprop 'cons 'opencode))
%(compiletime (remprop 'ncons 'opencode))
%(compiletime (remprop 'xcons 'opencode))

(faslout "\$pl/$2")
(dskin "$1/$2.sl")
(faslend)
(exitlisp)
EOF

@ pslcompstatus = $status
popd
@ status = $pslcompstatus

# End of file.
