integrate in-tree libzrtp into the build system

Thanks to Ken Rice for working with me late into the night to get this
done.
This commit is contained in:
Travis Cross 2012-04-05 04:10:55 +00:00
parent 9e25cc2c0f
commit 393b63b7bd
3 changed files with 13 additions and 9 deletions

View File

@ -147,7 +147,11 @@ libfreeswitch_la_LDFLAGS += $(ODBC_LIB_FLAGS)
endif endif
if ENABLE_ZRTP if ENABLE_ZRTP
libfreeswitch_la_LDFLAGS += -lzrtp -lbn CORE_CFLAGS += -I$(switch_srcdir)/libs/libzrtp/third_party/bgaes
CORE_CFLAGS += -I$(switch_srcdir)/libs/libzrtp/third_party/bnlib
CORE_CFLAGS += -I$(switch_srcdir)/libs/libzrtp/include
libfreeswitch_la_LDFLAGS += -Llibs/libzrtp/third_party/bnlib -lbn -Llibs/libzrtp/projects/gnu/build -lzrtp
CORE_LIBS += libs/libzrtp/projects/gnu/libzrtp.a
endif endif
library_includedir = $(includedir) library_includedir = $(includedir)
@ -460,6 +464,9 @@ libs/srtp/libsrtp.la: libs/srtp libs/srtp/.update
@cd libs/srtp && $(MAKE) @cd libs/srtp && $(MAKE)
@$(TOUCH_TARGET) @$(TOUCH_TARGET)
libs/libzrtp/projects/gnu/libzrtp.a: libs/libzrtp libs/libzrtp/projects/gnu/.update
@cd libs/libzrtp/projects/gnu && $(MAKE)
@$(TOUCH_TARGET)
## ##
## helper targets ## helper targets

View File

@ -363,13 +363,7 @@ AM_CONDITIONAL([ENABLE_SRTP],[test "${enable_srtp}" = "yes"])
AC_ARG_ENABLE(zrtp, AC_ARG_ENABLE(zrtp,
[AS_HELP_STRING([--enable-zrtp], [Compile with zrtp Support])],,[enable_zrtp="no"]) [AS_HELP_STRING([--enable-zrtp], [Compile with zrtp Support])],,[enable_zrtp="no"])
if test "x$enable_zrtp" = "xyes" ; then if test "x$enable_zrtp" = "xyes" ; then
saved_LIBS="$LIBS" LIBS="-lpthread $LIBS"
LIBS="$saved_LIBS -L/usr/local/lib -lbn -lpthread"
AC_CHECK_LIB(zrtp, zrtp_init, [has_zrtp="yes"], [has_zrtp="no"])
LIBS="$saved_LIBS"
if test "x$has_zrtp" = "xno"; then
AC_ERROR([Cannot locate zrtp libraries])
fi
APR_ADDTO(SWITCH_AM_CFLAGS, -DENABLE_ZRTP) APR_ADDTO(SWITCH_AM_CFLAGS, -DENABLE_ZRTP)
fi fi
@ -1090,6 +1084,9 @@ AC_CONFIG_SUBDIRS([libs/broadvoice])
AC_CONFIG_SUBDIRS([libs/libg722_1]) AC_CONFIG_SUBDIRS([libs/libg722_1])
AC_CONFIG_SUBDIRS([libs/silk]) AC_CONFIG_SUBDIRS([libs/silk])
AC_CONFIG_SUBDIRS([libs/libcodec2]) AC_CONFIG_SUBDIRS([libs/libcodec2])
if test "x${enable_zrtp}" = "xyes"; then
AC_CONFIG_SUBDIRS([libs/libzrtp/projects/gnu])
fi
case $host in case $host in
*-openbsd*) *-openbsd*)

View File

@ -71,7 +71,7 @@ static switch_mutex_t *port_lock = NULL;
typedef srtp_hdr_t rtp_hdr_t; typedef srtp_hdr_t rtp_hdr_t;
#ifdef ENABLE_ZRTP #ifdef ENABLE_ZRTP
#include <libzrtp/zrtp.h> #include "zrtp.h"
static zrtp_global_t *zrtp_global; static zrtp_global_t *zrtp_global;
static zrtp_zid_t zid = { "FreeSWITCH01" }; static zrtp_zid_t zid = { "FreeSWITCH01" };
static int zrtp_on = 0; static int zrtp_on = 0;