Revision
14318
Author
mikej
Date
2009-07-22 13:44:16 -0500 (Wed, 22 Jul 2009)

Log Message

add --enable-builtin-tiff configure arg to tell spandsp to use pre-built libtiff in paralell directory

Modified Paths

Diff

Modified: freeswitch/trunk/libs/spandsp/configure.ac (14317 => 14318)


--- freeswitch/trunk/libs/spandsp/configure.ac	2009-07-22 16:17:57 UTC (rev 14317)
+++ freeswitch/trunk/libs/spandsp/configure.ac	2009-07-22 18:44:16 UTC (rev 14318)
@@ -130,7 +130,10 @@
 AC_ARG_ENABLE(sse4a,        [  --enable-sse4a       Enable SSE4A support])
 AC_ARG_ENABLE(sse5,         [  --enable-sse5        Enable SSE5 support])
 AC_ARG_ENABLE(fixed_point,  [  --enable-fixed-point Enable fixed point support])
+AC_ARG_ENABLE(builtin_tiff,
+[AC_HELP_STRING([--enable-builtin-tiff],[build with builtin libtiff])],[enable_builtin_tiff="$enableval"],[enable_builtin_tiff="no"])
 
+
 AC_FUNC_ERROR_AT_LINE
 AC_FUNC_VPRINTF
 AC_FUNC_MALLOC
@@ -187,7 +190,6 @@
 AC_CHECK_HEADERS([sys/fcntl.h])
 AC_CHECK_HEADERS([sndfile.h])
 AC_CHECK_HEADERS([fftw3.h], , [AC_CHECK_HEADERS([fftw.h])])
-AC_CHECK_HEADERS([tiffio.h])
 AC_CHECK_HEADERS([pthread.h])
 if test "${build}" == "${host}"
 then
@@ -265,8 +267,6 @@
 AC_SEARCH_LIBS([log10f], [m], AC_DEFINE([HAVE_LOG10F], [1], [Define to 1 if you have the log10f() function.]))
 
 # Checks for libraries.
-AC_CHECK_LIB([tiff], [TIFFOpen], , AC_MSG_ERROR("Can't build without libtiff (does your system require a libtiff-devel package?)"), -lm)
-
 AC_CHECK_LIB([xml2], [xmlParseFile], [AC_DEFINE([HAVE_LIBXML2], [1], [Define to 1 if you have the 'libxml2' library (-lxml2).]) SIMLIBS="$SIMLIBS -lxml2"])
 
 if test -n "$enable_tests" ; then
@@ -415,6 +415,20 @@
     AC_DEFINE([SPANDSP_USE_MMX], [1], [Use the MMX instruction set (i386 and x86_64 only).])
 fi
 
+if test "$enable_builtin_tiff" = "yes" ; then
+  abs_tiffdir="`cd $srcdir/../tiff-3.8.2/ && pwd`"
+  save_CFLAGS=$CFLAGS
+  CFLAGS="$CFLAGS -I$abs_tiffdir/libtiff"
+  AC_CHECK_HEADERS([tiffio.h])
+  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"
+else
+  AC_CHECK_HEADERS([tiffio.h])
+  AC_CHECK_LIB([tiff], [TIFFOpen], , AC_MSG_ERROR("Can't build without libtiff (does your system require a libtiff-devel package?)"), -lm)
+fi
+
 TESTLIBS="$SIMLIBS $TESTLIBS"
 
 AC_SUBST(CC_FOR_BUILD)