up to 1.17.0
[packages/mupdf.git] / mupdf-shared.patch
CommitLineData
e74c4977
JP
1--- mupdf-1.16.1-source/Makefile.orig 2019-08-02 16:49:26.000000000 +0200
2+++ mupdf-1.16.1-source/Makefile 2019-08-03 16:42:46.407735805 +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)
b6184cba 30 TAGS_CMD = $(QUIET_TAGS) ctags -R --c-kinds=+p
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
e74c4977 43@@ -93,13 +103,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
e74c4977 62@@ -107,12 +120,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))
e74c4977
JP
78@@ -121,7 +135,7 @@
79 MUPDF_SRC += $(sort $(wildcard source/html/*.c))
5622ca89 80 MUPDF_SRC += $(sort $(wildcard source/cbz/*.c))
5622ca89
JB
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)
e74c4977 87@@ -149,13 +163,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)
e74c4977 103@@ -189,17 +203,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
e74c4977 127@@ -213,13 +228,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
b6184cba
JP
137 $(MURASTER_EXE) : $(MURASTER_OBJ) $(MUPDF_LIB) $(THIRD_LIB) $(PKCS7_LIB) $(THREAD_LIB)
138- $(LINK_CMD) $(THIRD_LIBS) $(THREADING_LIBS) $(LIBCRYPTO_LIBS)
139+ $(LTLINK_CMD) $(THIRD_LIBS) $(THREADING_LIBS) $(LIBCRYPTO_LIBS)
2e02666f 140 TOOL_APPS += $(MURASTER_EXE)
5622ca89
JB
141
142 ifeq ($(HAVE_GLUT),yes)
e74c4977 143@@ -227,7 +242,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
e74c4977 152@@ -237,7 +252,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
e74c4977 161@@ -247,7 +262,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
e74c4977
JP
170@@ -261,7 +276,7 @@
171 MUVIEW_X11_CURL_OBJ += $(OUT)/platform/x11/curl/curl_stream.o
172 MUVIEW_X11_CURL_OBJ += $(OUT)/platform/x11/curl/prog_stream.o
173 $(MUVIEW_X11_CURL_EXE) : $(MUVIEW_X11_CURL_OBJ) $(MUPDF_LIB) $(THIRD_LIB) $(PKCS7_LIB) $(CURL_LIB)
174- $(LINK_CMD) $(THIRD_LIBS) $(X11_LIBS) $(LIBCRYPTO_LIBS) $(CURL_LIBS) $(PTHREAD_LIBS)
175+ $(LTLINK_CMD) $(THIRD_LIBS) $(X11_LIBS) $(LIBCRYPTO_LIBS) $(CURL_LIBS) $(PTHREAD_LIBS)
176 VIEW_APPS += $(MUVIEW_X11_CURL_EXE)
177 endif
178 endif
179@@ -286,9 +301,9 @@
5622ca89
JB
180 # --- Examples ---
181
182 $(OUT)/example: docs/examples/example.c $(MUPDF_LIB) $(THIRD_LIB)
183- $(LINK_CMD) $(CFLAGS) $(THIRD_LIBS)
184+ $(LTLINK_CMD) $(CFLAGS) $(THIRD_LIBS)
185 $(OUT)/multi-threaded: docs/examples/multi-threaded.c $(MUPDF_LIB) $(THIRD_LIB)
186- $(LINK_CMD) $(CFLAGS) $(THIRD_LIBS) -lpthread
187+ $(LTLINK_CMD) $(CFLAGS) $(THIRD_LIBS) -lpthread
188
189 # --- Update version string header ---
190
e74c4977 191@@ -331,10 +346,10 @@
2e02666f 192 install -m 644 include/mupdf/pdf/*.h $(DESTDIR)$(incdir)/mupdf/pdf
5622ca89
JB
193
194 install -d $(DESTDIR)$(libdir)
2e02666f 195- install -m 644 $(INSTALL_LIBS) $(DESTDIR)$(libdir)
5622ca89
JB
196+ libtool --mode=install install $(INSTALL_LIBS) $(DESTDIR)$(libdir)
197
198 install -d $(DESTDIR)$(bindir)
2e02666f
JP
199- install -m 755 $(TOOL_APPS) $(VIEW_APPS) $(DESTDIR)$(bindir)
200+ libtool --mode=install install $(TOOL_APPS) $(VIEW_APPS) $(DESTDIR)$(bindir)
5622ca89
JB
201
202 install -d $(DESTDIR)$(mandir)/man1
2e02666f 203 install -m 644 docs/man/*.1 $(DESTDIR)$(mandir)/man1
5622ca89
JB
204--- mupdf-1.14.0-source/Makethird.orig 2018-10-04 11:19:28.000000000 +0200
205+++ mupdf-1.14.0-source/Makethird 2018-10-16 22:01:41.962388169 +0200
206@@ -52,8 +52,8 @@
207
208 THIRD_CFLAGS += $(FREETYPE_CFLAGS)
209
210-$(OUT)/thirdparty/freetype/%.o: thirdparty/freetype/%.c
211- $(CC_CMD) $(FREETYPE_CFLAGS) \
212+$(OUT)/thirdparty/freetype/%.lo: thirdparty/freetype/%.c
213+ $(LTCC_CMD) $(FREETYPE_CFLAGS) \
214 -DFT_CONFIG_MODULES_H=\"slimftmodules.h\" \
215 -DFT_CONFIG_OPTIONS_H=\"slimftoptions.h\" \
216 -DFT2_BUILD_LIBRARY
217@@ -110,8 +110,8 @@
218
219 THIRD_CFLAGS += -Ithirdparty/harfbuzz/src
220
221-$(OUT)/thirdparty/harfbuzz/%.o: thirdparty/harfbuzz/%.cc
222- $(CXX_CMD) $(FREETYPE_CFLAGS) -Iinclude/mupdf \
223+$(OUT)/thirdparty/harfbuzz/%.lo: thirdparty/harfbuzz/%.cc
224+ $(LTCXX_CMD) $(FREETYPE_CFLAGS) -Iinclude/mupdf \
225 -DHAVE_FALLBACK=1 \
226 -DHAVE_OT \
227 -DHAVE_ROUND \
228@@ -152,8 +152,8 @@
229 THIRD_CFLAGS += -Ithirdparty/jpegxr/Software
230 THIRD_CFLAGS += -DHAVE_JPEGXR
231
232-$(OUT)/thirdparty/jpegxr/%.o: thirdparty/jpegxr/%.c
233- $(CC_CMD) -Ithirdparty/jpegxr -Ithirdparty/jpegxr/Software -Wno-tautological-compare
234+$(OUT)/thirdparty/jpegxr/%.lo: thirdparty/jpegxr/%.c
235+ $(LTCC_CMD) -Ithirdparty/jpegxr -Ithirdparty/jpegxr/Software -Wno-tautological-compare
236
237 endif
238 endif
239@@ -198,8 +198,8 @@
240
241 THIRD_CFLAGS += -Iscripts/libjpeg -Ithirdparty/libjpeg
242
243-$(OUT)/thirdparty/libjpeg/%.o: thirdparty/libjpeg/%.c
244- $(CC_CMD) -Iscripts/libjpeg
245+$(OUT)/thirdparty/libjpeg/%.lo: thirdparty/libjpeg/%.c
246+ $(LTCC_CMD) -Iscripts/libjpeg
247
248 endif
249
250@@ -214,8 +214,8 @@
251
252 THIRD_CFLAGS += -Ithirdparty/lcms2/include
253
254-$(OUT)/thirdparty/lcms2/%.o: thirdparty/lcms2/%.c
255- $(CC_CMD) -Ithirdparty/lcms2/include
256+$(OUT)/thirdparty/lcms2/%.lo: thirdparty/lcms2/%.c
257+ $(LTCC_CMD) -Ithirdparty/lcms2/include
258
259 endif
260
261@@ -229,8 +229,8 @@
262 THIRD_SRC += thirdparty/mujs/one.c
263 THIRD_CFLAGS += -Ithirdparty/mujs
264
265-$(OUT)/thirdparty/mujs/%.o: thirdparty/mujs/%.c
266- $(CC_CMD)
267+$(OUT)/thirdparty/mujs/%.lo: thirdparty/mujs/%.c
268+ $(LTCC_CMD)
269
270 endif
271
272@@ -254,8 +254,8 @@
273
274 THIRD_CFLAGS += -Ithirdparty/zlib
275
276-$(OUT)/thirdparty/zlib/%.o: thirdparty/zlib/%.c
277- $(CC_CMD) -DHAVE_UNISTD_H -DHAVE_STDARG_H
278+$(OUT)/thirdparty/zlib/%.lo: thirdparty/zlib/%.c
279+ $(LTCC_CMD) -DHAVE_UNISTD_H -DHAVE_STDARG_H
280
281 endif
282
283@@ -274,8 +274,8 @@
284
b6184cba 285 THIRD_CFLAGS += $(LURATECH_CFLAGS) -DHAVE_LURATECH
5622ca89
JB
286
287-$(OUT)/thirdparty/luratech/%.o: thirdparty/luratech/%.c
b6184cba 288- $(CC_CMD) -DLINUX $(LURATECH_CFLAGS) -Wno-tautological-compare -Wno-absolute-value -Wno-sign-compare
5622ca89 289+$(OUT)/thirdparty/luratech/%.lo: thirdparty/luratech/%.c
b6184cba 290+ $(LTCC_CMD) -DLINUX $(LURATECH_CFLAGS) -Wno-tautological-compare -Wno-absolute-value -Wno-sign-compare
5622ca89
JB
291
292 else # HAVE_LURATECH
293
294@@ -303,8 +303,8 @@
295
296 THIRD_CFLAGS += -Ithirdparty/jbig2dec
297
298-$(OUT)/thirdparty/jbig2dec/%.o: thirdparty/jbig2dec/%.c
b6184cba 299- $(CC_CMD) -DHAVE_STDINT_H -DJBIG_EXTERNAL_MEMENTO_H=\"mupdf/memento.h\" -Wno-sign-compare
5622ca89 300+$(OUT)/thirdparty/jbig2dec/%.lo: thirdparty/jbig2dec/%.c
b6184cba 301+ $(LTCC_CMD) -DHAVE_STDINT_H -DJBIG_EXTERNAL_MEMENTO_H=\"mupdf/memento.h\" -Wno-sign-compare
5622ca89
JB
302
303 endif
304
305@@ -342,8 +342,8 @@
306
307 THIRD_CFLAGS += $(OPENJPEG_CFLAGS)
308
309-$(OUT)/thirdparty/openjpeg/%.o: thirdparty/openjpeg/%.c
310- $(CC_CMD) $(OPENJPEG_CFLAGS)
311+$(OUT)/thirdparty/openjpeg/%.lo: thirdparty/openjpeg/%.c
312+ $(LTCC_CMD) $(OPENJPEG_CFLAGS)
313
314 endif
315
This page took 0.132633 seconds and 4 git commands to generate.