aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2011-03-09 16:24:27 +0100
committerThomas White <taw@physics.org>2012-02-22 15:27:19 +0100
commit6b67dc7ba7301274167519d5fcc38161b1a791a9 (patch)
tree51eafbd2a92cbf5b005eeba2629d5327d44c63ce
parente33dac04453ee0b759af5560dd4758f6cfc7eb67 (diff)
Better libTIFF test
-rw-r--r--config.h.in3
-rwxr-xr-xconfigure55
-rw-r--r--configure.ac8
3 files changed, 62 insertions, 4 deletions
diff --git a/config.h.in b/config.h.in
index 1393c5a6..165d8766 100644
--- a/config.h.in
+++ b/config.h.in
@@ -53,6 +53,9 @@
/* Define to 1 if libPNG is available */
#undef HAVE_LIBPNG
+/* Define to 1 if you have the `tiff' library (-ltiff). */
+#undef HAVE_LIBTIFF
+
/* Define to 1 if your system has a GNU libc compatible `malloc' function, and
to 0 otherwise. */
#undef HAVE_MALLOC
diff --git a/configure b/configure
index 1b502c5e..9f06a509 100755
--- a/configure
+++ b/configure
@@ -7002,15 +7002,59 @@ if test "${with_libtiff+set}" = set; then :
withval=$with_libtiff;
LIBTIFF_CFLAGS="-I$withval/include"
LIBTIFF_LIBS="-L$withval/lib -ltiff"
+ have_libtiff=true
else
- LIBTIFF_LIBS="-ltiff"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for TIFFOpen in -ltiff" >&5
+$as_echo_n "checking for TIFFOpen in -ltiff... " >&6; }
+if test "${ac_cv_lib_tiff_TIFFOpen+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ltiff $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char TIFFOpen ();
+int
+main ()
+{
+return TIFFOpen ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_tiff_TIFFOpen=yes
+else
+ ac_cv_lib_tiff_TIFFOpen=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_tiff_TIFFOpen" >&5
+$as_echo "$ac_cv_lib_tiff_TIFFOpen" >&6; }
+if test "x$ac_cv_lib_tiff_TIFFOpen" = x""yes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBTIFF 1
+_ACEOF
+
+ LIBS="-ltiff $LIBS"
+else
+ have_libtiff=true
fi
-$as_echo "#define HAVE_TIFF 1" >>confdefs.h
+fi
else
@@ -7019,6 +7063,13 @@ else
$as_echo "no" >&6; }
fi
+if test x$have_libtiff = xtrue; then :
+
+
+$as_echo "#define HAVE_TIFF 1" >>confdefs.h
+
+
+fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use Cairo" >&5
diff --git a/configure.ac b/configure.ac
index e35a7dda..c9f410da 100644
--- a/configure.ac
+++ b/configure.ac
@@ -157,13 +157,17 @@ AS_IF([test "x$enable_tiff" != "xno"],
[
LIBTIFF_CFLAGS="-I$withval/include"
LIBTIFF_LIBS="-L$withval/lib -ltiff"
+ have_libtiff=true
], [
- LIBTIFF_LIBS="-ltiff"
+ AC_CHECK_LIB([tiff], [TIFFOpen], [], [have_libtiff=true])
])
- AC_DEFINE([HAVE_TIFF], [1], [Define to 1 if libTIFF is available])
], [
AC_MSG_RESULT([no])
])
+AS_IF([test x$have_libtiff = xtrue],
+[
+ AC_DEFINE([HAVE_TIFF], [1], [Define to 1 if libTIFF is available])
+])
AC_MSG_CHECKING([whether to use Cairo])