summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <smcv@debian.org>2013-05-19 21:02:31 +0100
committerTim Angus <tim@ngus.net>2014-08-28 11:03:02 +0100
commitcd23d424b8e76bc1df24773b60d564839a41bf74 (patch)
treeb3d0bf5575b89140860a639a76af1c0aa6d72c62
parent036a7e4d8d3c640a0157f5cdf4043e57c8e90655 (diff)
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.
-rw-r--r--Makefile23
1 files 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)