From 62084f9736febcad02c62aab9f8cca7a00947395 Mon Sep 17 00:00:00 2001 From: Russell Bryant Date: Tue, 20 Dec 2005 08:16:53 +0000 Subject: use the system libgsm if available (issue #5434, modified to still work with builtin libgsm) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@7539 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- codecs/Makefile | 12 +++++++++++- codecs/codec_gsm.c | 5 +++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/codecs/Makefile b/codecs/Makefile index d1feb8a54..c49994174 100644 --- a/codecs/Makefile +++ b/codecs/Makefile @@ -60,8 +60,18 @@ ifneq ($(wildcard ilbc/iLBC_decode.h),) endif +LIBGSM_PATH:=/usr/local/include /usr/include +LIBGSM_SYSTEM_HEADERS:=$(wildcard $(LIBGSM_PATH:%=$(CROSS_COMPILE_TARGET)%/gsm/gsm.h)) +ifneq (,$(LIBGSM_SYSTEM_HEADERS)) +LIBGSM=-lgsm +LIBGSMT= +CFLAGS+=-DUSE_EXTERNAL_GSM_LIB +else LIBGSM=gsm/lib/libgsm.a -LIBGSMT=gsm/lib/libgsm.a +LIBGSMT=$(LIBGSM) +CFLAGS+=-I. +endif + LIBLPC10=lpc10/liblpc10.a ifeq ($(findstring BSD,${OSARCH}),BSD) diff --git a/codecs/codec_gsm.c b/codecs/codec_gsm.c index 65800476e..b8afd3bd7 100644 --- a/codecs/codec_gsm.c +++ b/codecs/codec_gsm.c @@ -45,7 +45,12 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #include "asterisk/logger.h" #include "asterisk/channel.h" +#ifdef USE_EXTERNAL_GSM_LIB +#include +#else #include "gsm/inc/gsm.h" +#endif + #include "../formats/msgsm.h" /* Sample frame data */ -- cgit v1.2.3