136 lines
3.0 KiB
Plaintext
136 lines
3.0 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!
|
|
|
|
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}
|
|
|
|
# Berkeley-DB Library
|
|
#
|
|
# In windows installations of SECONDO-SDK the library has another
|
|
# name as in the Berkeley-DB distribution, since the --enable-mingw
|
|
# configure option was not present in version 4.1.25.
|
|
checkDir "Testing BERKELEY_DB_DIR " $BERKELEY_DB_DIR
|
|
|
|
BERKELEY_DB_LIB="db_cxx"
|
|
|
|
if [ "$SECONDO_PLATFORM" == "win32" ]; then
|
|
if [ -f ${BERKELEY_DB_DIR}/lib/libdb32.dll ]; then
|
|
BERKELEY_DB_LIB="db32"
|
|
fi
|
|
fi
|
|
export BERKELEY_DB_LIB
|
|
|
|
# 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"
|