summaryrefslogtreecommitdiffstats
path: root/src/djvulibre-1-fixes.patch
blob: 82764adbcb58e81863f240bf51574577e05b8943 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
This file is part of MXE. See LICENSE.md for licensing information.

Contains ad hoc patches for cross building.

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: darealshinji <djcj@gmx.de>
Date: Sun, 24 Jul 2016 09:33:22 +0200
Subject: [PATCH] define XXX_EXPORT symbols


diff --git a/libdjvu/Makefile.am b/libdjvu/Makefile.am
index 1111111..2222222 100644
--- a/libdjvu/Makefile.am
+++ b/libdjvu/Makefile.am
@@ -33,6 +33,8 @@ libdjvulibre_la_LIBADD = $(JPEG_LIBS) $(PTHREAD_LIBS)
 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_LDFLAGS += -Wl,--export-all-symbols
 endif
 

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: darealshinji <djcj@gmx.de>
Date: Sun, 24 Jul 2016 09:36:49 +0200
Subject: [PATCH] disable unknown pragma warnings


diff --git a/libdjvu/miniexp.cpp b/libdjvu/miniexp.cpp
index 1111111..2222222 100644
--- a/libdjvu/miniexp.cpp
+++ b/libdjvu/miniexp.cpp
@@ -382,6 +382,7 @@ static void NTAPI gctls_cb(PVOID, DWORD dwReason, PVOID) {
     {CSLOCK(r);TlsFree(tlsIndex);tlsIndex=TLS_OUT_OF_INDEXES;}
 }
 # endif
+#ifdef __MSC_VER
 // -- Very black magic to clean tls variables.
 # ifdef _M_IX86
 #  pragma comment (linker, "/INCLUDE:_tlscb")
@@ -391,6 +392,7 @@ static void NTAPI gctls_cb(PVOID, DWORD dwReason, PVOID) {
 # pragma const_seg(".CRT$XLB")
 extern "C" PIMAGE_TLS_CALLBACK tlscb = gctls_cb;
 # pragma const_seg()
+#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@)