#!/bin/csh -f
#
# dump,v 1.6 1992/11/16 09:50:37 jan Exp
#
# Create a stand alone executable of SWI-Prolog/PCE by loading the PCE
# object files into prolog and creating a saved-state
#
# Copyright 1991, 1992, University of Amsterdam

if ( $#argv != 2 ) then
    echo "Usage: dump prolog pce"
    exit 1
endif

set prolog=$1
set pce=$2

if ( -e $pce ) rm -f $pce

if ( ! $?DLD ) setenv DLD 1

$prolog -f none << _EOS_
[pl_pce].
save_program('$pce',
	[ goal		= 'pce_host:pce_reinitialise'
	]).
make_library_index('../prolog/lib').
halt.
_EOS_

if ( -x $pce ) then
    echo ""
    echo "Installation completed successfully."
    rm -f $pce~
    exit 0
else
    echo ""
    echo "Installation failed"
    if ( -x $pce~ ) mv $pce~ $pce
    exit 1
endif
