From cd23d424b8e76bc1df24773b60d564839a41bf74 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Sun, 19 May 2013 21:02:31 +0100 Subject: Look for system Vorbis, Opus and Ogg via pkg-config As usual, the order of precedence is: user override, pkg-config, or assume they're in standard locations. In particular, Opus isn't in the default search path on Debian. --- Makefile | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 316c2019..092d1223 100644 --- a/Makefile +++ b/Makefile @@ -955,30 +955,37 @@ ifeq ($(USE_CURL),1) endif ifeq ($(USE_CODEC_VORBIS),1) - CLIENT_CFLAGS += -DUSE_CODEC_VORBIS + VORBIS_CFLAGS ?= $(shell pkg-config --silence-errors --cflags vorbisfile vorbis || true) + VORBIS_LIBS ?= $(shell pkg-config --silence-errors --libs vorbisfile vorbis || echo -lvorbisfile -lvorbis) + CLIENT_CFLAGS += -DUSE_CODEC_VORBIS $(VORBIS_CFLAGS) + CLIENT_LIBS += $(VORBIS_LIBS) NEED_OGG=1 endif ifeq ($(USE_CODEC_OPUS),1) CLIENT_CFLAGS += -DUSE_CODEC_OPUS ifeq ($(USE_INTERNAL_OPUS),1) - CLIENT_CFLAGS += -DOPUS_BUILD -DHAVE_LRINTF -DFLOATING_POINT -DUSE_ALLOCA \ + OPUS_CFLAGS = -DOPUS_BUILD -DHAVE_LRINTF -DFLOATING_POINT -DUSE_ALLOCA \ -I$(OPUSDIR)/include -I$(OPUSDIR)/celt -I$(OPUSDIR)/silk \ - -I$(OPUSDIR)/silk/float - - CLIENT_CFLAGS += -I$(OPUSFILEDIR)/include + -I$(OPUSDIR)/silk/float -I$(OPUSFILEDIR)/include else - CLIENT_LIBS += -lopusfile -lopus + OPUS_CFLAGS=$(shell pkg-config --silence-errors --cflags opusfile opus || true) + OPUS_LIBS=$(shell pkg-config --silence-errors --libs opusfile opus || echo -lopusfile -lopus) endif + CLIENT_CFLAGS += $(OPUS_CFLAGS) + CLIENT_LIBS += $(OPUS_LIBS) NEED_OGG=1 endif ifeq ($(NEED_OGG),1) ifeq ($(USE_INTERNAL_OGG),1) - CLIENT_CFLAGS += -I$(OGGDIR)/include + OGG_CFLAGS = -I$(OGGDIR)/include else - CLIENT_LIBS += -logg + OGG_CFLAGS ?= $(shell pkg-config --silence-errors --cflags ogg || true) + OGG_LIBS ?= $(shell pkg-config --silence-errors --libs ogg || echo -logg) endif + CLIENT_CFLAGS += $(OGG_CFLAGS) + CLIENT_LIBS += $(OGG_LIBS) endif ifeq ($(USE_CODEC_VORBIS),1) -- cgit