#!/bin/bash


myCurDIR=$(cd "$(dirname ${BASH_SOURCE[0]})/.." && pwd)
if [  -n "$msBinDir" ]; then
	echo "Info: msSrc(=$msSrc) is NOT reset from $myCurDIR"
	if [ "$msSrc" != "$myCurDIR" ]; then 
		echo "Hint, try reseting your (terminal) session and its settings"; 
	fi
elif ! [ -f $myCurDIR/Makefile ]; then
	echo "Error: $myCurDIR does not seem to be a source directory."
	echo "       Makefile does not exists."; 
else

	export msSrc="$myCurDIR"
	export msRoot=$( cd "$msSrc/../" && pwd )
	export msBinDir=$msRoot/bin
	export msLibDir=$msRoot/lib
	export msIncDir=$msRoot/include
	export msBilDir=$msRoot/build
	export msTstDir=$msRoot/test

	# maybe safer to prepend PATHs?
	export PATH=$PATH:$msSrc/script
	export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$msLibDir
	export PATH=$PATH:$msBinDir


	if ! [ -d $msBinDir ]; then  mkdir -p $msBinDir;   fi
	if ! [ -d $msLibDir ]; then  mkdir -p $msLibDir;   fi
	if ! [ -d $msIncDir ]; then  mkdir -p $msIncDir;   fi

	export PYTHONPATH=$msSrc/script:$msSrc/pylib:$PYTHONPATH

fi


