Commit d8c334fd authored by thomas.forbriger's avatar thomas.forbriger Committed by thomas.forbriger
Browse files

added variable check

This is a legacy commit from before 2015-03-01.
It may be incomplete as well as inconsistent.
See COPYING.legacy and README.history for details.


SVN Path:     http://gpitrsvn.gpi.uni-karlsruhe.de/repos/TFSoftware/trunk
SVN Revision: 5292
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parent 35a5992f
......@@ -67,7 +67,7 @@ Environment variables in Makefiles
LD_LIBRARY_PATH
If you install external libraries (e.g. PGPLOT) in an uncommon place, you
might have to set LD_LIBRARY_PATH to pass the location of the dynamic
library (e.g. libpgplot.so) to the dynamic linker.
library (e.g. libpgplot.so) to the dynamic linker. See man-page ld.so(8)
export TF_WWWBASEDIR=$HOME/doxydoc
C++ libraries usually are distributed together with a set of documentation
......
......@@ -14,6 +14,19 @@
# the following part of install.sh is independent of the actual package
# ---------------------------------------------------------------------
#
# shell function to report variables
repvar()
{
found=$(printenv $1 | wc -l)
if test $found -gt 0
then
echo $1=$(printenv $1)
else
echo not set: $1
return 2
fi
}
#
cd $(dirname $0)
SRCROOT=$(pwd)
if test ! -x $SRCROOT/install.sh
......@@ -22,8 +35,47 @@ then
echo " call install.sh from within the directory in which it is located"
exit 2
fi
echo "Reading environment variable settings from ./install.bashrc"
echo "(you may adjust ./install.bashrc to your needs)"
# target directories are defined in install.bashrc
test -s ./install.bashrc && . ./install.bashrc || true
test -s ./install.bashrc && . ./install.bashrc || \
{
echo "./install.bashrc returned with a non-zero exit status."
echo "It apparently failed to set environment variables."
echo "aborting $0..."; exit 2
}
# test and report environment variables
echo "Environment variables used in TFSoftware Makefiles as found in your"
echo "shell environment or set by ./install.bashrc (not all of them might"
echo "be required for the current package):"
MISSING=0
repvar LOCBINDIR || MISSING=1
repvar LOCLIBDIR || MISSING=1
repvar LOCINCLUDEDIR || MISSING=1
repvar SERVERBINDIR || MISSING=1
repvar SERVERLIBDIR || MISSING=1
repvar CC || MISSING=1
repvar CXX || MISSING=1
repvar FC || MISSING=1
repvar TF_LINK_FORTRAN || MISSING=1
repvar TF_LINK_PGPLOT || MISSING=1
repvar TF_WWWBASEDIR || MISSING=1
repvar TF_BROWSER || MISSING=1
repvar LD_LIBRARY_PATH || MISSING=1
if test 0$MISSING -gt 0
then
echo "Some of the expected variables are not set. Please check"
echo "README.compile if in doubt."
fi
if test 0$(printenv LD_LIBRARY_PATH | tr ':' '\n' | grep $LOCLIBDIR | wc -l) -lt 1
then
echo "$LOCLIBDIR is not present in variable LD_LIBRARY_PATH!"
echo "The binary executables being compiled, linked against dynamic"
echo "libraries in $LOCLIBDIR and installed in $LOCBINDIR"
echo "probably will fail to execute. Please check README.compile"
echo "if in doubt."
fi
echo
# ============================================================================
# package specific contents are added below this line
# ---------------------------------------------------
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment