summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTony Theodore <tonyt@logyst.com>2017-07-19 06:33:25 (GMT)
committerGitHub <noreply@github.com>2017-07-19 06:33:25 (GMT)
commitfc8a59274f9e0a49971d9221dd5aa076ad9beca3 (patch)
tree3584102f6fda9b60423e561f48eb6ca01cc75655 /src
parent43f67841d414ed0d0c9360624fa4cd6cfcd6474b (diff)
parent965a00eeca7549a477f02321e45f7b26b69e7762 (diff)
downloadmxe-fc8a59274f9e0a49971d9221dd5aa076ad9beca3.zip
mxe-fc8a59274f9e0a49971d9221dd5aa076ad9beca3.tar.gz
mxe-fc8a59274f9e0a49971d9221dd5aa076ad9beca3.tar.bz2
Merge pull request #1799 from darealshinji/djvulibre-static
djvulibre: enable static library builds
Diffstat (limited to 'src')
-rw-r--r--src/djvulibre-1-fixes.patch55
-rw-r--r--src/djvulibre.mk15
2 files changed, 60 insertions, 10 deletions
diff --git a/src/djvulibre-1-fixes.patch b/src/djvulibre-1-fixes.patch
index e99f7e4..82764ad 100644
--- a/src/djvulibre-1-fixes.patch
+++ b/src/djvulibre-1-fixes.patch
@@ -36,7 +36,7 @@ index 1111111..2222222 100644
{CSLOCK(r);TlsFree(tlsIndex);tlsIndex=TLS_OUT_OF_INDEXES;}
}
# endif
-+#ifndef __GNUC__
++#ifdef __MSC_VER
// -- Very black magic to clean tls variables.
# ifdef _M_IX86
# pragma comment (linker, "/INCLUDE:_tlscb")
@@ -44,7 +44,58 @@ index 1111111..2222222 100644
# pragma const_seg(".CRT$XLB")
extern "C" PIMAGE_TLS_CALLBACK tlscb = gctls_cb;
# pragma const_seg()
-+#endif /* !__GNUC__ */
++#endif //__MSC_VER
#else
// No threads
+
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: darealshinji <djcj@gmx.de>
+Date: Sat, 1 Jul 2017 01:26:10 +0200
+Subject: [PATCH] enable static library builds
+
+
+diff --git a/libdjvu/DjVuGlobal.h b/libdjvu/DjVuGlobal.h
+index 1111111..2222222 100644
+--- a/libdjvu/DjVuGlobal.h
++++ b/libdjvu/DjVuGlobal.h
+@@ -70,11 +70,13 @@
+ # include <new> // try standard c++ anyway!
+ #endif
+
+-#ifdef _WIN32
+-# ifdef DJVUAPI_EXPORT
+-# define DJVUAPI __declspec(dllexport)
+-# else
+-# define DJVUAPI __declspec(dllimport)
++#ifndef DJVUAPI
++# ifdef _WIN32
++# ifdef DJVUAPI_EXPORT
++# define DJVUAPI __declspec(dllexport)
++# else
++# define DJVUAPI __declspec(dllimport)
++# endif
+ # endif
+ #endif
+ #ifndef DJVUAPI
+diff --git a/libdjvu/Makefile.am b/libdjvu/Makefile.am
+index 1111111..2222222 100644
+--- a/libdjvu/Makefile.am
++++ b/libdjvu/Makefile.am
+@@ -35,6 +35,7 @@ libdjvulibre_la_LDFLAGS = -no-undefined -version-info $(version_info)
+ if HAVE_OS_WIN32
+ libdjvulibre_la_CPPFLAGS += -DDJVUAPI_EXPORT
+ libdjvulibre_la_CPPFLAGS += -DDDJVUAPI_EXPORT -DMINILISPAPI_EXPORT
++libdjvulibre_la_CPPFLAGS += $(EXTRA_CPPFLAGS)
+ libdjvulibre_la_LDFLAGS += -Wl,--export-all-symbols
+ endif
+
+@@ -46,7 +47,7 @@ sed_process = $(SED) \
+ -e 's,@includedir\@,$(includedir),g' \
+ -e 's,@Libs\@,-L$(libdir) -ldjvulibre,g' \
+ -e 's,@Libsprivate\@,$(JPEG_LIBS) $(PTHREAD_LIBS) $(LIBS),g' \
+- -e 's,@Cflags\@,-I$(includedir) $(JPEG_CFLAGS) $(PTHREAD_CFLAGS),g' \
++ -e 's,@Cflags\@,-I$(includedir) $(JPEG_CFLAGS) $(PTHREAD_CFLAGS) $(EXTRA_CPPFLAGS),g' \
+ < $< > $@ || (rm $@; exit 1)
+
+ pc_verbose = $(pc_verbose_@AM_V@)
diff --git a/src/djvulibre.mk b/src/djvulibre.mk
index 4ebb5ba..272bd22 100644
--- a/src/djvulibre.mk
+++ b/src/djvulibre.mk
@@ -16,16 +16,15 @@ define $(PKG)_UPDATE
head -1
endef
-# can't build a working static library for now
-# https://sourceforge.net/p/djvu/bugs/274/
-define $(PKG)_BUILD_SHARED
+define $(PKG)_BUILD
cd '$(SOURCE_DIR)' && autoreconf -fi
cd '$(BUILD_DIR)' && $(SOURCE_DIR)/configure \
- $(MXE_CONFIGURE_OPTS) \
- --disable-desktopfiles
- $(MAKE) -C '$(BUILD_DIR)' -j '$(JOBS)'
- $(MAKE) -C '$(BUILD_DIR)' -j 1 install-strip \
- $(MXE_DISABLE_CRUFT) dist_bin_SCRIPTS=
+ $(MXE_CONFIGURE_OPTS)
+ $(MAKE) -C '$(BUILD_DIR)/libdjvu' -j '$(JOBS)' \
+ EXTRA_CPPFLAGS=$(if $(BUILD_STATIC),'-DDDJVUAPI= -DMINILISPAPI=')
+ $(MAKE) -C '$(BUILD_DIR)/libdjvu' -j 1 install-strip \
+ $(MXE_DISABLE_CRUFT) dist_bin_SCRIPTS= \
+ EXTRA_CPPFLAGS=$(if $(BUILD_STATIC),'-DDDJVUAPI= -DMINILISPAPI=')
'$(TARGET)-g++' \
-W -Wall -Werror -pedantic \