- updated to 1.6
[packages/mupdf.git] / mupdf-shared.patch
CommitLineData
6d5cd20c
JB
1--- mupdf-1.6-source/Makefile.orig 2014-09-30 13:25:12.000000000 +0200
2+++ mupdf-1.6-source/Makefile 2014-11-28 23:35:04.957817554 +0100
f735ca81 3@@ -44,17 +44,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
6d5cd20c 28@@ -90,47 +97,47 @@
f735ca81 29 IMG_SRC_HDR := $(wildcard source/img/*.h)
6d5cd20c 30 TIFF_SRC_HDR := $(wildcard source/tiff/*.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))))
36-IMG_OBJ := $(subst source/, $(OUT)/, $(addsuffix .o, $(basename $(IMG_SRC))))
6d5cd20c 37-TIFF_OBJ := $(subst source/, $(OUT)/, $(addsuffix .o, $(basename $(TIFF_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))))
42+IMG_LOBJ := $(subst source/, $(OUT)/, $(addsuffix .lo, $(basename $(IMG_SRC))))
6d5cd20c
JB
43+TIFF_LOBJ := $(subst source/, $(OUT)/, $(addsuffix .lo, $(basename $(TIFF_SRC))))
44
45 # --- Choice of Javascript library ---
46
47 ifeq "$(HAVE_MUJS)" "yes"
48-PDF_OBJ += $(OUT)/pdf/js/pdf-js.o
49-PDF_OBJ += $(OUT)/pdf/js/pdf-jsimp-mu.o
50+PDF_LOBJ += $(OUT)/pdf/js/pdf-js.lo
51+PDF_LOBJ += $(OUT)/pdf/js/pdf-jsimp-mu.lo
52 THIRD_LIBS += $(MUJS_LIB)
53 LIBS += $(MUJS_LIBS)
54 CFLAGS += $(MUJS_CFLAGS)
55 else ifeq "$(HAVE_JSCORE)" "yes"
56-PDF_OBJ += $(OUT)/pdf/js/pdf-js.o
57-PDF_OBJ += $(OUT)/pdf/js/pdf-jsimp-jscore.o
58+PDF_LOBJ += $(OUT)/pdf/js/pdf-js.lo
59+PDF_LOBJ += $(OUT)/pdf/js/pdf-jsimp-jscore.lo
60 LIBS += $(JSCORE_LIBS)
61 CFLAGS += $(JSCORE_CFLAGS)
62 else ifeq "$(HAVE_V8)" "yes"
63-PDF_OBJ += $(OUT)/pdf/js/pdf-js.o
64-PDF_OBJ += $(OUT)/pdf/js/pdf-jsimp-cpp.o $(OUT)/pdf/js/pdf-jsimp-v8.o
65+PDF_LOBJ += $(OUT)/pdf/js/pdf-js.lo
66+PDF_LOBJ += $(OUT)/pdf/js/pdf-jsimp-cpp.lo $(OUT)/pdf/js/pdf-jsimp-v8.lo
67 LIBS += $(V8_LIBS)
68 CFLAGS += $(V8_CFLAGS)
69 else
70-PDF_OBJ += $(OUT)/pdf/js/pdf-js-none.o
71+PDF_LOBJ += $(OUT)/pdf/js/pdf-js-none.lo
72 endif
73
74-$(FITZ_OBJ) : $(FITZ_HDR) $(FITZ_SRC_HDR)
75-$(PDF_OBJ) : $(FITZ_HDR) $(PDF_HDR) $(PDF_SRC_HDR)
76-$(XPS_OBJ) : $(FITZ_HDR) $(XPS_HDR) $(XPS_SRC_HDR)
77-$(CBZ_OBJ) : $(FITZ_HDR) $(CBZ_HDR) $(CBZ_SRC_HDR)
78-$(IMG_OBJ) : $(FITZ_HDR) $(IMG_HDR) $(IMG_SRC_HDR)
79-$(TIFF_OBJ) : $(FITZ_HDR) $(IMG_HDR) $(TIFF_SRC_HDR)
f735ca81
JB
80+$(FITZ_LOBJ) : $(FITZ_HDR) $(FITZ_SRC_HDR)
81+$(PDF_LOBJ) : $(FITZ_HDR) $(PDF_HDR) $(PDF_SRC_HDR)
82+$(XPS_LOBJ) : $(FITZ_HDR) $(XPS_HDR) $(XPS_SRC_HDR)
83+$(CBZ_LOBJ) : $(FITZ_HDR) $(CBZ_HDR) $(CBZ_SRC_HDR)
84+$(IMG_LOBJ) : $(FITZ_HDR) $(IMG_HDR) $(IMG_SRC_HDR)
6d5cd20c 85+$(TIFF_LOBJ) : $(FITZ_HDR) $(IMG_HDR) $(TIFF_SRC_HDR)
f735ca81
JB
86
87 # --- Library ---
88
89-MUPDF_LIB := $(OUT)/libmupdf.a
f735ca81 90+MUPDF_LIB := $(OUT)/libmupdf.la
f735ca81 91
6d5cd20c
JB
92-$(MUPDF_LIB) : $(FITZ_OBJ) $(PDF_OBJ) $(XPS_OBJ) $(CBZ_OBJ) $(IMG_OBJ) $(TIFF_OBJ)
93+$(MUPDF_LIB) : $(FITZ_LOBJ) $(PDF_LOBJ) $(XPS_LOBJ) $(CBZ_LOBJ) $(IMG_LOBJ) $(TIFF_LOBJ)
94
95 INSTALL_LIBS := $(MUPDF_LIB)
96
97@@ -139,10 +146,8 @@
f735ca81
JB
98 $(ALL_DIR) $(OUT) $(GEN) :
99 $(MKDIR_CMD)
100
101-$(OUT)/%.a :
102- $(RM_CMD)
103- $(AR_CMD)
104- $(RANLIB_CMD)
105+$(OUT)/%.la :
106+ $(LTLINK_CMD) -rpath $(libdir) $(LDLIBS)
107
108 $(OUT)/%: $(OUT)/%.o
109 $(LINK_CMD)
6d5cd20c 110@@ -153,6 +158,12 @@
f735ca81
JB
111 $(OUT)/%.o : source/%.cpp | $(ALL_DIR)
112 $(CXX_CMD)
113
114+$(OUT)/%.lo : source/%.c | $(ALL_DIR)
115+ $(LTCC_CMD)
116+
117+$(OUT)/%.lo : source/%.cpp | $(ALL_DIR)
118+ $(LTCXX_CMD)
119+
120 $(OUT)/%.o : scripts/%.c | $(OUT)
121 $(CC_CMD)
122
6d5cd20c 123@@ -222,10 +233,10 @@
f735ca81
JB
124
125 generate: $(CMAP_GEN) $(FONT_GEN) $(JAVASCRIPT_GEN) $(ADOBECA_GEN)
126
127-$(OUT)/pdf/pdf-cmap-table.o : $(CMAP_GEN)
128-$(OUT)/pdf/pdf-fontfile.o : $(FONT_GEN)
129-$(OUT)/pdf/pdf-pkcs7.o : $(ADOBECA_GEN)
130-$(OUT)/pdf/js/pdf-js.o : $(JAVASCRIPT_GEN)
131+$(OUT)/pdf/pdf-cmap-table.lo : $(CMAP_GEN)
132+$(OUT)/pdf/pdf-fontfile.lo : $(FONT_GEN)
133+$(OUT)/pdf/pdf-pkcs7.lo : $(ADOBECA_GEN)
134+$(OUT)/pdf/js/pdf-js.lo : $(JAVASCRIPT_GEN)
6d5cd20c 135 $(OUT)/cmapdump.o : include/mupdf/pdf/cmap.h source/pdf/pdf-cmap.c source/pdf/pdf-cmap-parse.c
f735ca81
JB
136
137 # --- Tools and Apps ---
6d5cd20c
JB
138@@ -235,24 +246,24 @@
139 $(MUDRAW_OBJ) : $(FITZ_HDR)
140 $(MUDRAW) : $(MUPDF_LIB) $(THIRD_LIBS)
141 $(MUDRAW) : $(MUDRAW_OBJ)
f735ca81
JB
142- $(LINK_CMD)
143+ $(LTLINK_CMD)
144
145 MUTOOL := $(addprefix $(OUT)/, mutool)
6d5cd20c
JB
146 MUTOOL_OBJ := $(addprefix $(OUT)/tools/, mutool.o pdfclean.o pdfextract.o pdfinfo.o pdfposter.o pdfshow.o)
147 $(MUTOOL_OBJ): $(FITZ_HDR) $(PDF_HDR)
148 $(MUTOOL) : $(MUPDF_LIB) $(THIRD_LIBS)
149 $(MUTOOL) : $(MUTOOL_OBJ)
f735ca81
JB
150- $(LINK_CMD)
151+ $(LTLINK_CMD)
152
6d5cd20c
JB
153 MJSGEN := $(OUT)/mjsgen
154 $(MJSGEN) : $(MUPDF_LIB) $(THIRD_LIBS)
155 $(MJSGEN) : $(addprefix $(OUT)/tools/, mjsgen.o)
156- $(LINK_CMD)
157+ $(LTLINK_CMD)
f735ca81 158
6d5cd20c
JB
159 MUJSTEST := $(OUT)/mujstest
160 $(MUJSTEST) : $(MUPDF_LIB) $(THIRD_LIBS)
161 $(MUJSTEST) : $(addprefix $(OUT)/platform/x11/, jstest_main.o pdfapp.o)
162- $(LINK_CMD)
163+ $(LTLINK_CMD)
164
165 ifeq "$(HAVE_X11)" "yes"
f735ca81 166 MUVIEW_X11 := $(OUT)/mupdf-x11
6d5cd20c
JB
167@@ -260,7 +271,7 @@
168 $(MUVIEW_X11_OBJ) : $(FITZ_HDR) $(PDF_HDR)
169 $(MUVIEW_X11) : $(MUPDF_LIB) $(THIRD_LIBS)
170 $(MUVIEW_X11) : $(MUVIEW_X11_OBJ)
f735ca81
JB
171- $(LINK_CMD) $(X11_LIBS)
172+ $(LTLINK_CMD) $(X11_LIBS)
173
6d5cd20c 174 ifeq "$(HAVE_CURL)" "yes"
f735ca81 175 MUVIEW_X11_CURL := $(OUT)/mupdf-x11-curl
6d5cd20c
JB
176@@ -268,7 +279,7 @@
177 $(MUVIEW_X11_CURL_OBJ) : $(FITZ_HDR) $(PDF_HDR)
178 $(MUVIEW_X11_CURL) : $(MUPDF_LIB) $(THIRD_LIBS) $(CURL_LIB)
179 $(MUVIEW_X11_CURL) : $(MUVIEW_X11_CURL_OBJ)
180- $(LINK_CMD) $(X11_LIBS) $(CURL_LIBS) $(SYS_CURL_DEPS)
181+ $(LTLINK_CMD) $(X11_LIBS) $(CURL_LIBS) $(SYS_CURL_DEPS)
f735ca81
JB
182 endif
183 endif
184
6d5cd20c 185@@ -316,10 +327,10 @@
f735ca81
JB
186 install include/mupdf/pdf/*.h $(DESTDIR)$(incdir)/mupdf/pdf
187
188 install -d $(DESTDIR)$(libdir)
189- install $(INSTALL_LIBS) $(DESTDIR)$(libdir)
190+ libtool --mode=install install $(INSTALL_LIBS) $(DESTDIR)$(libdir)
191
192 install -d $(DESTDIR)$(bindir)
193- install $(INSTALL_APPS) $(DESTDIR)$(bindir)
194+ libtool --mode=install install $(INSTALL_APPS) $(DESTDIR)$(bindir)
195
196 install -d $(DESTDIR)$(mandir)/man1
197 install docs/man/*.1 $(DESTDIR)$(mandir)/man1
This page took 0.117963 seconds and 4 git commands to generate.