]> git.pld-linux.org Git - packages/mupdf.git/blame - mupdf-shared.patch
- added shared patch, build shared libraries
[packages/mupdf.git] / mupdf-shared.patch
CommitLineData
f735ca81
JB
1--- mupdf-1.3-source/Makefile.orig 2013-08-14 14:41:20.000000000 +0200
2+++ mupdf-1.3-source/Makefile 2013-11-02 09:52:33.336720500 +0100
3@@ -44,17 +44,24 @@
4 ifeq "$(verbose)" ""
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
28@@ -86,35 +93,37 @@
29 CBZ_SRC_HDR := $(wildcard source/cbz/*.h)
30 IMG_SRC_HDR := $(wildcard source/img/*.h)
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))))
36-IMG_OBJ := $(subst source/, $(OUT)/, $(addsuffix .o, $(basename $(IMG_SRC))))
37-
38-PDF_JS_V8_OBJ := $(OUT)/pdf/js/pdf-js.o $(OUT)/pdf/js/pdf-jsimp-cpp.o $(OUT)/pdf/js/pdf-jsimp-v8.o
39-PDF_JS_NONE_OBJ := $(OUT)/pdf/js/pdf-js-none.o
40-
41-$(FITZ_OBJ) : $(FITZ_HDR) $(FITZ_SRC_HDR)
42-$(PDF_OBJ) : $(FITZ_HDR) $(PDF_HDR) $(PDF_SRC_HDR)
43-$(XPS_OBJ) : $(FITZ_HDR) $(XPS_HDR) $(XPS_SRC_HDR)
44-$(CBZ_OBJ) : $(FITZ_HDR) $(CBZ_HDR) $(CBZ_SRC_HDR)
45-$(IMG_OBJ) : $(FITZ_HDR) $(IMG_HDR) $(IMG_SRC_HDR)
46+FITZ_LOBJ := $(subst source/, $(OUT)/, $(addsuffix .lo, $(basename $(FITZ_SRC))))
47+PDF_LOBJ := $(subst source/, $(OUT)/, $(addsuffix .lo, $(basename $(PDF_SRC))))
48+XPS_LOBJ := $(subst source/, $(OUT)/, $(addsuffix .lo, $(basename $(XPS_SRC))))
49+CBZ_LOBJ := $(subst source/, $(OUT)/, $(addsuffix .lo, $(basename $(CBZ_SRC))))
50+IMG_LOBJ := $(subst source/, $(OUT)/, $(addsuffix .lo, $(basename $(IMG_SRC))))
51+
52+PDF_JS_V8_LOBJ := $(OUT)/pdf/js/pdf-js.lo $(OUT)/pdf/js/pdf-jsimp-cpp.lo $(OUT)/pdf/js/pdf-jsimp-v8.lo
53+PDF_JS_NONE_LOBJ := $(OUT)/pdf/js/pdf-js-none.lo
54+
55+$(FITZ_LOBJ) : $(FITZ_HDR) $(FITZ_SRC_HDR)
56+$(PDF_LOBJ) : $(FITZ_HDR) $(PDF_HDR) $(PDF_SRC_HDR)
57+$(XPS_LOBJ) : $(FITZ_HDR) $(XPS_HDR) $(XPS_SRC_HDR)
58+$(CBZ_LOBJ) : $(FITZ_HDR) $(CBZ_HDR) $(CBZ_SRC_HDR)
59+$(IMG_LOBJ) : $(FITZ_HDR) $(IMG_HDR) $(IMG_SRC_HDR)
60
61-$(PDF_JS_V8_OBJ) : $(FITZ_HDR) $(PDF_HDR) $(PDF_SRC_HDR)
62-$(PDF_JS_NONE_OBJ) := $(FITZ_HDR) $(PDF_HDR) $(PDF_SRC_HDR)
63+$(PDF_JS_V8_LOBJ) : $(FITZ_HDR) $(PDF_HDR) $(PDF_SRC_HDR)
64+$(PDF_JS_NONE_LOBJ) := $(FITZ_HDR) $(PDF_HDR) $(PDF_SRC_HDR)
65
66 # --- Library ---
67
68-MUPDF_LIB := $(OUT)/libmupdf.a
69-MUPDF_JS_NONE_LIB := $(OUT)/libmupdf-js-none.a
70+MUPDF_LIB := $(OUT)/libmupdf.la
71+MUPDF_JS_NONE_LIB := $(OUT)/libmupdf-js-none.la
72
73-$(MUPDF_LIB) : $(FITZ_OBJ) $(PDF_OBJ) $(XPS_OBJ) $(CBZ_OBJ) $(IMG_OBJ)
74-$(MUPDF_JS_NONE_LIB) : $(PDF_JS_NONE_OBJ)
75+$(MUPDF_LIB) : $(FITZ_LOBJ) $(PDF_LOBJ) $(XPS_LOBJ) $(CBZ_LOBJ) $(IMG_LOBJ)
76+$(MUPDF_JS_NONE_LIB) : $(PDF_JS_NONE_LOBJ) $(MUPDF_LIB)
77
78 ifeq "$(V8_PRESENT)" "yes"
79-MUPDF_JS_V8_LIB := $(OUT)/libmupdf-js-v8.a
80-$(MUPDF_JS_V8_LIB) : $(PDF_JS_V8_OBJ)
81+MUPDF_JS_V8_LIB := $(OUT)/libmupdf-js-v8.la
82+$(MUPDF_JS_V8_LIB) : $(PDF_JS_V8_LOBJ) $(MUPDF_LIB)
83+$(MUPDF_JS_V8_LIB) :: LDLIBS += -lv8
84+$(MUPDF_JS_V8_LIB) :: LTLINK_CMD = $(LTLINKCXX_CMD)
85 endif
86
87 INSTALL_LIBS := $(MUPDF_LIB) $(MUPDF_JS_NONE_LIB) $(MUPDF_JS_V8_LIB)
88@@ -124,10 +131,8 @@
89 $(ALL_DIR) $(OUT) $(GEN) :
90 $(MKDIR_CMD)
91
92-$(OUT)/%.a :
93- $(RM_CMD)
94- $(AR_CMD)
95- $(RANLIB_CMD)
96+$(OUT)/%.la :
97+ $(LTLINK_CMD) -rpath $(libdir) $(LDLIBS)
98
99 $(OUT)/%: $(OUT)/%.o
100 $(LINK_CMD)
101@@ -138,6 +142,12 @@
102 $(OUT)/%.o : source/%.cpp | $(ALL_DIR)
103 $(CXX_CMD)
104
105+$(OUT)/%.lo : source/%.c | $(ALL_DIR)
106+ $(LTCC_CMD)
107+
108+$(OUT)/%.lo : source/%.cpp | $(ALL_DIR)
109+ $(LTCXX_CMD)
110+
111 $(OUT)/%.o : scripts/%.c | $(OUT)
112 $(CC_CMD)
113
114@@ -208,10 +219,10 @@
115
116 generate: $(CMAP_GEN) $(FONT_GEN) $(JAVASCRIPT_GEN) $(ADOBECA_GEN)
117
118-$(OUT)/pdf/pdf-cmap-table.o : $(CMAP_GEN)
119-$(OUT)/pdf/pdf-fontfile.o : $(FONT_GEN)
120-$(OUT)/pdf/pdf-pkcs7.o : $(ADOBECA_GEN)
121-$(OUT)/pdf/js/pdf-js.o : $(JAVASCRIPT_GEN)
122+$(OUT)/pdf/pdf-cmap-table.lo : $(CMAP_GEN)
123+$(OUT)/pdf/pdf-fontfile.lo : $(FONT_GEN)
124+$(OUT)/pdf/pdf-pkcs7.lo : $(ADOBECA_GEN)
125+$(OUT)/pdf/js/pdf-js.lo : $(JAVASCRIPT_GEN)
126 $(OUT)/cmapdump.o : source/pdf/pdf-cmap.c source/pdf/pdf-cmap-parse.c
127
128 # --- Tools and Apps ---
129@@ -219,31 +230,31 @@
130 MUDRAW := $(addprefix $(OUT)/, mudraw)
131 $(MUDRAW) : $(MUPDF_LIB) $(MUPDF_JS_NONE_LIB) $(THIRD_LIBS)
132 $(MUDRAW) : $(addprefix $(OUT)/tools/, mudraw.o)
133- $(LINK_CMD)
134+ $(LTLINK_CMD)
135
136 MUTOOL := $(addprefix $(OUT)/, mutool)
137 $(MUTOOL) : $(MUPDF_LIB) $(MUPDF_JS_NONE_LIB) $(THIRD_LIBS)
138 $(MUTOOL) : $(addprefix $(OUT)/tools/, mutool.o pdfclean.o pdfextract.o pdfinfo.o pdfposter.o pdfshow.o)
139- $(LINK_CMD)
140+ $(LTLINK_CMD)
141
142 ifeq "$(V8_PRESENT)" "yes"
143 MUJSTEST_V8 := $(OUT)/mujstest-v8
144 $(MUJSTEST_V8) : $(MUPDF_LIB) $(MUPDF_JS_V8_LIB) $(THIRD_LIBS)
145 $(MUJSTEST_V8) : $(addprefix $(OUT)/platform/x11/, jstest_main.o pdfapp.o)
146- $(LINK_CMD) $(V8_LIBS)
147+ $(LTLINK_CMD) $(V8_LIBS)
148 endif
149
150 ifeq "$(NOX11)" ""
151 MUVIEW_X11 := $(OUT)/mupdf-x11
152 $(MUVIEW_X11) : $(MUPDF_LIB) $(MUPDF_JS_NONE_LIB) $(THIRD_LIBS)
153 $(MUVIEW_X11) : $(addprefix $(OUT)/platform/x11/, x11_main.o x11_image.o pdfapp.o)
154- $(LINK_CMD) $(X11_LIBS)
155+ $(LTLINK_CMD) $(X11_LIBS)
156
157 ifeq "$(NOCURL)" ""
158 MUVIEW_X11_CURL := $(OUT)/mupdf-x11-curl
159 $(MUVIEW_X11_CURL) : $(MUPDF_LIB) $(MUPDF_JS_NONE_LIB) $(THIRD_LIBS) $(CURL_LIB)
160 $(MUVIEW_X11_CURL) : $(addprefix $(OUT)/platform/x11/curl/, x11_main.o x11_image.o pdfapp.o curl_stream.o)
161- $(LINK_CMD) $(X11_LIBS) $(CURL_LIBS)
162+ $(LTLINK_CMD) $(X11_LIBS) $(CURL_LIBS)
163 endif
164 endif
165
166@@ -252,7 +263,7 @@
167 MUVIEW_X11_V8 := $(OUT)/mupdf-x11-v8
168 $(MUVIEW_X11_V8) : $(MUPDF_LIB) $(MUPDF_JS_V8_LIB) $(THIRD_LIBS)
169 $(MUVIEW_X11_V8) : $(addprefix $(OUT)/platform/x11/, x11_main.o x11_image.o pdfapp.o)
170- $(LINK_CMD) $(X11_LIBS) $(V8_LIBS)
171+ $(LTLINK_CMD) $(X11_LIBS) $(V8_LIBS)
172 endif
173 endif
174
175@@ -294,10 +305,10 @@
176 install include/mupdf/pdf/*.h $(DESTDIR)$(incdir)/mupdf/pdf
177
178 install -d $(DESTDIR)$(libdir)
179- install $(INSTALL_LIBS) $(DESTDIR)$(libdir)
180+ libtool --mode=install install $(INSTALL_LIBS) $(DESTDIR)$(libdir)
181
182 install -d $(DESTDIR)$(bindir)
183- install $(INSTALL_APPS) $(DESTDIR)$(bindir)
184+ libtool --mode=install install $(INSTALL_APPS) $(DESTDIR)$(bindir)
185
186 install -d $(DESTDIR)$(mandir)/man1
187 install docs/man/*.1 $(DESTDIR)$(mandir)/man1
This page took 0.107803 seconds and 4 git commands to generate.