summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBoris Nagaev <bnagaev@gmail.com>2016-04-10 14:41:40 (GMT)
committerBoris Nagaev <bnagaev@gmail.com>2016-04-10 16:21:43 (GMT)
commitefff981373b928c0dfc728fcf9c3c69541590353 (patch)
tree227830226fb5994dca0ee2f913872b76c6be77ee
parentcbbb43b7d44ea0fbe2d8efd03d741c6d20bb931b (diff)
downloadmxe-efff981373b928c0dfc728fcf9c3c69541590353.zip
mxe-efff981373b928c0dfc728fcf9c3c69541590353.tar.gz
mxe-efff981373b928c0dfc728fcf9c3c69541590353.tar.bz2
djvulibre: enable shared targets
Patch "fix linking errors in shared builds" fixes i686-w64-mingw32.shared. Change of djvulibre.mk fixes x86_64-w64-mingw32.shared by changing deplibs check method to "objdump". See the explanations below. On Wheezy (at least) "file" returns "data" for x86-64 object files from libmsvcp60.a. Therefore the check fails with the following message: *** Warning: linker path does not have real file for library -lmsvcp60. *** I have the capability to make that library automatically link in when *** you link to this library. But I can only do this if you have a *** shared version of the library, which you do not appear to have *** because I did check the linker path looking for a file starting *** with libmsvcp60 and none of the candidates passed a file format test *** using a file magic. Last file checked: /home/mxe/mxe-djvulibre/usr/lib/gcc/x86_64-w64-mingw32.shared/4.9.3/../../../../x86_64-w64-mingw32.shared/lib//libmsvcp60.a *** The inter-library dependencies that have been dropped here will be *** automatically added whenever a program is linked with this library *** or is declared to -dlopen it. *** Since this library must not contain undefined symbols, *** because either the platform does not support them or *** it was explicitly requested with -no-undefined, *** libtool will only create a static version of it. Then it compiled static library and failed when compiling djvulibre-test.c because of missing -ljpeg.
-rw-r--r--src/djvulibre-1-fixes.patch30
-rw-r--r--src/djvulibre.mk8
2 files changed, 34 insertions, 4 deletions
diff --git a/src/djvulibre-1-fixes.patch b/src/djvulibre-1-fixes.patch
index eba6e5e..b19b52c 100644
--- a/src/djvulibre-1-fixes.patch
+++ b/src/djvulibre-1-fixes.patch
@@ -279,3 +279,33 @@ index 1111111..2222222 100644
p += 1;
// Cast and return
return (short**)p;
+
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Boris Nagaev <bnagaev@gmail.com>
+Date: Sun, 10 Apr 2016 14:58:05 +0200
+Subject: [PATCH] fix linking errors in shared builds
+
+> the presence
+> of any one __declspec(dllexport) in any object file disables the
+> auto-export feature, so if you declare any symbol dllexport you have to
+> mark them all (or explicily -Wl,--export-all-symbols.)
+
+See http://mingw-users.1079350.n2.nabble.com/MinGW-produces-incorrect-dll-a-files-tp1109211p1109231.html
+
+./configure adds -Wl,--export-all-symbols if host matches "*-mingw32",
+but MXE's host is "i686-w64-mingw32.shared". This patch changes the
+pattern to "*-mingw32*".
+
+diff --git a/configure b/configure
+index 1111111..2222222 100755
+--- a/configure
++++ b/configure
+@@ -2927,7 +2927,7 @@ DLLFLAGS=
+
+ # Special cases
+ case "$host" in
+- *-mingw32)
++ *-mingw32*)
+ DLLFLAGS="$DLLFLAGS -Wl,--export-all-symbols"
+ LIBS=-lmsvcp60
+ ;;
diff --git a/src/djvulibre.mk b/src/djvulibre.mk
index 8827123..3e4e09a 100644
--- a/src/djvulibre.mk
+++ b/src/djvulibre.mk
@@ -20,7 +20,10 @@ endef
define $(PKG)_BUILD
cd '$(1)' && CPPFLAGS='-DDLL_EXPORT' ./configure \
$(MXE_CONFIGURE_OPTS) \
- --disable-desktopfiles
+ --disable-desktopfiles \
+ $(if $(BUILD_SHARED),\
+ lt_cv_deplibs_check_method='file_magic file format (pe-i386|pe-x86-64)' \
+ lt_cv_file_magic_cmd='$$OBJDUMP -f')
$(MAKE) -C '$(1)' -j '$(JOBS)'
$(MAKE) -C '$(1)/libdjvu' -j 1 install-lib \
install-include install-pkgconfig
@@ -30,6 +33,3 @@ define $(PKG)_BUILD
'$(2).c' -o '$(PREFIX)/$(TARGET)/bin/test-$(PKG).exe' \
`'$(TARGET)-pkg-config' ddjvuapi --libs`
endef
-
-$(PKG)_BUILD_SHARED =
-