summaryrefslogtreecommitdiff
path: root/Makerules
diff options
context:
space:
mode:
authorTor Andersson <tor@ghostscript.com>2010-06-01 20:32:20 +0200
committerTor Andersson <tor@ghostscript.com>2010-06-01 20:32:20 +0200
commitf9cca956331e9b97f96db9ee116a2d00b8505f58 (patch)
tree1dad241b289dc19cd749e26c2fcaedc1b74c2a8b /Makerules
parent0bd3ede89e302ecdb1718a533ceae60fa62bbaee (diff)
downloadmupdf-f9cca956331e9b97f96db9ee116a2d00b8505f58.tar.xz
Add support for automatically compiling third party libraries if they are present in a thirdparty directory.
Diffstat (limited to 'Makerules')
-rw-r--r--Makerules14
1 files changed, 9 insertions, 5 deletions
diff --git a/Makerules b/Makerules
index e9273e7a..a4411763 100644
--- a/Makerules
+++ b/Makerules
@@ -3,8 +3,8 @@
OS := $(shell uname)
OS := $(OS:MINGW%=MINGW)
-LIBS := -ljbig2dec -lopenjpeg -lfreetype -ljpeg -lz -lm
-CFLAGS := -Wall --std=gnu99 -Ifitz -Imupdf
+LIBS := -ljbig2dec -lopenjpeg -ljpeg -lz -lm
+CFLAGS := -Wall --std=gnu99 -Ifitz -Imupdf $(THIRD_INCS)
LDFLAGS =
CC = cc
LD = $(CC)
@@ -19,8 +19,10 @@ CFLAGS += -O3
endif
ifeq "$(OS)" "Linux"
+ifeq "$(freetype_dir)" ""
CFLAGS += `pkg-config --cflags freetype2`
LDFLAGS += `pkg-config --libs freetype2`
+endif
X11LIBS = -lX11 -lXext
PDFVIEW_EXE = $(X11VIEW_EXE)
ifeq "$(build)" "release"
@@ -30,8 +32,11 @@ endif
endif
ifeq "$(OS)" "Darwin"
-CFLAGS += -I$(HOME)/include -I/usr/X11R6/include -I/usr/X11R6/include/freetype2
+CFLAGS += -I$(HOME)/include -I/usr/X11R6/include
LDFLAGS += -L$(HOME)/lib -L/usr/X11R6/lib
+ifeq "$(freetype_dir)" ""
+CFLAGS += -I/usr/X11R6/include/freetype2
+endif
X11LIBS = -lX11 -lXext
PDFVIEW_EXE = $(X11VIEW_EXE)
ifeq "$(build)" "release"
@@ -40,10 +45,9 @@ ARCH_SRC = archx86.c
endif
endif
+# MinGW build depends on thirdparty
ifeq "$(OS)" "MINGW"
CC = gcc
-CFLAGS += -Ic:/msys/1.0/local/include
-LDFLAGS += -Lc:/msys/1.0/local/lib
W32LIBS = -lgdi32 -lcomdlg32 -luser32 -ladvapi32 -lshell32 -mwindows
PDFVIEW_EXE = $(WINVIEW_EXE)
endif