2005-12-24 18:00:21 +00:00
|
|
|
#!/bin/sh
|
2004-07-09 01:41:35 +01:00
|
|
|
|
2004-08-16 17:41:11 +01:00
|
|
|
## =================================================================
|
|
|
|
## Logtalk - Object oriented extension to Prolog
|
2006-03-26 18:31:34 +01:00
|
|
|
## Release 2.27.1
|
2004-08-16 17:41:11 +01:00
|
|
|
##
|
2006-02-10 17:44:05 +00:00
|
|
|
## Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved.
|
2004-08-16 17:41:11 +01:00
|
|
|
## =================================================================
|
|
|
|
|
2004-07-09 01:41:35 +01:00
|
|
|
echo
|
2004-08-16 17:41:11 +01:00
|
|
|
echo "Creating a script named xsblgt for running Logtalk with XSB..."
|
2005-12-24 18:00:21 +00:00
|
|
|
echo
|
2004-07-09 01:41:35 +01:00
|
|
|
|
2005-04-23 00:57:45 +01:00
|
|
|
if ! [ "$LOGTALKHOME" ]
|
2004-07-09 01:41:35 +01:00
|
|
|
then
|
|
|
|
echo "The environment variable LOGTALKHOME must be defined first!"
|
2005-05-24 00:33:41 +01:00
|
|
|
echo
|
|
|
|
exit 1
|
2005-08-08 13:13:45 +01:00
|
|
|
fi
|
|
|
|
|
2005-12-24 18:00:21 +00:00
|
|
|
if ! [ -d "$LOGTALKHOME" ]; then
|
|
|
|
echo "The environment variable LOGTALKHOME points to a non-existing directory!"
|
|
|
|
echo "Its current value is: $LOGTALKHOME"
|
|
|
|
echo "The variable must be set to your Logtalk installation directory!"
|
|
|
|
echo
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2005-08-08 13:13:45 +01:00
|
|
|
if [ -z "$1" ]; then
|
|
|
|
prefix=/usr/local
|
2004-07-09 01:41:35 +01:00
|
|
|
else
|
2005-08-08 13:13:45 +01:00
|
|
|
prefix="$1"
|
|
|
|
fi
|
|
|
|
|
2005-12-24 18:00:21 +00:00
|
|
|
if ! [ -d "$prefix" ]; then
|
2005-08-08 13:13:45 +01:00
|
|
|
echo "Directory prefix does not exist!"
|
2004-12-25 03:06:18 +00:00
|
|
|
echo
|
2005-08-08 13:13:45 +01:00
|
|
|
exit 1
|
2004-07-09 01:41:35 +01:00
|
|
|
fi
|
2005-08-08 13:13:45 +01:00
|
|
|
|
|
|
|
cd "$LOGTALKHOME"
|
|
|
|
mkdir -p bin
|
|
|
|
cd bin
|
|
|
|
cp ../compiler/logtalk.pl logtalk.P
|
|
|
|
sed 's/^..lgt_current_object_.[(]user.*[)]/:- assertz(&)/' logtalk.P > temp1
|
|
|
|
sed 's/^..lgt_current_object_.[(]debugger.*[)]/:- assertz(&)/' temp1 > temp2
|
|
|
|
sed 's/^..lgt_dbg_leashing_.[(].*[)]/:- assertz(&)/g' temp2 > logtalk.P
|
|
|
|
rm temp1
|
|
|
|
rm temp2
|
|
|
|
echo ":- reconsult('$LOGTALKUSER/configs/xsb.P')." > logtalkxsb.P
|
|
|
|
echo ":- reconsult('$LOGTALKHOME/bin/logtalk.P')." >> logtalkxsb.P
|
|
|
|
echo ":- reconsult('$LOGTALKUSER/libpaths/libpaths.P')." >> logtalkxsb.P
|
|
|
|
echo "#/bin/sh" > xsblgt
|
|
|
|
echo "xsb -e \"reconsult('\$LOGTALKHOME/bin/logtalkxsb.P').\"" >> xsblgt
|
|
|
|
chmod a+x xsblgt
|
|
|
|
ln -sf $LOGTALKHOME/bin/xsblgt $prefix/bin/xsblgt
|
|
|
|
echo "Done. A link to the script was been created in $prefix/bin."
|
2005-12-24 18:00:21 +00:00
|
|
|
echo "Users must define the environment variables LOGTALKHOME and"
|
|
|
|
echo "LOGTALKUSER in order to use the script. Users must run the"
|
|
|
|
echo "the cplgtdirs script before using the xsblgt script."
|
2005-08-08 13:13:45 +01:00
|
|
|
echo
|
2005-12-24 18:00:21 +00:00
|
|
|
echo "The first call to the script must be made as root or using sudo."
|
2005-08-08 13:13:45 +01:00
|
|
|
echo
|