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.
pull/1286/head
Boris Nagaev 8 years ago
parent cbbb43b7d4
commit efff981373

@ -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
;;

@ -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 =

Loading…
Cancel
Save