Use pkg-config for a system libjpeg if available: libjpeg-turbo has it

Bug: https://github.com/ioquake/ioq3/pull/116
This commit is contained in:
Simon McVittie 2015-03-15 12:34:51 +00:00
parent 40cfbc9a82
commit 0fc86e9632

View file

@ -1074,11 +1074,10 @@ ifeq ($(USE_INTERNAL_JPEG),1)
BASE_CFLAGS += -DUSE_INTERNAL_JPEG BASE_CFLAGS += -DUSE_INTERNAL_JPEG
BASE_CFLAGS += -I$(JPDIR) BASE_CFLAGS += -I$(JPDIR)
else else
# libjpeg doesn't have pkg-config yet, but let users override with # IJG libjpeg doesn't have pkg-config, but libjpeg-turbo uses libjpeg.pc;
# "make JPEG_CFLAGS=-I/opt/jpeg/include JPEG_LIBS='-L/opt/jpeg/lib -ljpeg'" # we fall back to hard-coded answers if libjpeg.pc is unavailable
# if they need to JPEG_CFLAGS ?= $(shell pkg-config --silence-errors --cflags libjpeg || true)
JPEG_CFLAGS ?= JPEG_LIBS ?= $(shell pkg-config --silence-errors --libs libjpeg || echo -ljpeg)
JPEG_LIBS ?= -ljpeg
BASE_CFLAGS += $(JPEG_CFLAGS) BASE_CFLAGS += $(JPEG_CFLAGS)
RENDERER_LIBS += $(JPEG_LIBS) RENDERER_LIBS += $(JPEG_LIBS)
endif endif