- shared patch and -libs/-devel/-static are back (used by zathura-pdf-mupdf plugin...
[packages/mupdf.git] / mupdf-shared.patch
CommitLineData
5622ca89
JB
1--- mupdf-1.14.0-source/Makefile.orig 2018-10-04 11:19:28.000000000 +0200
2+++ mupdf-1.14.0-source/Makefile 2018-10-16 21:33:57.902407170 +0200
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)
30 TAGS_CMD = $(QUIET_TAGS) ctags $^
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
43@@ -93,13 +103,16 @@
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
62@@ -107,12 +120,13 @@
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))
78@@ -122,7 +136,7 @@
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)
87@@ -150,13 +164,13 @@
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)
103@@ -190,17 +204,18 @@
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
127@@ -214,7 +228,7 @@
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)
133 INSTALL_APPS += $(MUTOOL_EXE)
134
135 ifeq ($(HAVE_GLUT),yes)
136@@ -222,7 +236,7 @@
137 MUVIEW_GLUT_OBJ := $(MUVIEW_GLUT_SRC:%.c=$(OUT)/%.o)
138 MUVIEW_GLUT_EXE := $(OUT)/mupdf-gl
139 $(MUVIEW_GLUT_EXE) : $(MUVIEW_GLUT_OBJ) $(MUPDF_LIB) $(THIRD_LIB) $(PKCS7_LIB) $(GLUT_LIB)
140- $(LINK_CMD) $(THIRD_LIBS) $(LIBCRYPTO_LIBS) $(WIN32_LDFLAGS) $(GLUT_LIBS)
141+ $(LTLINK_CMD) $(THIRD_LIBS) $(LIBCRYPTO_LIBS) $(WIN32_LDFLAGS) $(GLUT_LIBS)
142 INSTALL_APPS += $(MUVIEW_GLUT_EXE)
143 endif
144
145@@ -232,7 +246,7 @@
146 MUVIEW_X11_OBJ += $(OUT)/platform/x11/x11_main.o
147 MUVIEW_X11_OBJ += $(OUT)/platform/x11/x11_image.o
148 $(MUVIEW_X11_EXE) : $(MUVIEW_X11_OBJ) $(MUPDF_LIB) $(THIRD_LIB) $(PKCS7_LIB)
149- $(LINK_CMD) $(THIRD_LIBS) $(X11_LIBS) $(LIBCRYPTO_LIBS)
150+ $(LTLINK_CMD) $(THIRD_LIBS) $(X11_LIBS) $(LIBCRYPTO_LIBS)
151 INSTALL_APPS += $(MUVIEW_X11_EXE)
152 endif
153
154@@ -242,7 +256,7 @@
155 MUVIEW_WIN32_OBJ += $(OUT)/platform/x11/win_main.o
156 MUVIEW_WIN32_OBJ += $(OUT)/platform/x11/win_res.o
157 $(MUVIEW_WIN32_EXE) : $(MUVIEW_WIN32_OBJ) $(MUPDF_LIB) $(THIRD_LIB) $(PKCS7_LIB)
158- $(LINK_CMD) $(THIRD_LIBS) $(WIN32_LDFLAGS) $(WIN32_LIBS) $(LIBCRYPTO_LIBS)
159+ $(LTLINK_CMD) $(THIRD_LIBS) $(WIN32_LDFLAGS) $(WIN32_LIBS) $(LIBCRYPTO_LIBS)
160 INSTALL_APPS += $(MUVIEW_WIN32_EXE)
161 endif
162
163@@ -251,19 +265,19 @@
164 MURASTER_OBJ := $(OUT)/source/tools/muraster.o
165 MURASTER_EXE := $(OUT)/muraster
166 $(MURASTER_EXE) : $(MURASTER_OBJ) $(MUPDF_LIB) $(THIRD_LIB) $(THREAD_LIB)
167- $(LINK_CMD) $(THIRD_LIBS) $(THREADING_LIBS)
168+ $(LTLINK_CMD) $(THIRD_LIBS) $(THREADING_LIBS)
169 EXTRA_APPS += $(MURASTER_EXE)
170
171 MJSGEN_OBJ := $(OUT)/source/tools/mjsgen.o
172 MJSGEN_EXE := $(OUT)/mjsgen
173 $(MJSGEN_EXE) : $(MJSGEN_OBJ) $(MUPDF_LIB) $(THIRD_LIB)
174- $(LINK_CMD) $(THIRD_LIBS)
175+ $(LTLINK_CMD) $(THIRD_LIBS)
176 EXTRA_APPS += $(MJSGEN_EXE)
177
178 MUJSTEST_OBJ := $(addprefix $(OUT)/platform/x11/, jstest_main.o pdfapp.o)
179 MUJSTEST_EXE := $(OUT)/mujstest
180 $(MUJSTEST_EXE) : $(MUJSTEST_OBJ) $(MUPDF_LIB) $(THIRD_LIB) $(PKCS7_LIB)
181- $(LINK_CMD) $(THIRD_LIBS) $(LIBCRYPTO_LIBS)
182+ $(LTLINK_CMD) $(THIRD_LIBS) $(LIBCRYPTO_LIBS)
183 EXTRA_APPS += $(MUJSTEST_EXE)
184
185 ifeq ($(HAVE_X11),yes)
186@@ -274,7 +288,7 @@
187 MUVIEW_X11_CURL_OBJ += $(OUT)/platform/x11/curl/x11_image.o
188 MUVIEW_X11_CURL_OBJ += $(OUT)/platform/x11/curl/curl_stream.o
189 $(MUVIEW_X11_CURL_EXE) : $(MUVIEW_X11_CURL_OBJ) $(MUPDF_LIB) $(THIRD_LIB) $(PKCS7_LIB) $(CURL_LIB)
190- $(LINK_CMD) $(THIRD_LIBS) $(X11_LIBS) $(CURL_LIBS) $(LIBCRYPTO_LIBS)
191+ $(LTLINK_CMD) $(THIRD_LIBS) $(X11_LIBS) $(CURL_LIBS) $(LIBCRYPTO_LIBS)
192 EXTRA_APPS += $(MUVIEW_X11_CURL_EXE)
193 endif
194 endif
195@@ -299,9 +313,9 @@
196 # --- Examples ---
197
198 $(OUT)/example: docs/examples/example.c $(MUPDF_LIB) $(THIRD_LIB)
199- $(LINK_CMD) $(CFLAGS) $(THIRD_LIBS)
200+ $(LTLINK_CMD) $(CFLAGS) $(THIRD_LIBS)
201 $(OUT)/multi-threaded: docs/examples/multi-threaded.c $(MUPDF_LIB) $(THIRD_LIB)
202- $(LINK_CMD) $(CFLAGS) $(THIRD_LIBS) -lpthread
203+ $(LTLINK_CMD) $(CFLAGS) $(THIRD_LIBS) -lpthread
204
205 # --- Update version string header ---
206
207@@ -345,10 +359,10 @@
208 install include/mupdf/pdf/*.h $(DESTDIR)$(incdir)/mupdf/pdf
209
210 install -d $(DESTDIR)$(libdir)
211- install $(INSTALL_LIBS) $(DESTDIR)$(libdir)
212+ libtool --mode=install install $(INSTALL_LIBS) $(DESTDIR)$(libdir)
213
214 install -d $(DESTDIR)$(bindir)
215- install $(INSTALL_APPS) $(DESTDIR)$(bindir)
216+ libtool --mode=install install $(INSTALL_APPS) $(DESTDIR)$(bindir)
217
218 install -d $(DESTDIR)$(mandir)/man1
219 install docs/man/*.1 $(DESTDIR)$(mandir)/man1
220--- mupdf-1.14.0-source/Makethird.orig 2018-10-04 11:19:28.000000000 +0200
221+++ mupdf-1.14.0-source/Makethird 2018-10-16 22:01:41.962388169 +0200
222@@ -52,8 +52,8 @@
223
224 THIRD_CFLAGS += $(FREETYPE_CFLAGS)
225
226-$(OUT)/thirdparty/freetype/%.o: thirdparty/freetype/%.c
227- $(CC_CMD) $(FREETYPE_CFLAGS) \
228+$(OUT)/thirdparty/freetype/%.lo: thirdparty/freetype/%.c
229+ $(LTCC_CMD) $(FREETYPE_CFLAGS) \
230 -DFT_CONFIG_MODULES_H=\"slimftmodules.h\" \
231 -DFT_CONFIG_OPTIONS_H=\"slimftoptions.h\" \
232 -DFT2_BUILD_LIBRARY
233@@ -110,8 +110,8 @@
234
235 THIRD_CFLAGS += -Ithirdparty/harfbuzz/src
236
237-$(OUT)/thirdparty/harfbuzz/%.o: thirdparty/harfbuzz/%.cc
238- $(CXX_CMD) $(FREETYPE_CFLAGS) -Iinclude/mupdf \
239+$(OUT)/thirdparty/harfbuzz/%.lo: thirdparty/harfbuzz/%.cc
240+ $(LTCXX_CMD) $(FREETYPE_CFLAGS) -Iinclude/mupdf \
241 -DHAVE_FALLBACK=1 \
242 -DHAVE_OT \
243 -DHAVE_ROUND \
244@@ -152,8 +152,8 @@
245 THIRD_CFLAGS += -Ithirdparty/jpegxr/Software
246 THIRD_CFLAGS += -DHAVE_JPEGXR
247
248-$(OUT)/thirdparty/jpegxr/%.o: thirdparty/jpegxr/%.c
249- $(CC_CMD) -Ithirdparty/jpegxr -Ithirdparty/jpegxr/Software -Wno-tautological-compare
250+$(OUT)/thirdparty/jpegxr/%.lo: thirdparty/jpegxr/%.c
251+ $(LTCC_CMD) -Ithirdparty/jpegxr -Ithirdparty/jpegxr/Software -Wno-tautological-compare
252
253 endif
254 endif
255@@ -198,8 +198,8 @@
256
257 THIRD_CFLAGS += -Iscripts/libjpeg -Ithirdparty/libjpeg
258
259-$(OUT)/thirdparty/libjpeg/%.o: thirdparty/libjpeg/%.c
260- $(CC_CMD) -Iscripts/libjpeg
261+$(OUT)/thirdparty/libjpeg/%.lo: thirdparty/libjpeg/%.c
262+ $(LTCC_CMD) -Iscripts/libjpeg
263
264 endif
265
266@@ -214,8 +214,8 @@
267
268 THIRD_CFLAGS += -Ithirdparty/lcms2/include
269
270-$(OUT)/thirdparty/lcms2/%.o: thirdparty/lcms2/%.c
271- $(CC_CMD) -Ithirdparty/lcms2/include
272+$(OUT)/thirdparty/lcms2/%.lo: thirdparty/lcms2/%.c
273+ $(LTCC_CMD) -Ithirdparty/lcms2/include
274
275 endif
276
277@@ -229,8 +229,8 @@
278 THIRD_SRC += thirdparty/mujs/one.c
279 THIRD_CFLAGS += -Ithirdparty/mujs
280
281-$(OUT)/thirdparty/mujs/%.o: thirdparty/mujs/%.c
282- $(CC_CMD)
283+$(OUT)/thirdparty/mujs/%.lo: thirdparty/mujs/%.c
284+ $(LTCC_CMD)
285
286 endif
287
288@@ -254,8 +254,8 @@
289
290 THIRD_CFLAGS += -Ithirdparty/zlib
291
292-$(OUT)/thirdparty/zlib/%.o: thirdparty/zlib/%.c
293- $(CC_CMD) -DHAVE_UNISTD_H -DHAVE_STDARG_H
294+$(OUT)/thirdparty/zlib/%.lo: thirdparty/zlib/%.c
295+ $(LTCC_CMD) -DHAVE_UNISTD_H -DHAVE_STDARG_H
296
297 endif
298
299@@ -274,8 +274,8 @@
300
301 THIRD_CFLAGS += $(LURATECH_CFLAGS) -DHAVE_LURATECH=1
302
303-$(OUT)/thirdparty/luratech/%.o: thirdparty/luratech/%.c
304- $(CC_CMD) -DLINUX $(LURATECH_CFLAGS) -Wno-tautological-compare -Wno-absolute-value
305+$(OUT)/thirdparty/luratech/%.lo: thirdparty/luratech/%.c
306+ $(LTCC_CMD) -DLINUX $(LURATECH_CFLAGS) -Wno-tautological-compare -Wno-absolute-value
307
308 else # HAVE_LURATECH
309
310@@ -303,8 +303,8 @@
311
312 THIRD_CFLAGS += -Ithirdparty/jbig2dec
313
314-$(OUT)/thirdparty/jbig2dec/%.o: thirdparty/jbig2dec/%.c
315- $(CC_CMD) -DHAVE_STDINT_H -DJBIG_EXTERNAL_MEMENTO_H=\"mupdf/memento.h\"
316+$(OUT)/thirdparty/jbig2dec/%.lo: thirdparty/jbig2dec/%.c
317+ $(LTCC_CMD) -DHAVE_STDINT_H -DJBIG_EXTERNAL_MEMENTO_H=\"mupdf/memento.h\"
318
319 endif
320
321@@ -342,8 +342,8 @@
322
323 THIRD_CFLAGS += $(OPENJPEG_CFLAGS)
324
325-$(OUT)/thirdparty/openjpeg/%.o: thirdparty/openjpeg/%.c
326- $(CC_CMD) $(OPENJPEG_CFLAGS)
327+$(OUT)/thirdparty/openjpeg/%.lo: thirdparty/openjpeg/%.c
328+ $(LTCC_CMD) $(OPENJPEG_CFLAGS)
329
330 endif
331
This page took 0.134146 seconds and 4 git commands to generate.