changeset 3102:14afb4dd1939

[MSVC] enable TIFF compilation
author Michael Goffioul <michael.goffioul@gmail.com>
date Wed, 26 Jun 2013 22:56:56 -0400
parents c4d42deb35f9
children 3402699ca431
files src/msvc-tiff-1.patch src/tiff.mk
diffstat 2 files changed, 60 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/msvc-tiff-1.patch	Wed Jun 26 22:56:56 2013 -0400
@@ -0,0 +1,55 @@
+diff -ur tiff-4.0.3-orig/libtiff/Makefile.in tiff-4.0.3/libtiff/Makefile.in
+--- tiff-4.0.3-orig/libtiff/Makefile.in	2012-09-22 12:08:19 -0400
++++ tiff-4.0.3/libtiff/Makefile.in	2013-06-26 22:40:20 -0400
+@@ -423,10 +423,12 @@
+ 
+ lib_LTLIBRARIES = libtiff.la $(am__append_6)
+ libtiff_la_LDFLAGS = -no-undefined -version-info \
+-	$(LIBTIFF_VERSION_INFO) $(am__append_7) $(am__append_8)
++	$(LIBTIFF_VERSION_INFO) $(am__append_7) $(am__append_8) \
++	-export-symbols-regex "xXx" -Wl,libtiff.def
+ libtiff_la_LIBADD = $(LIBPORT)
+ libtiffxx_la_LDFLAGS = -no-undefined -version-info \
+-	$(LIBTIFF_VERSION_INFO) $(am__append_9) $(am__append_10)
++	$(LIBTIFF_VERSION_INFO) $(am__append_9) $(am__append_10) \
++	-export-symbols-regex "xXx"
+ libtiffxx_la_LIBADD = $(LIBTIFF) $(LIBPORT)
+ libtiffxx_la_DEPENDENCIES = libtiff.la
+ mkg3states_SOURCES = mkg3states.c tif_fax3.h
+diff -ur tiff-4.0.3-orig/libtiff/tif_stream.cxx tiff-4.0.3/libtiff/tif_stream.cxx
+--- tiff-4.0.3-orig/libtiff/tif_stream.cxx	2010-12-13 20:45:44 -0500
++++ tiff-4.0.3/libtiff/tif_stream.cxx	2013-06-26 22:31:55 -0400
+@@ -392,6 +392,9 @@
+ 
+ } /* extern "C" */
+ 
++#ifdef _MSC_VER
++__declspec(dllexport)
++#endif
+ TIFF*
+ TIFFStreamOpen(const char* name, ostream *os)
+ {
+@@ -408,6 +411,9 @@
+ 	return _tiffStreamOpen(name, "wm", os);
+ }
+ 
++#ifdef _MSC_VER
++__declspec(dllexport)
++#endif
+ TIFF*
+ TIFFStreamOpen(const char* name, istream *is)
+ {
+diff -ur tiff-4.0.3-orig/libtiff/tiffiop.h tiff-4.0.3/libtiff/tiffiop.h
+--- tiff-4.0.3-orig/libtiff/tiffiop.h	2012-06-06 09:35:23 -0400
++++ tiff-4.0.3/libtiff/tiffiop.h	2013-06-26 22:35:20 -0400
+@@ -72,6 +72,10 @@
+ #define	FALSE	0
+ #endif
+ 
++#if defined(_MSC_VER) && !defined(snprintf)
++#define snprintf _snprintf
++#endif
++
+ typedef struct client_info {
+     struct client_info *next;
+     void *data;
--- a/src/tiff.mk	Wed Jun 26 21:12:20 2013 -0400
+++ b/src/tiff.mk	Wed Jun 26 22:56:56 2013 -0400
@@ -8,7 +8,10 @@
 $(PKG)_FILE     := tiff-$($(PKG)_VERSION).tar.gz
 $(PKG)_URL      := http://download.osgeo.org/libtiff/$($(PKG)_FILE)
 $(PKG)_URL_2    := ftp://ftp.remotesensing.org/libtiff/$($(PKG)_FILE)
-$(PKG)_DEPS     := zlib jpeg xz
+$(PKG)_DEPS     := zlib jpeg
+ifneq ($(MXE_SYSTEM),msvc)
+    $(PKG)_DEPS += xz
+endif
 
 define $(PKG)_UPDATE
     $(WGET) -q -O- 'http://www.remotesensing.org/libtiff/' | \
@@ -22,7 +25,7 @@
         $(HOST_AND_BUILD_CONFIGURE_OPTIONS) \
         $(ENABLE_SHARED_OR_STATIC) \
         --prefix='$(HOST_PREFIX)' \
-        --without-x
+        --without-x && $(CONFIGURE_POST_HOOK)
     $(MAKE) -C '$(1)' -j '$(JOBS)' install bin_PROGRAMS= sbin_PROGRAMS= noinst_PROGRAMS=
 
     rm -f $(HOST_LIBDIR)/libtiff.la