aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorknarf <knarf@fb53df36-e548-4a1e-8150-ab98cbd5e786>2012-05-01 15:42:05 +0000
committerknarf <knarf@fb53df36-e548-4a1e-8150-ab98cbd5e786>2012-05-01 15:42:05 +0000
commit77194ea1bc16d0bc58148759a6560dff8c1eabec (patch)
tree8c873458330979efbd105ce7b5b564479e6d2129
parent9fced58755a11c23ed859bdded97dbb4ca46c6c4 (diff)
let HDF5 look for libraries also in lib64, plus honor .so and .dylib libraries
git-svn-id: http://svn.cactuscode.org/projects/ExternalLibraries/HDF5/trunk@52 fb53df36-e548-4a1e-8150-ab98cbd5e786
-rw-r--r--HDF5.sh32
1 files changed, 25 insertions, 7 deletions
diff --git a/HDF5.sh b/HDF5.sh
index 6eaa6c3..9eed71e 100644
--- a/HDF5.sh
+++ b/HDF5.sh
@@ -54,16 +54,34 @@ then
echo "HDF5 selected, but HDF5_DIR not set. Checking some places..."
echo "END MESSAGE"
- FILES="include/hdf5.h $(for lib in ${HDF5_CXX_LIBS} ${HDF5_FORTRAN_LIBS} ${HDF5_C_LIBS}; do echo lib/lib${lib}.a; done)"
DIRS="/usr /usr/local /usr/local/hdf5 /usr/local/packages/hdf5 /usr/local/apps/hdf5 /opt/local ${HOME} ${HOME}/hdf5 c:/packages/hdf5"
+ # look into each directory
for dir in $DIRS; do
- HDF5_DIR="$dir"
- for file in $FILES; do
- if [ ! -r "$dir/$file" ]; then
- unset HDF5_DIR
- break
- fi
+ # libraries might have different file extensions
+ for libext in a so dylib; do
+ # libraries can be in /lib or /lib64
+ for libdir in lib64 lib; do
+ FILES="include/hdf5.h $(for lib in ${HDF5_CXX_LIBS} ${HDF5_FORTRAN_LIBS} ${HDF5_C_LIBS}; do echo $libdir/lib${lib}.${libext}; done)"
+ # assume this is the one and check all needed files
+ HDF5_DIR="$dir"
+ for file in $FILES; do
+ # discard this directory if one file was not found
+ if [ ! -r "$dir/$file" ]; then
+ unset HDF5_DIR
+ break
+ fi
+ done
+ # don't look further if all files have been found
+ if [ -n "$HDF5_DIR" ]; then
+ break
+ fi
+ done
+ # don't look further if all files have been found
+ if [ -n "$HDF5_DIR" ]; then
+ break
+ fi
done
+ # don't look further if all files have been found
if [ -n "$HDF5_DIR" ]; then
break
fi