From 0d393df27154436460b6b3fed0b32bb992933a2a Mon Sep 17 00:00:00 2001 From: knarf Date: Tue, 8 May 2012 15:08:22 +0000 Subject: make sure to find a standard openssl installation - similar script to HDF5 git-svn-id: http://svn.cactuscode.org/projects/ExternalLibraries/OpenSSL/trunk@30 091d3ff0-52bc-4db5-b7a6-18201e4c0cca --- OpenSSL.sh | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/OpenSSL.sh b/OpenSSL.sh index 24fcc03..225fe97 100644 --- a/OpenSSL.sh +++ b/OpenSSL.sh @@ -21,21 +21,34 @@ if [ -z "${OPENSSL_DIR}" ]; then echo "OpenSSL selected, but OPENSSL_DIR not set. Checking some places..." echo "END MESSAGE" - for libext in a dylib; do - FILES="include/openssl/ssl.h lib/libssl.${libext} lib/libcrypto.${libext}" - DIRS="/usr /usr/local /opt/local" - for dir in $DIRS; do - OPENSSL_DIR="$dir" - for file in $FILES; do - if [ ! -r "$dir/$file" ]; then - unset OPENSSL_DIR + DIRS="/usr /usr/local /opt/local /usr/local/packages usr/local/apps /opt/local ${HOME} c:/packages/" + # look into each directory + for dir in $DIRS; do + # 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/openssl/ssl.h $libdir/libssl.${libext} $libdir/libcrypto.${libext}" + # assume this is the one and check all needed files + OPENSSL_DIR="$dir" + for file in $FILES; do + # discard this directory if one file was not found + if [ ! -r "$dir/$file" ]; then + unset OPENSSL_DIR + break + fi + done + # don't look further if all files have been found + if [ -n "$OPENSSL_DIR" ]; then break fi done + # don't look further if all files have been found if [ -n "$OPENSSL_DIR" ]; then break fi done + # don't look further if all files have been found if [ -n "$OPENSSL_DIR" ]; then break fi -- cgit v1.2.3