From ec3c3c846820c0be29f107e731dc2f7616d1fb6c Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Mon, 22 Apr 2013 15:48:36 +0200 Subject: 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. --- Makerules | 34 +++++++++++----------------------- 1 file changed, 11 insertions(+), 23 deletions(-) (limited to 'Makerules') 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 -- cgit v1.2.3