Merge pull request #2 from LuaAndC/djvulibre6

djvulibre: enable shared targets
This commit is contained in:
darealshinji 2016-04-10 19:12:01 +02:00
commit ebcd93b362
2 changed files with 34 additions and 4 deletions

View File

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

View File

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