]> git.pld-linux.org Git - packages/mupdf.git/blame - mupdf-shared.patch
- rebuild without libjpeg.la
[packages/mupdf.git] / mupdf-shared.patch
CommitLineData
edbf3040
JB
1--- mupdf-1.9a-source/Makefile.orig 2016-04-21 13:14:32.000000000 +0200
2+++ mupdf-1.9a-source/Makefile 2016-05-14 08:56:44.284541516 +0200
3@@ -41,17 +41,24 @@
6d5cd20c 4 ifneq "$(verbose)" "yes"
f735ca81
JB
5 QUIET_AR = @ echo ' ' ' ' AR $@ ;
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_MKDIR = @ echo ' ' ' ' MKDIR $@ ;
14 QUIET_RM = @ echo ' ' ' ' RM $@ ;
15 endif
16
17 CC_CMD = $(QUIET_CC) $(CC) $(CFLAGS) -o $@ -c $<
18+LTCC_CMD = $(QUIET_LTCC) libtool --mode=compile --tag=CC $(CC) $(CFLAGS) -o $@ -c $<
19 CXX_CMD = $(QUIET_CXX) $(CXX) $(CFLAGS) -o $@ -c $<
20+LTCXX_CMD = $(QUIET_CXX) libtool --mode=compile --tag=CXX $(CXX) $(CFLAGS) -o $@ -c $<
21 AR_CMD = $(QUIET_AR) $(AR) cr $@ $^
22 LINK_CMD = $(QUIET_LINK) $(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
23+LTLINK_CMD = $(QUIET_LINK) libtool --mode=link --tag=CC $(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
24+LTLINKCXX_CMD = $(QUIET_LINK) libtool --mode=link --tag=CXX $(CXX) $(LDFLAGS) -o $@ $^ $(LIBS)
25 MKDIR_CMD = $(QUIET_MKDIR) mkdir -p $@
26 RM_CMD = $(QUIET_RM) rm -f $@
27
edbf3040 28@@ -89,25 +96,25 @@
f81d51d1
JB
29 HTML_SRC_HDR := $(wildcard source/html/*.h)
30 GPRF_SRC_HDR := $(wildcard source/gprf/*.h)
f735ca81
JB
31
32-FITZ_OBJ := $(subst source/, $(OUT)/, $(addsuffix .o, $(basename $(FITZ_SRC))))
33-PDF_OBJ := $(subst source/, $(OUT)/, $(addsuffix .o, $(basename $(PDF_SRC))))
34-XPS_OBJ := $(subst source/, $(OUT)/, $(addsuffix .o, $(basename $(XPS_SRC))))
35-CBZ_OBJ := $(subst source/, $(OUT)/, $(addsuffix .o, $(basename $(CBZ_SRC))))
f81d51d1
JB
36-HTML_OBJ := $(subst source/, $(OUT)/, $(addsuffix .o, $(basename $(HTML_SRC))))
37-GPRF_OBJ := $(subst source/, $(OUT)/, $(addsuffix .o, $(basename $(GPRF_SRC))))
f735ca81
JB
38+FITZ_LOBJ := $(subst source/, $(OUT)/, $(addsuffix .lo, $(basename $(FITZ_SRC))))
39+PDF_LOBJ := $(subst source/, $(OUT)/, $(addsuffix .lo, $(basename $(PDF_SRC))))
40+XPS_LOBJ := $(subst source/, $(OUT)/, $(addsuffix .lo, $(basename $(XPS_SRC))))
41+CBZ_LOBJ := $(subst source/, $(OUT)/, $(addsuffix .lo, $(basename $(CBZ_SRC))))
f81d51d1
JB
42+HTML_LOBJ := $(subst source/, $(OUT)/, $(addsuffix .lo, $(basename $(HTML_SRC))))
43+GPRF_LOBJ := $(subst source/, $(OUT)/, $(addsuffix .lo, $(basename $(GPRF_SRC))))
6d5cd20c 44
6d5cd20c
JB
45 ifeq "$(HAVE_MUJS)" "yes"
46-PDF_OBJ += $(OUT)/pdf/js/pdf-js.o
6d5cd20c 47+PDF_LOBJ += $(OUT)/pdf/js/pdf-js.lo
6d5cd20c
JB
48 else
49-PDF_OBJ += $(OUT)/pdf/js/pdf-js-none.o
50+PDF_LOBJ += $(OUT)/pdf/js/pdf-js-none.lo
51 endif
52
53-$(FITZ_OBJ) : $(FITZ_HDR) $(FITZ_SRC_HDR)
54-$(PDF_OBJ) : $(FITZ_HDR) $(PDF_HDR) $(PDF_SRC_HDR)
55-$(XPS_OBJ) : $(FITZ_HDR) $(XPS_HDR) $(XPS_SRC_HDR)
f81d51d1
JB
56-$(CBZ_OBJ) : $(FITZ_HDR)
57-$(HTML_OBJ) : $(FITZ_HDR) $(HTML_HDR) $(HTML_SRC_HDR)
58-$(GPRF_OBJ) : $(FITZ_HDR) $(GPRF_HDR) $(GPRF_SRC_HDR)
f735ca81
JB
59+$(FITZ_LOBJ) : $(FITZ_HDR) $(FITZ_SRC_HDR)
60+$(PDF_LOBJ) : $(FITZ_HDR) $(PDF_HDR) $(PDF_SRC_HDR)
61+$(XPS_LOBJ) : $(FITZ_HDR) $(XPS_HDR) $(XPS_SRC_HDR)
f81d51d1
JB
62+$(CBZ_LOBJ) : $(FITZ_HDR)
63+$(HTML_LOBJ) : $(FITZ_HDR) $(HTML_HDR) $(HTML_SRC_HDR)
64+$(GPRF_LOBJ) : $(FITZ_HDR) $(GPRF_HDR) $(GPRF_SRC_HDR)
f735ca81 65
edbf3040
JB
66 # --- Generated embedded font files ---
67
68@@ -123,7 +130,7 @@
69
70 FONT_BIN := $(FONT_BIN_DROID) $(FONT_BIN_NOTO) $(FONT_BIN_URW) $(FONT_BIN_SIL)
71 FONT_GEN := $(FONT_GEN_DROID) $(FONT_GEN_NOTO) $(FONT_GEN_URW) $(FONT_GEN_SIL)
72-FONT_OBJ := $(subst $(GEN)/, $(OUT)/fonts/, $(addsuffix .o, $(basename $(FONT_GEN))))
73+FONT_LOBJ := $(subst $(GEN)/, $(OUT)/fonts/, $(addsuffix .o, $(basename $(FONT_GEN))))
74
75 $(GEN)/%.c : resources/fonts/droid/%.ttc $(FONTDUMP)
76 $(QUIET_GEN) $(FONTDUMP) $@ $<
77@@ -134,33 +141,28 @@
78 $(GEN)/%.c : resources/fonts/sil/%.cff $(FONTDUMP)
79 $(QUIET_GEN) $(FONTDUMP) $@ $<
80
81-$(FONT_OBJ) : $(FONT_GEN)
82+$(FONT_LOBJ) : $(FONT_GEN)
83 $(FONT_GEN_DROID) : $(FONT_BIN_DROID)
84 $(FONT_GEN_NOTO) : $(FONT_BIN_NOTO)
85 $(FONT_GEN_URW) : $(FONT_BIN_URW)
86
f735ca81
JB
87 # --- Library ---
88
edbf3040
JB
89-MUPDF_LIB = $(OUT)/libmupdf.a
90-THIRD_LIB = $(OUT)/libmupdfthird.a
91+MUPDF_LIB = $(OUT)/libmupdf.la
92
93-MUPDF_OBJ := $(FITZ_OBJ) $(FONT_OBJ) $(PDF_OBJ) $(XPS_OBJ) $(CBZ_OBJ) $(HTML_OBJ) $(GPRF_OBJ)
94-THIRD_OBJ := $(FREETYPE_OBJ) $(HARFBUZZ_OBJ) $(JBIG2DEC_OBJ) $(JPEG_OBJ) $(MUJS_OBJ) $(OPENJPEG_OBJ) $(ZLIB_OBJ)
95+MUPDF_LOBJ := $(FITZ_LOBJ) $(FONT_LOBJ) $(PDF_LOBJ) $(XPS_LOBJ) $(CBZ_LOBJ) $(HTML_LOBJ) $(GPRF_LOBJ)
96
97-$(MUPDF_LIB) : $(MUPDF_OBJ)
98-$(THIRD_LIB) : $(THIRD_OBJ)
99+$(MUPDF_LIB) : $(MUPDF_LOBJ)
f735ca81 100
edbf3040
JB
101-INSTALL_LIBS := $(MUPDF_LIB) $(THIRD_LIB)
102+INSTALL_LIBS := $(MUPDF_LIB)
6d5cd20c 103
edbf3040 104 # --- Rules ---
6d5cd20c 105
f735ca81
JB
106 $(ALL_DIR) $(OUT) $(GEN) :
107 $(MKDIR_CMD)
108
109-$(OUT)/%.a :
110- $(RM_CMD)
111- $(AR_CMD)
112- $(RANLIB_CMD)
113+$(OUT)/%.la :
114+ $(LTLINK_CMD) -rpath $(libdir) $(LDLIBS)
115
116 $(OUT)/%: $(OUT)/%.o
117 $(LINK_CMD)
edbf3040 118@@ -171,6 +173,12 @@
f735ca81
JB
119 $(OUT)/%.o : source/%.cpp | $(ALL_DIR)
120 $(CXX_CMD)
121
122+$(OUT)/%.lo : source/%.c | $(ALL_DIR)
123+ $(LTCC_CMD)
124+
125+$(OUT)/%.lo : source/%.cpp | $(ALL_DIR)
126+ $(LTCXX_CMD)
127+
128 $(OUT)/%.o : scripts/%.c | $(OUT)
129 $(CC_CMD)
130
edbf3040 131@@ -240,57 +248,57 @@
f735ca81 132
f81d51d1 133 generate: $(CMAP_GEN) $(FONT_GEN) $(JAVASCRIPT_GEN) $(ADOBECA_GEN) $(NAME_GEN)
f735ca81
JB
134
135-$(OUT)/pdf/pdf-cmap-table.o : $(CMAP_GEN)
f735ca81
JB
136-$(OUT)/pdf/pdf-pkcs7.o : $(ADOBECA_GEN)
137-$(OUT)/pdf/js/pdf-js.o : $(JAVASCRIPT_GEN)
f81d51d1
JB
138-$(OUT)/pdf/pdf-object.o : source/pdf/pdf-name-table.h
139-$(OUT)/cmapdump.o : include/mupdf/pdf/cmap.h source/pdf/pdf-cmap.c source/pdf/pdf-cmap-parse.c source/pdf/pdf-name-table.h
f735ca81 140+$(OUT)/pdf/pdf-cmap-table.lo : $(CMAP_GEN)
f735ca81
JB
141+$(OUT)/pdf/pdf-pkcs7.lo : $(ADOBECA_GEN)
142+$(OUT)/pdf/js/pdf-js.lo : $(JAVASCRIPT_GEN)
f81d51d1
JB
143+$(OUT)/pdf/pdf-object.lo : source/pdf/pdf-name-table.h
144+$(OUT)/cmapdump.lo : include/mupdf/pdf/cmap.h source/pdf/pdf-cmap.c source/pdf/pdf-cmap-parse.c source/pdf/pdf-name-table.h
f735ca81
JB
145
146 # --- Tools and Apps ---
f735ca81 147
edbf3040
JB
148 MUTOOL := $(addprefix $(OUT)/, mutool)
149 MUTOOL_OBJ := $(addprefix $(OUT)/tools/, mutool.o mudraw.o murun.o pdfclean.o pdfcreate.o pdfextract.o pdfinfo.o pdfposter.o pdfshow.o pdfpages.o pdfmerge.o)
6d5cd20c 150 $(MUTOOL_OBJ): $(FITZ_HDR) $(PDF_HDR)
edbf3040
JB
151-$(MUTOOL) : $(MUPDF_LIB) $(THIRD_LIB)
152+$(MUTOOL) : $(MUPDF_LIB)
6d5cd20c 153 $(MUTOOL) : $(MUTOOL_OBJ)
f735ca81
JB
154- $(LINK_CMD)
155+ $(LTLINK_CMD)
156
6d5cd20c 157 MJSGEN := $(OUT)/mjsgen
edbf3040
JB
158-$(MJSGEN) : $(MUPDF_LIB) $(THIRD_LIB)
159+$(MJSGEN) : $(MUPDF_LIB)
6d5cd20c
JB
160 $(MJSGEN) : $(addprefix $(OUT)/tools/, mjsgen.o)
161- $(LINK_CMD)
162+ $(LTLINK_CMD)
f735ca81 163
6d5cd20c 164 MUJSTEST := $(OUT)/mujstest
f81d51d1
JB
165 MUJSTEST_OBJ := $(addprefix $(OUT)/platform/x11/, jstest_main.o pdfapp.o)
166 $(MUJSTEST_OBJ) : $(FITZ_HDR) $(PDF_HDR)
edbf3040
JB
167-$(MUJSTEST) : $(MUPDF_LIB) $(THIRD_LIB)
168+$(MUJSTEST) : $(MUPDF_LIB)
f81d51d1 169 $(MUJSTEST) : $(MUJSTEST_OBJ)
6d5cd20c
JB
170- $(LINK_CMD)
171+ $(LTLINK_CMD)
172
173 ifeq "$(HAVE_X11)" "yes"
f735ca81 174 MUVIEW_X11 := $(OUT)/mupdf-x11
edbf3040 175 MUVIEW_X11_OBJ := $(addprefix $(OUT)/platform/x11/, x11_main.o x11_image.o pdfapp.o)
6d5cd20c 176 $(MUVIEW_X11_OBJ) : $(FITZ_HDR) $(PDF_HDR)
edbf3040
JB
177-$(MUVIEW_X11) : $(MUPDF_LIB) $(THIRD_LIB)
178+$(MUVIEW_X11) : $(MUPDF_LIB)
6d5cd20c 179 $(MUVIEW_X11) : $(MUVIEW_X11_OBJ)
f735ca81
JB
180- $(LINK_CMD) $(X11_LIBS)
181+ $(LTLINK_CMD) $(X11_LIBS)
182
f81d51d1
JB
183 ifeq "$(HAVE_GLFW)" "yes"
184 MUVIEW_GLFW := $(OUT)/mupdf-gl
edbf3040 185 MUVIEW_GLFW_OBJ := $(addprefix $(OUT)/platform/gl/, gl-font.o gl-input.o gl-main.o)
f81d51d1 186 $(MUVIEW_GLFW_OBJ) : $(FITZ_HDR) $(PDF_HDR) platform/gl/gl-app.h
edbf3040
JB
187-$(MUVIEW_GLFW) : $(MUPDF_LIB) $(THIRD_LIB) $(GLFW_LIB)
188+$(MUVIEW_GLFW) : $(MUPDF_LIB) $(GLFW_LIB)
f81d51d1
JB
189 $(MUVIEW_GLFW) : $(MUVIEW_GLFW_OBJ)
190- $(LINK_CMD) $(GLFW_LIBS)
191+ $(LTLINK_CMD) $(GLFW_LIBS)
192 endif
193
6d5cd20c 194 ifeq "$(HAVE_CURL)" "yes"
edbf3040
JB
195 MUVIEW_X11_CURL := $(OUT)/mupdf-x11-curl
196 MUVIEW_X11_CURL_OBJ := $(addprefix $(OUT)/platform/x11/curl/, x11_main.o x11_image.o pdfapp.o curl_stream.o)
6d5cd20c 197 $(MUVIEW_X11_CURL_OBJ) : $(FITZ_HDR) $(PDF_HDR)
edbf3040
JB
198-$(MUVIEW_X11_CURL) : $(MUPDF_LIB) $(THIRD_LIB) $(CURL_LIB)
199+$(MUVIEW_X11_CURL) : $(MUPDF_LIB) $(CURL_LIB)
6d5cd20c
JB
200 $(MUVIEW_X11_CURL) : $(MUVIEW_X11_CURL_OBJ)
201- $(LINK_CMD) $(X11_LIBS) $(CURL_LIBS) $(SYS_CURL_DEPS)
202+ $(LTLINK_CMD) $(X11_LIBS) $(CURL_LIBS) $(SYS_CURL_DEPS)
f735ca81
JB
203 endif
204 endif
205
edbf3040
JB
206@@ -298,9 +306,9 @@
207 MUVIEW_WIN32 := $(OUT)/mupdf
208 MUVIEW_WIN32_OBJ := $(addprefix $(OUT)/platform/x11/, win_main.o pdfapp.o win_res.o)
f81d51d1 209 $(MUVIEW_WIN32_OBJ) : $(FITZ_HDR) $(PDF_HDR)
edbf3040
JB
210-$(MUVIEW_WIN32) : $(MUPDF_LIB) $(THIRD_LIB)
211+$(MUVIEW_WIN32) : $(MUPDF_LIB)
f81d51d1
JB
212 $(MUVIEW_WIN32) : $(MUVIEW_WIN32_OBJ)
213- $(LINK_CMD) $(WIN32_LIBS)
214+ $(LTLINK_CMD) $(WIN32_LIBS)
215 endif
216
217 MUVIEW := $(MUVIEW_X11) $(MUVIEW_WIN32) $(MUVIEW_GLFW)
edbf3040
JB
218@@ -312,10 +320,10 @@
219
f81d51d1
JB
220 examples: $(OUT)/example $(OUT)/multi-threaded
221
edbf3040 222-$(OUT)/example: docs/example.c $(MUPDF_LIB) $(THIRD_LIB)
f81d51d1 223- $(LINK_CMD) $(CFLAGS)
edbf3040 224-$(OUT)/multi-threaded: docs/multi-threaded.c $(MUPDF_LIB) $(THIRD_LIB)
f81d51d1 225- $(LINK_CMD) $(CFLAGS) -lpthread
edbf3040
JB
226+$(OUT)/example: docs/example.c $(MUPDF_LIB)
227+ $(LTLINK_CMD) $(CFLAGS)
228+$(OUT)/multi-threaded: docs/multi-threaded.c $(MUPDF_LIB)
f81d51d1
JB
229+ $(LTLINK_CMD) $(CFLAGS) -lpthread
230
231 # --- Update version string header ---
232
edbf3040
JB
233@@ -343,7 +351,6 @@
234 mandir ?= $(prefix)/share/man
235 docdir ?= $(prefix)/share/doc/mupdf
236
237-third: $(THIRD_LIB)
238 extra: $(CURL_LIB) $(GLFW_LIB)
239 libs: $(INSTALL_LIBS)
240 apps: $(INSTALL_APPS)
241@@ -357,10 +364,10 @@
f735ca81
JB
242 install include/mupdf/pdf/*.h $(DESTDIR)$(incdir)/mupdf/pdf
243
244 install -d $(DESTDIR)$(libdir)
245- install $(INSTALL_LIBS) $(DESTDIR)$(libdir)
246+ libtool --mode=install install $(INSTALL_LIBS) $(DESTDIR)$(libdir)
247
248 install -d $(DESTDIR)$(bindir)
249- install $(INSTALL_APPS) $(DESTDIR)$(bindir)
250+ libtool --mode=install install $(INSTALL_APPS) $(DESTDIR)$(bindir)
251
252 install -d $(DESTDIR)$(mandir)/man1
253 install docs/man/*.1 $(DESTDIR)$(mandir)/man1
This page took 0.17335 seconds and 4 git commands to generate.