144 lines
3.2 KiB
Plaintext
144 lines
3.2 KiB
Plaintext
# SECONDO ENVIRONMENT CONFIGURATION
|
|
#
|
|
# Feb 2005. Markus Spiekermann
|
|
#
|
|
# The file ".secondorc" must be executed at startup of a bash.
|
|
# Copy this file into your $HOME directory and add the line
|
|
#
|
|
# source $SECONDO_SDK/secondorc [Root of Secondo source files]
|
|
#
|
|
# at the end of file $HOME/.bashrc.
|
|
#
|
|
# Consult the files
|
|
#
|
|
# secondo.config
|
|
# secondo.setroot
|
|
#
|
|
# for setting platform specific or general parameters.
|
|
#
|
|
# DO NOT CHANGE THIS FILE!
|
|
|
|
|
|
SECONDO_BUILD_DIR=$HOME/secondo
|
|
|
|
declare -i ERR=0
|
|
|
|
# Some function definitions
|
|
|
|
# $1: file
|
|
# $2: options
|
|
function includeDefs {
|
|
|
|
if ! [ -f $1 ]; then
|
|
printf "%s\n" "Error: file \"$1\" not present!"
|
|
let ERR++
|
|
return 1
|
|
else
|
|
source $1 $2
|
|
rc=$?
|
|
ERR=$[$ERR + $rc]
|
|
fi
|
|
|
|
}
|
|
|
|
# $1: message
|
|
# $2: directory
|
|
function checkDir {
|
|
|
|
if ! [ -d $2 ]; then
|
|
printf "%s" "Error: $1 Directory \"${2}\" is "
|
|
printf "%s\n\n" "not present!"
|
|
let ERR++
|
|
return 1
|
|
fi
|
|
return 0
|
|
}
|
|
|
|
|
|
# $1: variable name
|
|
# $2: variable value
|
|
function checkVar {
|
|
|
|
if [ "$2" == "" ]; then
|
|
printf "%s\n\n" "Error: Variable $1 is not set!"
|
|
let ERR++
|
|
return 1
|
|
fi
|
|
return 0
|
|
}
|
|
|
|
# define short variables for important base directories
|
|
buildDir=$SECONDO_BUILD_DIR
|
|
sdkDir=$SECONDO_SDK
|
|
platform=$SECONDO_PLATFORM
|
|
|
|
# include alias definitions and default values
|
|
checkDir "Testing if variable SECONDO_SDK points to an existing directory." $sdkDir
|
|
|
|
checkDir "Testing if variable SECONDO_BUILD_DIR points to an existing directory." $buildDir
|
|
|
|
# test if $buildDir seems to be a SECONDO source tree
|
|
checkDir "SECONDO_BUILD_DIR seems not to point to a secondo source tree" ${buildDir}/Algebras/Standard-C++
|
|
|
|
if [ "$platform" != "linux" ]; then
|
|
if [ "$platform" != "linux64" ]; then
|
|
if [ "$platform" != "mac_osx" ]; then
|
|
if [ "$platform" != "win32" ]; then
|
|
printf "%s\n" "Error: SECONDO_PLATFORM must be set to linux, linux64, mac_osx or win32!"
|
|
let ERR++
|
|
fi
|
|
fi
|
|
fi
|
|
fi
|
|
|
|
echo "ERR="$ERR
|
|
if [ $ERR -eq 0 ]; then
|
|
|
|
includeDefs $SECONDO_SDK/secondo.aliases
|
|
shopt -s expand_aliases
|
|
|
|
# include platform specific definitions
|
|
includeDefs ${sdkDir}/secondo.config.$platform
|
|
|
|
# set common variables
|
|
includeDefs ${sdkDir}/secondo.setroot ${buildDir}
|
|
|
|
|
|
# Check if important directories are present
|
|
checkDir "Testing J2SDK_ROOT " $J2SDK_ROOT
|
|
checkDir "Testing PL_LIB_DIR " $PL_LIB_DIR
|
|
|
|
if [ $ERR -ne 0 ]; then
|
|
printf "%s" "Please check your installation and consult the configuration files"
|
|
fi
|
|
|
|
secenv
|
|
|
|
# end of $ERR == 0
|
|
fi
|
|
|
|
|
|
printf "\n%s\n" "In case of trouble consult the environment setup files:"
|
|
printf "%s\n" " ${sdkDir}/secondo.config.*"
|
|
printf "%s\n\n" " ${sdkDir}/secondo.setroot"
|
|
|
|
export LIBREADLINE="$HOME/secondo-sdk/lib/libreadline.a"
|
|
export PL_LIB=swipl
|
|
|
|
export SWI_HOME_DIR=/Applications/SWI-Prolog.app/Contents/swipl/
|
|
export PL_LIB_DIR=/Applications/SWI-Prolog.app/Contents/Frameworks/
|
|
export PL_DLL_DIR=$PL_LIB_DIR
|
|
export PL_LIB=swipl
|
|
export PL_INCLUDE_DIR=$SWI_HOME_DIR/include
|
|
export PL_VERSION=70000
|
|
export JPL_DLL=$SWI_HOME_DIR/lib/x86_64-darwin/libjpl.dylib
|
|
export JPL_JAR=$SWI_HOME_DIR/lib/jpl.jar
|
|
|
|
|
|
export BDB_DIR=$HOME/BDB
|
|
export BERKELEY_DB_DIR=$BDB_DIR
|
|
export BERKELEY_DB_LIB=db_cxx
|
|
export BDB_INCLUDE_DIR=$BDB_DIR/include
|
|
export BDB_LIB_DIR=$BDB_DIR/lib
|
|
|