diff options
author | Darren Tucker <dtucker@zip.com.au> | 2007-02-19 22:44:25 +1100 |
---|---|---|
committer | Darren Tucker <dtucker@zip.com.au> | 2007-02-19 22:44:25 +1100 |
commit | 53ced25d6185b4a02305e9d4bf648113155dde07 (patch) | |
tree | 0cf74a6241f04785790546eda1f13269e28af1bc /contrib | |
parent | 1629c07c0725fd5cc533c9664b8e8add27a81c69 (diff) |
- (dtucker) [contrib/findssl.sh] Add "which" as a shell function since some
platforms don't have it. Patch from dleonard at vintela.com.
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/findssl.sh | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/contrib/findssl.sh b/contrib/findssl.sh index 716abced..263fd264 100644 --- a/contrib/findssl.sh +++ b/contrib/findssl.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# $Id: findssl.sh,v 1.3 2004/12/13 07:08:33 dtucker Exp $ +# $Id: findssl.sh,v 1.4 2007/02/19 11:44:25 dtucker Exp $ # # findssl.sh # Search for all instances of OpenSSL headers and libraries @@ -89,6 +89,25 @@ LD_LIBRARY_PATH=${LD_LIBRARY_PATH:=$DEFAULT_LIBPATH} LIBRARY_PATH=${LIBRARY_PATH:=$DEFAULT_LIBPATH} export LIBPATH LD_LIBRARY_PATH LIBRARY_PATH +# not all platforms have a 'which' command +if which ls >/dev/null 2>/dev/null; then + : which is defined +else + which () { + saveIFS="$IFS" + IFS=: + for p in $PATH; do + if test -x "$p/$1" -a -f "$p/$1"; then + IFS="$saveIFS" + echo "$p/$1" + return 0 + fi + done + IFS="$saveIFS" + return 1 + } +fi + # # Search for OpenSSL headers and print versions # |