diff options
author | Simon McVittie <smcv@debian.org> | 2015-03-15 12:34:51 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2015-06-07 12:03:35 +0100 |
commit | a0677adf5b216c27436b6e2ac4653b49944c9a1e (patch) | |
tree | 0193d670df8cf44c0b4e5c46f8b01d4d1a04ee41 | |
parent | 1ba4af154e471e3e00890bf034fc8dde410d951e (diff) |
Use pkg-config for a system libjpeg if available: libjpeg-turbo has it
Bug: https://github.com/ioquake/ioq3/pull/116
-rw-r--r-- | Makefile | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -1045,11 +1045,10 @@ ifeq ($(USE_INTERNAL_JPEG),1) BASE_CFLAGS += -DUSE_INTERNAL_JPEG BASE_CFLAGS += -I$(JPDIR) else - # libjpeg doesn't have pkg-config yet, but let users override with - # "make JPEG_CFLAGS=-I/opt/jpeg/include JPEG_LIBS='-L/opt/jpeg/lib -ljpeg'" - # if they need to - JPEG_CFLAGS ?= - JPEG_LIBS ?= -ljpeg + # IJG libjpeg doesn't have pkg-config, but libjpeg-turbo uses libjpeg.pc; + # we fall back to hard-coded answers if libjpeg.pc is unavailable + JPEG_CFLAGS ?= $(shell pkg-config --silence-errors --cflags libjpeg || true) + JPEG_LIBS ?= $(shell pkg-config --silence-errors --libs libjpeg || echo -ljpeg) BASE_CFLAGS += $(JPEG_CFLAGS) RENDERER_LIBS += $(JPEG_LIBS) endif |