This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
yap-6.3/Logtalk/integration/cxlgt.sh
pmoura 9fc2c47d53 Logtalk 2.30.2 files.
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1908 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
2007-06-24 13:27:35 +00:00

62 lines
2.2 KiB
Bash
Executable File

#/bin/sh
## ================================================================
## Logtalk - Open source object-oriented logic programming language
## Release 2.30.2
##
## Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
## ================================================================
if ! [ "$LOGTALKHOME" ]; then
echo "The environment variable LOGTALKHOME should be defined first, pointing"
echo "to your Logtalk installation directory!"
echo "Trying the default locations for the Logtalk installation..."
if [ -d "/usr/local/share/logtalk" ]; then
LOGTALKHOME=/usr/local/share/logtalk
echo "... using Logtalk installation found at /usr/local/share/logtalk"
elif [ -d "/usr/share/logtalk" ]; then
LOGTALKHOME=/usr/share/logtalk
echo "... using Logtalk installation found at /usr/share/logtalk"
elif [ -d "/opt/local/share/logtalk" ]; then
LOGTALKHOME=/opt/local/share/logtalk
echo "... using Logtalk installation found at /opt/local/share/logtalk"
elif [ -d "/opt/share/logtalk" ]; then
LOGTALKHOME=/opt/share/logtalk
echo "... using Logtalk installation found at /opt/share/logtalk"
else
echo "... unable to locate Logtalk installation directory!"
echo
exit 1
fi
echo
elif ! [ -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
export LOGTALKHOME
if ! [ "$LOGTALKUSER" ]; then
echo "The environment variable LOGTALKUSER should be defined first, pointing"
echo "to your Logtalk user directory!"
echo "Trying the default location for the Logtalk user directory..."
export LOGTALKUSER=$HOME/logtalk
if [ -d "$LOGTALKUSER" ]; then
echo "... using Logtalk user directory found at $LOGTALKUSER"
else
echo "... Logtalk user directory not found at default location. Creating a"
echo "new Logtalk user directory by running the \"cplgtdirs\" shell script:"
cplgtdirs
fi
elif ! [ -d "$LOGTALKUSER" ]; then
echo "Cannot find \$LOGTALKUSER directory! Creating a new Logtalk user directory"
echo "by running the \"cplgtdirs\" shell script:"
cplgtdirs
fi
echo
exec cxprolog --goal "silent_consult('$LOGTALKHOME/integration/logtalk_cx.pl')" "$@"