[asterisk-commits] branch group/autoconf_and_menuselect r22073 - in
/team/group/autoconf_and_men...
asterisk-commits at lists.digium.com
asterisk-commits at lists.digium.com
Fri Apr 21 12:54:28 MST 2006
Author: kpfleming
Date: Fri Apr 21 14:54:27 2006
New Revision: 22073
URL: http://svn.digium.com/view/asterisk?rev=22073&view=rev
Log:
add configure script support for GSM library, and selection between system-supplied library and included one
Modified:
team/group/autoconf_and_menuselect/build_tools/menuselect-deps.in
team/group/autoconf_and_menuselect/codecs/Makefile
team/group/autoconf_and_menuselect/codecs/codec_gsm.c
team/group/autoconf_and_menuselect/configure.ac
team/group/autoconf_and_menuselect/makeopts.in
Modified: team/group/autoconf_and_menuselect/build_tools/menuselect-deps.in
URL: http://svn.digium.com/view/asterisk/team/group/autoconf_and_menuselect/build_tools/menuselect-deps.in?rev=22073&r1=22072&r2=22073&view=diff
==============================================================================
--- team/group/autoconf_and_menuselect/build_tools/menuselect-deps.in (original)
+++ team/group/autoconf_and_menuselect/build_tools/menuselect-deps.in Fri Apr 21 14:54:27 2006
@@ -24,3 +24,4 @@
WIN32=@OSISWIN32@
ZLIB=@PBX_LIBz@
ZAPTEL=@PBX_LIBtonezone@
+LIBGSM=@PBX_LIBgsm@
Modified: team/group/autoconf_and_menuselect/codecs/Makefile
URL: http://svn.digium.com/view/asterisk/team/group/autoconf_and_menuselect/codecs/Makefile?rev=22073&r1=22072&r2=22073&view=diff
==============================================================================
--- team/group/autoconf_and_menuselect/codecs/Makefile (original)
+++ team/group/autoconf_and_menuselect/codecs/Makefile Fri Apr 21 14:54:27 2006
@@ -41,18 +41,6 @@
LIBILBC=ilbc/libilbc.a
endif
-LIBGSM_PATH:=/usr/local/include /usr/include
-LIBGSM_SYSTEM_HEADERS:=$(firstword $(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=$(LIBGSM)
- CFLAGS+=-I.
-endif
-
LIBLPC10=lpc10/liblpc10.a
all: depend $(MODS)
@@ -71,7 +59,7 @@
$(LIBG723):
CFLAGS="$(ASTCFLAGS)" $(MAKE) -C g723.1 all
-$(LIBGSM):
+gsm/lib/libgsm.a:
CFLAGS="$(ASTCFLAGS) -I." $(MAKE) -C gsm lib/libgsm.a
$(LIBG723B):
@@ -95,8 +83,19 @@
codec_g723_1b.so : codec_g723_1b.o $(LIBG723B)
$(CC) $(SOLINK) -o $@ $< $(LIBG723B) -lm
-codec_gsm.so: codec_gsm.o $(LIBGSMT)
- $(CC) $(SOLINK) -o $@ $< $(LIBGSM)
+ifeq ($(GSM_LIB),internal)
+codec_gsm.o: codec_gsm.c
+ $(CC) -c -o $@ $(CFLAGS) -Igsm/inc $<
+
+codec_gsm.so: codec_gsm.o gsm/lib/libgsm.a
+ $(CC) $(SOLINK) -o $@ $< gsm/lib/libgsm.a
+else
+codec_gsm.o: codec_gsm.c
+ $(CC) -c -o $@ $(CFLAGS) $(GSM_INCLUDE) $<
+
+codec_gsm.so: codec_gsm.o
+ $(CC) $(SOLINK) -o $@ $< $(GSM_LIB)
+endif
codec_speex.so: codec_speex.o
$(CC) $(SOLINK) -o $@ $< $(LIBSPEEX)
Modified: team/group/autoconf_and_menuselect/codecs/codec_gsm.c
URL: http://svn.digium.com/view/asterisk/team/group/autoconf_and_menuselect/codecs/codec_gsm.c?rev=22073&r1=22072&r2=22073&view=diff
==============================================================================
--- team/group/autoconf_and_menuselect/codecs/codec_gsm.c (original)
+++ team/group/autoconf_and_menuselect/codecs/codec_gsm.c Fri Apr 21 14:54:27 2006
@@ -25,6 +25,10 @@
*
* \ingroup codecs
*/
+
+/*** MODULEINFO
+ <depend>libgsm</depend>
+ ***/
#include <fcntl.h>
#include <stdlib.h>
@@ -46,11 +50,7 @@
#include "asterisk/channel.h"
#include "asterisk/utils.h"
-#ifdef USE_EXTERNAL_GSM_LIB
-#include <gsm/gsm.h>
-#else
-#include "gsm/inc/gsm.h"
-#endif
+#include "gsm.h"
#include "../formats/msgsm.h"
Modified: team/group/autoconf_and_menuselect/configure.ac
URL: http://svn.digium.com/view/asterisk/team/group/autoconf_and_menuselect/configure.ac?rev=22073&r1=22072&r2=22073&view=diff
==============================================================================
--- team/group/autoconf_and_menuselect/configure.ac (original)
+++ team/group/autoconf_and_menuselect/configure.ac Fri Apr 21 14:54:27 2006
@@ -174,6 +174,58 @@
AST_EXT_LIB([newt], [newtBell], [NEWT], [newt])
AST_EXT_LIB([ssl], [ssl2_connect], [OPENSSL], [OpenSSL], [-lcrypto])
AST_EXT_LIB([z], [compress], [ZLIB], [zlib])
+
+GSM_INTERNAL="yes"
+GSM_SYSTEM="yes"
+AC_ARG_WITH([gsm], AC_HELP_STRING([--with-gsm=PATH], [use libgsm files in PATH, or 'internal']), [
+case ${withval} in
+ n|no)
+ USE_GSM=no
+ ;;
+ y|ye|yes)
+ ;;
+ internal)
+ GSM_SYSTEM="no"
+ ;;
+ *)
+ GSM_DIR="${withval}"
+ GSM_INTERNAL="no"
+ ;;
+esac
+])
+
+PBX_LIBgsm=0
+
+if test "${USE_GSM}" != "no"; then
+ if test "${GSM_SYSTEM}" = "yes"; then
+ AC_CHECK_LIB([gsm], [gsm_create], AC_DEFINE_UNQUOTED([HAVE_GSM], 1,
+ [Define to indicate the GSM library]), [], -L${GSM_DIR}/lib)
+ if test "${ac_cv_lib_gsm_gsm_create}" = "yes"; then
+ gsm_LIB="-lgsm"
+ if test "x${GSM_DIR}" != "x"; then
+ gsm_LIB="-L${GSM_DIR}/lib ${gsm_LIB}"
+ gsm_INCLUDE="-I${GSM_DIR}/include"
+ fi
+ PBX_LIBgsm=1
+ GSM_INTERNAL="no"
+ fi
+ fi
+ if test "${GSM_INTERNAL}" = "yes"; then
+ gsm_LIB="internal"
+ PBX_LIBgsm=1
+ fi
+ if test "x${PBX_LIBgsm}" = "x0"; then
+ echo "***"
+ echo "*** The GSM installation on this system appears to be broken."
+ echo "*** Either correct the installation, or run configure"
+ echo "*** including --without-gsm"
+ exit 1
+ fi
+fi
+
+AC_SUBST([gsm_LIB])
+AC_SUBST([gsm_INCLUDE])
+AC_SUBST([PBX_LIBgsm])
AC_ARG_WITH([pq], AC_HELP_STRING([--with-pq=PATH],[use PostgreSQL files in PATH]),[
case ${withval} in
Modified: team/group/autoconf_and_menuselect/makeopts.in
URL: http://svn.digium.com/view/asterisk/team/group/autoconf_and_menuselect/makeopts.in?rev=22073&r1=22072&r2=22073&view=diff
==============================================================================
--- team/group/autoconf_and_menuselect/makeopts.in (original)
+++ team/group/autoconf_and_menuselect/makeopts.in Fri Apr 21 14:54:27 2006
@@ -95,3 +95,7 @@
GTK_LIBS=@GTK_LIBS@
CURL_LIB=@CURLLIBS@
+
+GSM_LIB=@gsm_LIB@
+GSM_INCLUDE=@gsm_INCLUDE@
+
More information about the asterisk-commits
mailing list