Alexandre Julliard : configure: Add pkg-config support for libtiff.

Alexandre Julliard julliard at winehq.org
Wed Jul 31 15:31:33 CDT 2013


Module: wine
Branch: master
Commit: 079f8aee1820d6409b48bb63c8560d6b70d070c3
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=079f8aee1820d6409b48bb63c8560d6b70d070c3

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Wed Jul 31 15:02:13 2013 +0200

configure: Add pkg-config support for libtiff.

---

 configure                      |   51 +++++++++++++++++++++++++++++++++++----
 configure.ac                   |   13 ++++++----
 dlls/windowscodecs/Makefile.in |    2 +-
 3 files changed, 54 insertions(+), 12 deletions(-)

diff --git a/configure b/configure
index 531fbb3..6b868fc 100755
--- a/configure
+++ b/configure
@@ -641,6 +641,8 @@ EXTRACFLAGS
 LIBKSTAT
 LIBOPENAL
 LIBMPG123
+TIFF_LIBS
+TIFF_CFLAGS
 PNG_LIBS
 PNG_CFLAGS
 JPEG_LIBS
@@ -891,7 +893,9 @@ GSTREAMER_LIBS
 JPEG_CFLAGS
 JPEG_LIBS
 PNG_CFLAGS
-PNG_LIBS'
+PNG_LIBS
+TIFF_CFLAGS
+TIFF_LIBS'
 
 
 # Initialize some variables set by options.
@@ -1615,6 +1619,8 @@ Some influential environment variables:
   JPEG_LIBS   Linker flags for libjpeg, overriding pkg-config
   PNG_CFLAGS  C compiler flags for libpng, overriding pkg-config
   PNG_LIBS    Linker flags for libpng, overriding pkg-config
+  TIFF_CFLAGS C compiler flags for libtiff, overriding pkg-config
+  TIFF_LIBS   Linker flags for libtiff, overriding pkg-config
 
 Use these variables to override the choices made by `configure' or to help
 it to find libraries and programs with nonstandard names/locations.
@@ -2776,7 +2782,7 @@ fi
 
 # Check whether --with-tiff was given.
 if test "${with_tiff+set}" = set; then :
-  withval=$with_tiff; if test "x$withval" = "xno"; then ac_cv_header_tiffio_h=no; fi
+  withval=$with_tiff;
 fi
 
 
@@ -6043,7 +6049,6 @@ for ac_header in \
 	sys/wait.h \
 	syscall.h \
 	termios.h \
-	tiffio.h \
 	unistd.h \
 	utime.h \
 	valgrind/memcheck.h \
@@ -12025,15 +12030,44 @@ This is an error since --with-png was requested." "$LINENO" 5 ;;
 esac
 fi
 
-if test "$ac_cv_header_tiffio_h" = "yes"
+if test "x$with_tiff" != "xno"
 then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -ltiff" >&5
+    if test -n "$TIFF_CFLAGS"; then :
+
+elif test -n "$PKG_CONFIG"; then :
+  TIFF_CFLAGS=`$PKG_CONFIG --cflags libtiff 2>/dev/null`
+fi
+
+if test -n "$TIFF_LIBS"; then :
+
+elif test -n "$PKG_CONFIG"; then :
+  TIFF_LIBS=`$PKG_CONFIG --libs libtiff 2>/dev/null`
+fi
+
+
+ac_save_CPPFLAGS=$CPPFLAGS
+CPPFLAGS="$CPPFLAGS $TIFF_CFLAGS"
+for ac_header in tiffio.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "tiffio.h" "ac_cv_header_tiffio_h" "$ac_includes_default"
+if test "x$ac_cv_header_tiffio_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_TIFFIO_H 1
+_ACEOF
+
+fi
+
+done
+
+        if test "$ac_cv_header_tiffio_h" = "yes"
+        then
+            { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -ltiff" >&5
 $as_echo_n "checking for -ltiff... " >&6; }
 if ${ac_cv_lib_soname_tiff+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_soname_save_LIBS=$LIBS
-LIBS="-ltiff  $LIBS"
+LIBS="-ltiff $TIFF_LIBS $LIBS"
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -12080,6 +12114,11 @@ _ACEOF
 
 
 fi
+        fi
+CPPFLAGS=$ac_save_CPPFLAGS
+test -z "$TIFF_CFLAGS" || TIFF_CFLAGS=`echo " $TIFF_CFLAGS" | sed 's/ -I\([^/]\)/ -I\$(top_builddir)\/\1/g'`
+test -z "$TIFF_LIBS" || TIFF_LIBS=`echo " $TIFF_LIBS" | sed 's/ -L\([^/]\)/ -L\$(top_builddir)\/\1/g'`
+
 fi
 if test "x$ac_cv_lib_soname_tiff" = "x"; then :
   case "x$with_tiff" in
diff --git a/configure.ac b/configure.ac
index b69c9ab..34ef0a3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -70,8 +70,7 @@ AC_ARG_WITH(png,       AS_HELP_STRING([--without-png],[do not use PNG]))
 AC_ARG_WITH(pthread,   AS_HELP_STRING([--without-pthread],[do not use the pthread library]),
             [if test "x$withval" = "xno"; then ac_cv_header_pthread_h=no; fi])
 AC_ARG_WITH(sane,      AS_HELP_STRING([--without-sane],[do not use SANE (scanner support)]))
-AC_ARG_WITH(tiff,       AS_HELP_STRING([--without-tiff],[do not use TIFF]),
-            [if test "x$withval" = "xno"; then ac_cv_header_tiffio_h=no; fi])
+AC_ARG_WITH(tiff,      AS_HELP_STRING([--without-tiff],[do not use TIFF]))
 AC_ARG_WITH(v4l,       AS_HELP_STRING([--without-v4l],[do not use v4l1 (v4l support)]))
 AC_ARG_WITH(xcomposite,AS_HELP_STRING([--without-xcomposite],[do not use the Xcomposite extension]),
             [if test "x$withval" = "xno"; then ac_cv_header_X11_extensions_Xcomposite_h=no; fi])
@@ -515,7 +514,6 @@ AC_CHECK_HEADERS(\
 	sys/wait.h \
 	syscall.h \
 	termios.h \
-	tiffio.h \
 	unistd.h \
 	utime.h \
 	valgrind/memcheck.h \
@@ -1677,9 +1675,14 @@ WINE_WARNING_WITH(png,[test "x$ac_cv_lib_soname_png" = "x"],
                  [libpng ${notice_platform}development files not found, PNG won't be supported.])
 
 dnl **** Check for libtiff ****
-if test "$ac_cv_header_tiffio_h" = "yes"
+if test "x$with_tiff" != "xno"
 then
-    WINE_CHECK_SONAME(tiff,TIFFClientOpen)
+    WINE_PACKAGE_FLAGS(TIFF,[libtiff],,,,
+        [AC_CHECK_HEADERS([tiffio.h])
+        if test "$ac_cv_header_tiffio_h" = "yes"
+        then
+            WINE_CHECK_SONAME(tiff,TIFFClientOpen,,,[$TIFF_LIBS])
+        fi])
 fi
 WINE_NOTICE_WITH(tiff,[test "x$ac_cv_lib_soname_tiff" = "x"],
                  [libtiff ${notice_platform}development files not found, TIFF won't be supported.])
diff --git a/dlls/windowscodecs/Makefile.in b/dlls/windowscodecs/Makefile.in
index eab1c62..78caf00 100644
--- a/dlls/windowscodecs/Makefile.in
+++ b/dlls/windowscodecs/Makefile.in
@@ -1,7 +1,7 @@
 MODULE    = windowscodecs.dll
 IMPORTLIB = windowscodecs
 IMPORTS   = uuid ole32 oleaut32 rpcrt4 shlwapi user32 gdi32 advapi32
-EXTRAINCL = @JPEG_CFLAGS@ @PNG_CFLAGS@
+EXTRAINCL = @JPEG_CFLAGS@ @PNG_CFLAGS@ @TIFF_CFLAGS@
 EXTRADEFS = -DENTRY_PREFIX=WIC_ -DPROXY_DELEGATION -DWINE_REGISTER_DLL
 EXTRALIBS = @APPLICATIONSERVICESLIB@
 




More information about the wine-cvs mailing list