2005-12-24 18:00:21 +00:00
|
|
|
#!/bin/sh
|
2004-04-26 00:57:46 +01:00
|
|
|
|
2004-08-16 17:41:11 +01:00
|
|
|
## =================================================================
|
|
|
|
## Logtalk - Object oriented extension to Prolog
|
2007-03-28 23:44:31 +01:00
|
|
|
## Release 2.29.5
|
2004-08-16 17:41:11 +01:00
|
|
|
##
|
2007-01-10 12:46:10 +00:00
|
|
|
## Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
2004-08-16 17:41:11 +01:00
|
|
|
## =================================================================
|
|
|
|
|
2004-04-26 00:57:46 +01:00
|
|
|
echo
|
2004-08-16 17:41:11 +01:00
|
|
|
echo "Creating a script named swilgt for running Logtalk with SWI-Prolog..."
|
2005-12-24 18:00:21 +00:00
|
|
|
echo
|
2004-04-26 00:57:46 +01:00
|
|
|
|
2005-04-23 00:57:45 +01:00
|
|
|
if ! [ "$LOGTALKHOME" ]
|
2004-04-26 00:57:46 +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-04-26 00:57:46 +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-04-26 00:57:46 +01:00
|
|
|
echo
|
2005-08-08 13:13:45 +01:00
|
|
|
exit 1
|
2004-04-26 00:57:46 +01:00
|
|
|
fi
|
2005-08-08 13:13:45 +01:00
|
|
|
|
|
|
|
cd "$LOGTALKHOME"
|
|
|
|
mkdir -p bin
|
|
|
|
cd bin
|
2006-12-28 13:03:34 +00:00
|
|
|
echo ":- set_prolog_flag(iso, true)." > logtalk_comp_swi.pl
|
|
|
|
echo ":- set_prolog_flag(generate_debug_info, false)." >> logtalk_comp_swi.pl
|
2006-11-07 17:11:47 +00:00
|
|
|
echo ":- system_module." >> logtalk_comp_swi.pl
|
|
|
|
cat ../compiler/logtalk.pl >> logtalk_comp_swi.pl
|
|
|
|
echo ":- consult('\$LOGTALKUSER/configs/swi.config')." > logtalk_swi.pl
|
|
|
|
echo ":- consult('\$LOGTALKHOME/bin/logtalk_comp_swi.pl')." >> logtalk_swi.pl
|
|
|
|
echo ":- consult('\$LOGTALKUSER/libpaths/libpaths.pl')." >> logtalk_swi.pl
|
|
|
|
echo ":- consult('\$LOGTALKUSER/configs/swihook.pl')." >> logtalk_swi.pl
|
|
|
|
echo ":- consult('\$LOGTALKUSER/configs/xpcehook.pl')." >> logtalk_swi.pl
|
2005-08-08 13:13:45 +01:00
|
|
|
echo "#/bin/sh" > swilgt
|
|
|
|
case $( uname -s ) in
|
2007-03-28 23:44:31 +01:00
|
|
|
Darwin ) echo "swipl -f \"\$LOGTALKHOME/bin/logtalk_swi.pl\" \"\$@\"" >> swilgt;;
|
|
|
|
* ) echo "pl -f \"\$LOGTALKHOME/bin/logtalk_swi.pl\" \"\$@\"" >> swilgt;;
|
2005-08-08 13:13:45 +01:00
|
|
|
esac
|
|
|
|
chmod a+x swilgt
|
|
|
|
ln -sf $LOGTALKHOME/bin/swilgt $prefix/bin/swilgt
|
|
|
|
echo "Done. A link to the script was been created in $prefix/bin."
|
2006-11-07 17:11:47 +00:00
|
|
|
echo
|
|
|
|
echo "Users should ensure that the environment variables LOGTALKHOME"
|
|
|
|
echo "and LOGTALKUSER are defined and then run the \"cplgtdirs\" script"
|
|
|
|
echo "once prior to using the swilgt script."
|
2005-08-08 13:13:45 +01:00
|
|
|
echo
|