Dunno if this helps; I grabbed a section from the configure script (even though I can't really read shell scripting)
Code:
have_libjpeg=yes
fi
if test x$have_libjpeg = xyes; then
if test x$enable_jpg = xyes; then
cat >>confdefs.h <<\_ACEOF
#define LOAD_JPG 1
_ACEOF
fi
LIBS="-ljpeg $LIBS"
case "$host" in
*-*-darwin*) # FIXME when Mac OS X ships with libjpeg
jpg_lib=''
;;
*-*-cygwin* | *-*-mingw32*)
jpg_lib='jpeg.dll'
;;
*)
for path in /usr/lib /usr/local/lib; do
if test x$jpg_lib = x; then
jpg_lib=`ls -- $path/libjpeg.so.[0-9][0-9] 2>/dev/null | sort -r | sed 's/.*\/\(.*\)/\1/; q'`
fi
done
;;
esac
Always prints the message below....
elif test x$enable_jpg = xyes; then
{ echo "$as_me:$LINENO: WARNING: *** Unable to find JPEG library (http://www.ijg.org/)" >&5
echo "$as_me: WARNING: *** Unable to find JPEG library (http://www.ijg.org/)" >&2;}
{ echo "$as_me:$LINENO: WARNING: JPG image loading disabled" >&5
echo "$as_me: WARNING: JPG image loading disabled" >&2;}
I have the file "libjpeg.so" in /usr/lib and /usr/local/lib (a few others, but these are the main ones).