spandsp: Fix libjpeg checks for --enable-builtin-tiff builds.

The --enable-builtin-tiff option appends libs/tiff-3.8.2/libtiff/libtiff.la
to LIBS, causing the AC_CHECK_LIB([jpeg]...) check to fail, because
libtiff.la does not exist at configure time.

Temporarily store tiff and jpeg libs in TIFF_-/JPEG_LIBS variables and
append them to LIBS after all library checks have run.

Example error output:
    configure:20049: checking for jpeg_start_compress in -ljpeg
    configure:20074: cc -o conftest -O2 -pipe -fno-strict-aliasing    -L/usr/local/lib conftest.c -ljpeg  -lm  /usr/home/ports/net/freeswitch-core-devel/work/freeswitch-1.2.1/libs/tiff-3.8.2/libtiff/libtiff.la >&5
    cc: /usr/home/ports/net/freeswitch-core-devel/work/freeswitch-1.2.1/libs/tiff-3.8.2/libtiff/libtiff.la: No such file or directory

Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
This commit is contained in:
Stefan Knoblich 2012-08-15 12:52:28 +02:00 committed by Ken Rice
parent 24a45b034b
commit 400e6b6447
1 changed files with 5 additions and 3 deletions

View File

@ -523,14 +523,16 @@ if test "$enable_builtin_tiff" = "yes" ; then
CFLAGS="$save_CFLAGS"
COMP_VENDOR_CFLAGS="-I$abs_tiffdir/libtiff $COMP_VENDOR_CFLAGS"
COMP_VENDOR_LDFLAGS="-L$abs_tiffdir/libtiff $COMP_VENDOR_LDFLAGS"
LIBS="$LIBS $abs_tiffdir/libtiff/libtiff.la"
TIFF_LIBS="$abs_tiffdir/libtiff/libtiff.la"
AC_DEFINE([HAVE_LIBTIFF], [1], [Define to 1 if you have the `tiff' library (-ltiff).])
else
AC_CHECK_HEADERS([tiffio.h])
AC_CHECK_LIB([tiff], [TIFFOpen], , AC_MSG_ERROR("Cannot build without libtiff (does your system require a libtiff-devel package?)"), -lm)
AC_CHECK_LIB([tiff], [TIFFOpen], [TIFF_LIBS="-ltiff"], AC_MSG_ERROR("Cannot build without libtiff (does your system require a libtiff-devel package?)"), -lm)
fi
AC_CHECK_HEADERS([jpeglib.h])
AC_CHECK_LIB([jpeg], [jpeg_start_compress])
AC_CHECK_LIB([jpeg], [jpeg_start_compress], [JPEG_LIBS="-ljpeg"])
LIBS="$LIBS $TIFF_LIBS $JPEG_LIBS"
TESTLIBS="$SIMLIBS $TESTLIBS"