diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2013-04-22 15:48:36 +0200 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2013-04-23 12:00:52 +0100 |
commit | ec3c3c846820c0be29f107e731dc2f7616d1fb6c (patch) | |
tree | 3440e0e7ed2d6612db304965cb93773e2983d6b2 | |
parent | 2ea11eace69fe5a2d88f374a253a3deb05804f2d (diff) | |
download | mupdf-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.
-rw-r--r-- | Makerules | 34 | ||||
-rw-r--r-- | Makethird | 15 |
2 files changed, 24 insertions, 25 deletions
@@ -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 @@ -105,7 +105,8 @@ $(OUT)/ft_%.o: $(FREETYPE_DIR)/src/type1/%.c | $(OUT) $(CC_CMD) $(FT_CFLAGS) else -CFLAGS += $(SYS_FREETYPE_INC) +SYS_FREETYPE_CFLAGS := $(SYS_FREETYPE_CFLAGS) +CFLAGS += $(SYS_FREETYPE_CFLAGS) endif # --- JBIG2DEC --- @@ -218,7 +219,8 @@ $(OPENJPEG_LIB): $(addprefix $(OUT)/opj_, $(OPENJPEG_SRC:%.c=%.o)) $(OUT)/opj_%.o: $(OPENJPEG_DIR)/libopenjpeg/%.c | $(OUT) $(CC_CMD) -DOPJ_STATIC else -CFLAGS += $(SYS_OPENJPEG_INC) +SYS_OPENJPEG_CFLAGS := $(SYS_OPENJPEG_CFLAGS) +CFLAGS += $(SYS_OPENJPEG_CFLAGS) endif # --- ZLIB --- @@ -244,3 +246,12 @@ $(ZLIB_LIB): $(addprefix $(OUT)/zlib_, $(ZLIB_SRC:%.c=%.o)) $(OUT)/zlib_%.o: $(ZLIB_DIR)/%.c | $(OUT) $(CC_CMD) endif + +# --- X11 --- + +ifeq "$(NOX11)" "" +SYS_X11_CFLAGS := $(SYS_X11_CFLAGS) +SYS_X11_LIBS := $(SYS_X11_LIBS) +CFLAGS += $(SYS_X11_CFLAGS) +LIBS += $(SYS_X11_LIBS) +endif |