summaryrefslogtreecommitdiff
path: root/Makethird
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2012-08-20 13:53:39 +0200
committerRobin Watts <robin.watts@artifex.com>2012-09-26 15:19:08 +0100
commit3bfa49bca3fbfa941d27e9da24821c0809a73c8f (patch)
treeb887aa64fc281a1eede17fc2f84992501da9109d /Makethird
parenta84a97ce22bfb081b014259af9d0596882287a5c (diff)
downloadmupdf-3bfa49bca3fbfa941d27e9da24821c0809a73c8f.tar.xz
Add thirdparty libraries as git submodules.
jbig2dec latest freetype 2.4.10 jpeg 9 openjpeg 1.5.0 zlib 1.2.7 Update MSVC projects for thirdparty libraries as submodules. Improve thirdparty library availability checks in Makethird by checking for the existence of a README file instead of just the directory, since a checkout without active git submodules has empty directories for the third party libraries.
Diffstat (limited to 'Makethird')
-rw-r--r--Makethird38
1 files changed, 22 insertions, 16 deletions
diff --git a/Makethird b/Makethird
index 1564950f..5745763c 100644
--- a/Makethird
+++ b/Makethird
@@ -1,17 +1,23 @@
# GNU Makefile for third party libraries used by MuPDF
#
# If thirdparty libraries are supplied, they will be built as
-# static libraries. Download and unzip the the mupdf-thirdparty.zip
-# archive in the source directory.
-
-FREETYPE_DIR := $(wildcard thirdparty/freetype*)
-JBIG2DEC_DIR := $(wildcard thirdparty/jbig2dec*)
-JPEG_DIR := $(wildcard thirdparty/jpeg*)
-OPENJPEG_DIR := $(wildcard thirdparty/openjpeg*/libopenjpeg)
-ZLIB_DIR := $(wildcard thirdparty/zlib*)
-V8_DIR := $(wildcard thirdparty/v8*)
+# static libraries.
+#
+# Use 'git submodule init' and 'git submodule update' to check
+# out the thirdparty libraries from git.
+
+FREETYPE_DIR := thirdparty/freetype
+JBIG2DEC_DIR := thirdparty/jbig2dec
+JPEG_DIR := thirdparty/jpeg
+OPENJPEG_DIR := thirdparty/openjpeg
+ZLIB_DIR := thirdparty/zlib
# --- V8 ---
+#
+# V8 is too big to be used as a submodule.
+#
+
+V8_DIR := $(wildcard thirdparty/v8*)
ifneq "$(V8_DIR)" ""
@@ -41,7 +47,7 @@ endif
# --- FreeType 2 ---
-ifneq "$(FREETYPE_DIR)" ""
+ifneq "$(wildcard $(FREETYPE_DIR)/README)" ""
CFLAGS += -I$(FREETYPE_DIR)/include
LIBS := $(filter-out -lfreetype, $(LIBS))
FREETYPE_LIB := $(OUT)/libfreetype.a
@@ -104,7 +110,7 @@ endif
# --- JBIG2DEC ---
-ifneq "$(JBIG2DEC_DIR)" ""
+ifneq "$(wildcard $(JBIG2DEC_DIR)/README)" ""
CFLAGS += -I$(JBIG2DEC_DIR)
LIBS := $(filter-out -ljbig2dec, $(LIBS))
JBIG2DEC_LIB := $(OUT)/libjbig2dec.a
@@ -133,7 +139,7 @@ endif
# --- JPEG library from IJG ---
-ifneq "$(JPEG_DIR)" ""
+ifneq "$(wildcard $(JPEG_DIR)/README)" ""
CFLAGS += -I$(JPEG_DIR)
LIBS := $(filter-out -ljpeg, $(LIBS))
JPEG_LIB := $(OUT)/libjpeg.a
@@ -178,8 +184,8 @@ endif
# --- OpenJPEG ---
-ifneq "$(OPENJPEG_DIR)" ""
-CFLAGS += -I$(OPENJPEG_DIR)
+ifneq "$(wildcard $(OPENJPEG_DIR)/README)" ""
+CFLAGS += -I$(OPENJPEG_DIR)/libopenjpeg
LIBS := $(filter-out -lopenjpeg, $(LIBS))
OPENJPEG_LIB := $(OUT)/libopenjpeg.a
@@ -209,13 +215,13 @@ OPENJPEG_SRC := \
tpix_manager.c \
$(OPENJPEG_LIB): $(addprefix $(OUT)/opj_, $(OPENJPEG_SRC:%.c=%.o))
-$(OUT)/opj_%.o: $(OPENJPEG_DIR)/%.c | $(OUT)
+$(OUT)/opj_%.o: $(OPENJPEG_DIR)/libopenjpeg/%.c | $(OUT)
$(CC_CMD) -DOPJ_STATIC
endif
# --- ZLIB ---
-ifneq "$(ZLIB_DIR)" ""
+ifneq "$(wildcard $(ZLIB_DIR)/README)" ""
CFLAGS += -I$(ZLIB_DIR) -Dverbose=-1
LIBS := $(filter-out -lz, $(LIBS))
ZLIB_LIB := $(OUT)/libz.a