# 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! # 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 $buildDir ]; then printf "%s" "Error: $1. Directory \"${2}\" is " printf "%s\n\n" "not present!" ok="false" let ERR++ return 1 fi return 0 } # include alias definitions and default values #alias secinit > /dev/null 2>&1 #if [ $? -ne 0 ]; then includeDefs ~/.secondo.aliases #fi shopt -s expand_aliases # define short variables for important base directories buildDir=$SECONDO_BUILD_DIR sdkDir=$SECONDO_SDK platform=$SECONDO_PLATFORM ok="true" declare -i ERR=0 if [ "$platform" != "linux" ]; then if [ "$platform" != "mac_osx" ]; then if [ "$platform" != "win32" ]; then printf "%s\n" "Error: SECONDO_PLATFORM must be set to linux, mac_osx or win32!" ok="false" fi fi fi checkDir "Testing if variable SECONDO_BUILD_DIR points to an existing directory " $buildDir checkDir "Testing if variable SECONDO_SDK points to an existing directory " $sdkDir # test if $buildDir seems to be a SECONDO source tree checkDir "$buildDir seems not to point to a secondo source tree" ${buildDir}/Algebras/Standard-C++ if [ $? -ne 0 ]; then printf "%s\n" "Setting \$SECONDO_BUILD_DIR=\$HOME/secondo." buildDir=${HOME}/secondo fi # include platform specific definitions includeDefs ${sdkDir}/secondo.config if [ "$ok" == "true" ]; then # set common variables includeDefs ${sdkDir}/bin/setvar.bash ${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 J2SDKROOT " $J2SDKROOT 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 # end of "$ok"="true" fi catvar printf "\n%s\n" "In case of trouble consult the environment setup files:" printf "%s\n" " ${sdkDir}/secondo.config" printf "%s\n" " ${sdkDir}/secondorc" printf "%s\n\n" " ${sdkDir}/secondo.setroot"