up to 1.15.0
[packages/mupdf.git] / mupdf-shared.patch
CommitLineData
2e02666f
JP
1--- mupdf-1.15.0-source/Makefile.orig 2019-05-06 13:53:09.000000000 +0200
2+++ mupdf-1.15.0-source/Makefile 2019-07-04 01:42:59.715191269 +0200
5622ca89
JB
3@@ -41,9 +41,12 @@
4 QUIET_AR = @ echo " AR $@" ;
5 QUIET_RANLIB = @ echo " RANLIB $@" ;
6 QUIET_CC = @ echo " CC $@" ;
7+ QUIET_LTCC = @ echo " LTCC $@" ;
8 QUIET_CXX = @ echo " CXX $@" ;
9+ QUIET_LTCXX = @ echo " LTCXX $@" ;
10 QUIET_GEN = @ echo " GEN $@" ;
11 QUIET_LINK = @ echo " LINK $@" ;
12+ QUIET_LTLINK = @ echo " LTLINK $@" ;
13 QUIET_RM = @ echo " RM $@" ;
14 QUIET_TAGS = @ echo " TAGS $@" ;
15 QUIET_WINDRES = @ echo " WINDRES $@" ;
16@@ -52,12 +55,16 @@
17
18 MKTGTDIR = mkdir -p $(dir $@)
19 CC_CMD = $(QUIET_CC) $(MKTGTDIR) ; $(CC) $(CFLAGS) -MMD -MP -o $@ -c $<
20+LTCC_CMD = $(QUIET_LTCC) libtool --mode=compile --tag=CC $(CC) $(CFLAGS) -MMD -MP -o $@ -c $<
21 CXX_CMD = $(QUIET_CXX) $(MKTGTDIR) ; $(CXX) $(CFLAGS) -MMD -MP -o $@ -c $<
22+LTCXX_CMD = $(QUIET_CXX) libtool --mode=compile --tag=CXX $(CXX) $(CFLAGS) -MMD -MP -o $@ -c $<
23 AR_CMD = $(QUIET_AR) $(MKTGTDIR) ; $(AR) cr $@ $^
24 ifdef RANLIB
25 RANLIB_CMD = $(QUIET_RANLIB) $(RANLIB) $@
26 endif
27 LINK_CMD = $(QUIET_LINK) $(MKTGTDIR) ; $(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
28+LTLINK_CMD = $(QUIET_LINK) $(MKTGTDIR) ; libtool --mode=link --tag=CC $(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
29+LTLINKCXX_CMD = $(QUIET_LINK) $(MKTGTDIR) ; libtool --mode=link --tag=CXX $(CXX) $(LDFLAGS) -o $@ $^ $(LIBS)
2e02666f 30 TAGS_CMD = $(QUIET_TAGS) ctags -R
5622ca89
JB
31 WINDRES_CMD = $(QUIET_WINDRES) $(MKTGTDIR) ; $(WINDRES) $< $@
32 OBJCOPY_CMD = $(QUIET_OBJCOPY) $(MKTGTDIR) ; $(LD) -r -b binary -o $@ $<
33@@ -68,6 +75,9 @@
34 $(AR_CMD)
35 $(RANLIB_CMD)
36
37+$(OUT)/%.la :
38+ $(LTLINK_CMD) -rpath $(libdir) $(LDLIBS)
39+
40 $(OUT)/%.exe: %.c
41 $(LINK_CMD)
42
2e02666f 43@@ -90,13 +100,16 @@
5622ca89
JB
44 $(CC_CMD) -Wall $(THIRD_CFLAGS) $(GLUT_CFLAGS)
45
46 ifeq ($(HAVE_OBJCOPY),yes)
47- $(OUT)/source/fitz/noto.o : source/fitz/noto.c
48- $(CC_CMD) -Wall -Wdeclaration-after-statement -DHAVE_OBJCOPY $(THIRD_CFLAGS)
49+ $(OUT)/source/fitz/noto.lo : source/fitz/noto.c
50+ $(LTCC_CMD) -Wall -Wdeclaration-after-statement -DHAVE_OBJCOPY $(THIRD_CFLAGS)
51 endif
52
53 $(OUT)/source/%.o : source/%.c
54 $(CC_CMD) -Wall -Wdeclaration-after-statement $(THIRD_CFLAGS)
55
56+$(OUT)/source/%.lo : source/%.c
57+ $(LTCC_CMD) -Wall -Wdeclaration-after-statement $(THIRD_CFLAGS)
58+
59 $(OUT)/platform/%.o : platform/%.c
60 $(CC_CMD) -Wall
61
2e02666f 62@@ -104,12 +117,13 @@
5622ca89
JB
63 $(WINDRES_CMD)
64
65 .PRECIOUS : $(OUT)/%.o # Keep intermediates from chained rules
66+.PRECIOUS : $(OUT)/%.lo # Keep intermediates from chained rules
67 .PRECIOUS : $(OUT)/%.exe # Keep intermediates from chained rules
68
69 # --- File lists ---
70
71-THIRD_OBJ := $(THIRD_SRC:%.c=$(OUT)/%.o)
72-THIRD_OBJ := $(THIRD_OBJ:%.cc=$(OUT)/%.o)
73+THIRD_LOBJ := $(THIRD_SRC:%.c=$(OUT)/%.lo)
74+THIRD_LOBJ := $(THIRD_LOBJ:%.cc=$(OUT)/%.lo)
75
76 MUPDF_SRC := $(sort $(wildcard source/fitz/*.c))
77 MUPDF_SRC += $(sort $(wildcard source/pdf/*.c))
2e02666f 78@@ -119,7 +133,7 @@
5622ca89
JB
79 MUPDF_SRC += $(sort $(wildcard source/cbz/*.c))
80 MUPDF_SRC += $(sort $(wildcard source/gprf/*.c))
81
82-MUPDF_OBJ := $(MUPDF_SRC:%.c=$(OUT)/%.o)
83+MUPDF_LOBJ := $(MUPDF_SRC:%.c=$(OUT)/%.lo)
84
85 THREAD_SRC := source/helpers/mu-threads/mu-threads.c
86 THREAD_OBJ := $(THREAD_SRC:%.c=$(OUT)/%.o)
2e02666f 87@@ -147,13 +161,13 @@
5622ca89
JB
88 generated/%.ttc.c : %.ttc $(HEXDUMP_EXE) ; $(QUIET_GEN) $(MKTGTDIR) ; $(HEXDUMP_EXE) -s $@ $<
89
90 ifeq ($(HAVE_OBJCOPY),yes)
91- MUPDF_OBJ += $(FONT_BIN:%=$(OUT)/%.o)
92+ MUPDF_LOBJ += $(FONT_BIN:%=$(OUT)/%.o)
93 $(OUT)/%.cff.o : %.cff ; $(OBJCOPY_CMD)
94 $(OUT)/%.otf.o : %.otf ; $(OBJCOPY_CMD)
95 $(OUT)/%.ttf.o : %.ttf ; $(OBJCOPY_CMD)
96 $(OUT)/%.ttc.o : %.ttc ; $(OBJCOPY_CMD)
97 else
98- MUPDF_OBJ += $(FONT_GEN:%.c=$(OUT)/%.o)
99+ MUPDF_LOBJ += $(FONT_GEN:%.c=$(OUT)/%.lo)
100 endif
101
102 generate: $(FONT_GEN)
2e02666f 103@@ -187,17 +201,18 @@
5622ca89
JB
104
105 # --- Library ---
106
107-MUPDF_LIB = $(OUT)/libmupdf.a
108-THIRD_LIB = $(OUT)/libmupdf-third.a
109+MUPDF_LIB = $(OUT)/libmupdf.la
110+THIRD_LIB = $(OUT)/libmupdf-third.la
111 THREAD_LIB = $(OUT)/libmupdf-threads.a
112 PKCS7_LIB = $(OUT)/libmupdf-pkcs7.a
113
114-$(MUPDF_LIB) : $(MUPDF_OBJ)
115-$(THIRD_LIB) : $(THIRD_OBJ)
116+$(MUPDF_LIB) : $(MUPDF_LOBJ) $(THIRD_LIB)
117+$(MUPDF_LIB) : LDLIBS += $(THIRD_LIBS)
118+$(THIRD_LIB) : $(THIRD_LOBJ)
119 $(THREAD_LIB) : $(THREAD_OBJ)
120 $(PKCS7_LIB) : $(PKCS7_OBJ)
121
122-INSTALL_LIBS := $(MUPDF_LIB) $(THIRD_LIB)
123+INSTALL_LIBS := $(THIRD_LIB) $(MUPDF_LIB)
124
125 # --- Main tools and viewers ---
126
2e02666f 127@@ -211,13 +226,13 @@
5622ca89
JB
128 MUTOOL_OBJ := $(MUTOOL_SRC:%.c=$(OUT)/%.o)
129 MUTOOL_EXE := $(OUT)/mutool
130 $(MUTOOL_EXE) : $(MUTOOL_OBJ) $(MUPDF_LIB) $(THIRD_LIB) $(PKCS7_LIB) $(THREAD_LIB)
131- $(LINK_CMD) $(THIRD_LIBS) $(THREADING_LIBS) $(LIBCRYPTO_LIBS)
132+ $(LTLINK_CMD) $(THIRD_LIBS) $(THREADING_LIBS) $(LIBCRYPTO_LIBS)
2e02666f
JP
133 TOOL_APPS += $(MUTOOL_EXE)
134
135 MURASTER_OBJ := $(OUT)/source/tools/muraster.o
136 MURASTER_EXE := $(OUT)/muraster
137 $(MURASTER_EXE) : $(MURASTER_OBJ) $(MUPDF_LIB) $(THIRD_LIB) $(THREAD_LIB)
138- $(LINK_CMD) $(THIRD_LIBS) $(THREADING_LIBS)
139+ $(LTLINK_CMD) $(THIRD_LIBS) $(THREADING_LIBS)
140 TOOL_APPS += $(MURASTER_EXE)
5622ca89
JB
141
142 ifeq ($(HAVE_GLUT),yes)
2e02666f 143@@ -225,7 +240,7 @@
5622ca89
JB
144 MUVIEW_GLUT_OBJ := $(MUVIEW_GLUT_SRC:%.c=$(OUT)/%.o)
145 MUVIEW_GLUT_EXE := $(OUT)/mupdf-gl
146 $(MUVIEW_GLUT_EXE) : $(MUVIEW_GLUT_OBJ) $(MUPDF_LIB) $(THIRD_LIB) $(PKCS7_LIB) $(GLUT_LIB)
147- $(LINK_CMD) $(THIRD_LIBS) $(LIBCRYPTO_LIBS) $(WIN32_LDFLAGS) $(GLUT_LIBS)
148+ $(LTLINK_CMD) $(THIRD_LIBS) $(LIBCRYPTO_LIBS) $(WIN32_LDFLAGS) $(GLUT_LIBS)
2e02666f 149 VIEW_APPS += $(MUVIEW_GLUT_EXE)
5622ca89
JB
150 endif
151
2e02666f 152@@ -235,7 +250,7 @@
5622ca89
JB
153 MUVIEW_X11_OBJ += $(OUT)/platform/x11/x11_main.o
154 MUVIEW_X11_OBJ += $(OUT)/platform/x11/x11_image.o
155 $(MUVIEW_X11_EXE) : $(MUVIEW_X11_OBJ) $(MUPDF_LIB) $(THIRD_LIB) $(PKCS7_LIB)
156- $(LINK_CMD) $(THIRD_LIBS) $(X11_LIBS) $(LIBCRYPTO_LIBS)
157+ $(LTLINK_CMD) $(THIRD_LIBS) $(X11_LIBS) $(LIBCRYPTO_LIBS)
2e02666f 158 VIEW_APPS += $(MUVIEW_X11_EXE)
5622ca89
JB
159 endif
160
2e02666f 161@@ -245,7 +260,7 @@
5622ca89
JB
162 MUVIEW_WIN32_OBJ += $(OUT)/platform/x11/win_main.o
163 MUVIEW_WIN32_OBJ += $(OUT)/platform/x11/win_res.o
164 $(MUVIEW_WIN32_EXE) : $(MUVIEW_WIN32_OBJ) $(MUPDF_LIB) $(THIRD_LIB) $(PKCS7_LIB)
165- $(LINK_CMD) $(THIRD_LIBS) $(WIN32_LDFLAGS) $(WIN32_LIBS) $(LIBCRYPTO_LIBS)
166+ $(LTLINK_CMD) $(THIRD_LIBS) $(WIN32_LDFLAGS) $(WIN32_LIBS) $(LIBCRYPTO_LIBS)
2e02666f 167 VIEW_APPS += $(MUVIEW_WIN32_EXE)
5622ca89
JB
168 endif
169
2e02666f 170@@ -267,9 +282,9 @@
5622ca89
JB
171 # --- Examples ---
172
173 $(OUT)/example: docs/examples/example.c $(MUPDF_LIB) $(THIRD_LIB)
174- $(LINK_CMD) $(CFLAGS) $(THIRD_LIBS)
175+ $(LTLINK_CMD) $(CFLAGS) $(THIRD_LIBS)
176 $(OUT)/multi-threaded: docs/examples/multi-threaded.c $(MUPDF_LIB) $(THIRD_LIB)
177- $(LINK_CMD) $(CFLAGS) $(THIRD_LIBS) -lpthread
178+ $(LTLINK_CMD) $(CFLAGS) $(THIRD_LIBS) -lpthread
179
180 # --- Update version string header ---
181
2e02666f
JP
182@@ -312,10 +327,10 @@
183 install -m 644 include/mupdf/pdf/*.h $(DESTDIR)$(incdir)/mupdf/pdf
5622ca89
JB
184
185 install -d $(DESTDIR)$(libdir)
2e02666f 186- install -m 644 $(INSTALL_LIBS) $(DESTDIR)$(libdir)
5622ca89
JB
187+ libtool --mode=install install $(INSTALL_LIBS) $(DESTDIR)$(libdir)
188
189 install -d $(DESTDIR)$(bindir)
2e02666f
JP
190- install -m 755 $(TOOL_APPS) $(VIEW_APPS) $(DESTDIR)$(bindir)
191+ libtool --mode=install install $(TOOL_APPS) $(VIEW_APPS) $(DESTDIR)$(bindir)
5622ca89
JB
192
193 install -d $(DESTDIR)$(mandir)/man1
2e02666f 194 install -m 644 docs/man/*.1 $(DESTDIR)$(mandir)/man1
5622ca89
JB
195--- mupdf-1.14.0-source/Makethird.orig 2018-10-04 11:19:28.000000000 +0200
196+++ mupdf-1.14.0-source/Makethird 2018-10-16 22:01:41.962388169 +0200
197@@ -52,8 +52,8 @@
198
199 THIRD_CFLAGS += $(FREETYPE_CFLAGS)
200
201-$(OUT)/thirdparty/freetype/%.o: thirdparty/freetype/%.c
202- $(CC_CMD) $(FREETYPE_CFLAGS) \
203+$(OUT)/thirdparty/freetype/%.lo: thirdparty/freetype/%.c
204+ $(LTCC_CMD) $(FREETYPE_CFLAGS) \
205 -DFT_CONFIG_MODULES_H=\"slimftmodules.h\" \
206 -DFT_CONFIG_OPTIONS_H=\"slimftoptions.h\" \
207 -DFT2_BUILD_LIBRARY
208@@ -110,8 +110,8 @@
209
210 THIRD_CFLAGS += -Ithirdparty/harfbuzz/src
211
212-$(OUT)/thirdparty/harfbuzz/%.o: thirdparty/harfbuzz/%.cc
213- $(CXX_CMD) $(FREETYPE_CFLAGS) -Iinclude/mupdf \
214+$(OUT)/thirdparty/harfbuzz/%.lo: thirdparty/harfbuzz/%.cc
215+ $(LTCXX_CMD) $(FREETYPE_CFLAGS) -Iinclude/mupdf \
216 -DHAVE_FALLBACK=1 \
217 -DHAVE_OT \
218 -DHAVE_ROUND \
219@@ -152,8 +152,8 @@
220 THIRD_CFLAGS += -Ithirdparty/jpegxr/Software
221 THIRD_CFLAGS += -DHAVE_JPEGXR
222
223-$(OUT)/thirdparty/jpegxr/%.o: thirdparty/jpegxr/%.c
224- $(CC_CMD) -Ithirdparty/jpegxr -Ithirdparty/jpegxr/Software -Wno-tautological-compare
225+$(OUT)/thirdparty/jpegxr/%.lo: thirdparty/jpegxr/%.c
226+ $(LTCC_CMD) -Ithirdparty/jpegxr -Ithirdparty/jpegxr/Software -Wno-tautological-compare
227
228 endif
229 endif
230@@ -198,8 +198,8 @@
231
232 THIRD_CFLAGS += -Iscripts/libjpeg -Ithirdparty/libjpeg
233
234-$(OUT)/thirdparty/libjpeg/%.o: thirdparty/libjpeg/%.c
235- $(CC_CMD) -Iscripts/libjpeg
236+$(OUT)/thirdparty/libjpeg/%.lo: thirdparty/libjpeg/%.c
237+ $(LTCC_CMD) -Iscripts/libjpeg
238
239 endif
240
241@@ -214,8 +214,8 @@
242
243 THIRD_CFLAGS += -Ithirdparty/lcms2/include
244
245-$(OUT)/thirdparty/lcms2/%.o: thirdparty/lcms2/%.c
246- $(CC_CMD) -Ithirdparty/lcms2/include
247+$(OUT)/thirdparty/lcms2/%.lo: thirdparty/lcms2/%.c
248+ $(LTCC_CMD) -Ithirdparty/lcms2/include
249
250 endif
251
252@@ -229,8 +229,8 @@
253 THIRD_SRC += thirdparty/mujs/one.c
254 THIRD_CFLAGS += -Ithirdparty/mujs
255
256-$(OUT)/thirdparty/mujs/%.o: thirdparty/mujs/%.c
257- $(CC_CMD)
258+$(OUT)/thirdparty/mujs/%.lo: thirdparty/mujs/%.c
259+ $(LTCC_CMD)
260
261 endif
262
263@@ -254,8 +254,8 @@
264
265 THIRD_CFLAGS += -Ithirdparty/zlib
266
267-$(OUT)/thirdparty/zlib/%.o: thirdparty/zlib/%.c
268- $(CC_CMD) -DHAVE_UNISTD_H -DHAVE_STDARG_H
269+$(OUT)/thirdparty/zlib/%.lo: thirdparty/zlib/%.c
270+ $(LTCC_CMD) -DHAVE_UNISTD_H -DHAVE_STDARG_H
271
272 endif
273
274@@ -274,8 +274,8 @@
275
276 THIRD_CFLAGS += $(LURATECH_CFLAGS) -DHAVE_LURATECH=1
277
278-$(OUT)/thirdparty/luratech/%.o: thirdparty/luratech/%.c
279- $(CC_CMD) -DLINUX $(LURATECH_CFLAGS) -Wno-tautological-compare -Wno-absolute-value
280+$(OUT)/thirdparty/luratech/%.lo: thirdparty/luratech/%.c
281+ $(LTCC_CMD) -DLINUX $(LURATECH_CFLAGS) -Wno-tautological-compare -Wno-absolute-value
282
283 else # HAVE_LURATECH
284
285@@ -303,8 +303,8 @@
286
287 THIRD_CFLAGS += -Ithirdparty/jbig2dec
288
289-$(OUT)/thirdparty/jbig2dec/%.o: thirdparty/jbig2dec/%.c
290- $(CC_CMD) -DHAVE_STDINT_H -DJBIG_EXTERNAL_MEMENTO_H=\"mupdf/memento.h\"
291+$(OUT)/thirdparty/jbig2dec/%.lo: thirdparty/jbig2dec/%.c
292+ $(LTCC_CMD) -DHAVE_STDINT_H -DJBIG_EXTERNAL_MEMENTO_H=\"mupdf/memento.h\"
293
294 endif
295
296@@ -342,8 +342,8 @@
297
298 THIRD_CFLAGS += $(OPENJPEG_CFLAGS)
299
300-$(OUT)/thirdparty/openjpeg/%.o: thirdparty/openjpeg/%.c
301- $(CC_CMD) $(OPENJPEG_CFLAGS)
302+$(OUT)/thirdparty/openjpeg/%.lo: thirdparty/openjpeg/%.c
303+ $(LTCC_CMD) $(OPENJPEG_CFLAGS)
304
305 endif
306
This page took 0.104748 seconds and 4 git commands to generate.