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.
This commit is contained in:
Simon McVittie 2013-05-19 21:02:31 +01:00
parent c817ab5ae0
commit cff1fcd658

View file

@ -982,31 +982,37 @@ ifeq ($(USE_CURL),1)
endif
ifeq ($(USE_CODEC_VORBIS),1)
CLIENT_CFLAGS += -DUSE_CODEC_VORBIS
CLIENT_LIBS += -lvorbisfile -lvorbis
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_RENDERER_DLOPEN),1)