summaryrefslogtreecommitdiff
path: root/Makerules
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2013-04-22 15:48:36 +0200
committerRobin Watts <robin.watts@artifex.com>2013-04-23 12:00:52 +0100
commitec3c3c846820c0be29f107e731dc2f7616d1fb6c (patch)
tree3440e0e7ed2d6612db304965cb93773e2983d6b2 /Makerules
parent2ea11eace69fe5a2d88f374a253a3deb05804f2d (diff)
downloadmupdf-ec3c3c846820c0be29f107e731dc2f7616d1fb6c.tar.xz
Fix pkg-config issues.
Only evaluate pkg-config variables if using system libraries, using a := assignment in Makethird. This silences warnings if the library is in thirdparty but not installed on the system.
Diffstat (limited to 'Makerules')
-rw-r--r--Makerules34
1 files changed, 11 insertions, 23 deletions
diff --git a/Makerules b/Makerules
index 106957d3..7f4dcefb 100644
--- a/Makerules
+++ b/Makerules
@@ -23,31 +23,19 @@ else
$(error unknown build setting: '$(build)')
endif
-ifeq "$(OS)" "Linux"
-SYS_FREETYPE_INC := $(shell pkg-config --cflags freetype2)
-SYS_OPENJPEG_INC := $(shell pkg-config --cflags libopenjpeg)
-X11_LIBS := $(shell pkg-config --libs x11 xext)
-endif
-
-ifeq "$(OS)" "FreeBSD"
-SYS_FREETYPE_INC := $(shell pkg-config --cflags freetype2)
-LDFLAGS += -L/usr/local/lib
-X11_LIBS := $(shell pkg-config --libs x11 xext)
-endif
-
-ifeq "$(OS)" "SunOS"
-SYS_FREETYPE_INC := $(shell pkg-config --cflags freetype2)
-LDFLAGS += -L/usr/local/lib
-X11_LIBS := $(shell pkg-config --libs x11 xext)
-endif
-
-# Mac OS X build depends on some thirdparty libs
+# Mac OS X doesn't have pkg-config so we hard code paths.
ifeq "$(OS)" "Darwin"
-SYS_FREETYPE_INC := -I/usr/X11R6/include/freetype2
-CFLAGS += -I/usr/X11R6/include
-LDFLAGS += -L/usr/X11R6/lib
+SYS_FREETYPE_CFLAGS = -I/usr/X11R6/include/freetype2
+SYS_X11_CFLAGS = -I/usr/X11R6/include
+SYS_X11_LIBS = -L/usr/X11R6/lib -lX11 -lXext
RANLIB_CMD = ranlib $@
-X11_LIBS := -lX11 -lXext
+
+# Other Unixes use pkg-config for system third party libs
+else
+SYS_FREETYPE_CFLAGS = $(shell pkg-config --cflags freetype2)
+SYS_OPENJPEG_CFLAGS = $(shell pkg-config --cflags libopenjpeg)
+SYS_X11_CFLAGS = $(shell pkg-config --cflags x11 xext)
+SYS_X11_LIBS = $(shell pkg-config --libs x11 xext)
endif
# The following section is an example of how to simply do cross-compilation