aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorknarf <knarf@ba58616d-3abc-4c77-8745-3ba8ad4a582f>2012-04-10 18:18:39 +0000
committerknarf <knarf@ba58616d-3abc-4c77-8745-3ba8ad4a582f>2012-04-10 18:18:39 +0000
commitb651fede3b4160027d4fbc3484d3055ecc557d4e (patch)
treec288333bafed720d595ffd220da39fcf5e408b02
parentbe28285fd00783f959b5552b3d28ae7946867271 (diff)
detect whether libjpeg is available
git-svn-id: http://svn.cactuscode.org/projects/ExternalLibraries/libjpeg/trunk@16 ba58616d-3abc-4c77-8745-3ba8ad4a582f
-rwxr-xr-xlibjpeg.sh30
1 files changed, 30 insertions, 0 deletions
diff --git a/libjpeg.sh b/libjpeg.sh
index 5518e15..a0df2b3 100755
--- a/libjpeg.sh
+++ b/libjpeg.sh
@@ -10,6 +10,36 @@ if [ "$(echo ${VERBOSE} | tr '[:upper:]' '[:lower:]')" = 'yes' ]; then
fi
set -e # Abort on errors
+if [ -z "${LIBJPEG_DIR}" ]; then
+ echo "BEGIN MESSAGE"
+ echo "LIBJPEG selected, but LIBJPEG_DIR not set. Checking some places..."
+ echo "END MESSAGE"
+
+ FILES="include/jpeglib.h"
+ DIRS="/usr /usr/local ${HOME}"
+ for dir in $DIRS; do
+ LIBJPEG_DIR="$dir"
+ for file in $FILES; do
+ if [ ! -r "$dir/$file" ]; then
+ unset LIBJPEG_DIR
+ break
+ fi
+ done
+ if [ -n "$LIBJPEG_DIR" ]; then
+ break
+ fi
+ done
+
+ if [ -z "$LIBJPEG_DIR" ]; then
+ echo "BEGIN MESSAGE"
+ echo "LIBJPEG not found"
+ echo "END MESSAGE"
+ else
+ echo "BEGIN MESSAGE"
+ echo "Found LIBJPEG in ${LIBJPEG_DIR}"
+ echo "END MESSAGE"
+ fi
+fi
################################################################################