]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
integrate in-tree libzrtp into the build system
authorTravis Cross <tc@traviscross.com>
Thu, 5 Apr 2012 04:10:55 +0000 (04:10 +0000)
committerTravis Cross <tc@traviscross.com>
Thu, 5 Apr 2012 04:10:55 +0000 (04:10 +0000)
Thanks to Ken Rice for working with me late into the night to get this
done.

Makefile.am
configure.in
src/switch_rtp.c

index 9f6ab7691686aedc38c65f3a609800e94ae1abc9..0c242d6c33993baf858d327370db7a28dac02447 100644 (file)
@@ -147,7 +147,11 @@ libfreeswitch_la_LDFLAGS += $(ODBC_LIB_FLAGS)
 endif
 
 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
 
 library_includedir      = $(includedir)
@@ -460,6 +464,9 @@ libs/srtp/libsrtp.la: libs/srtp libs/srtp/.update
        @cd libs/srtp && $(MAKE)
        @$(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
index d362db9dd0638d1fc43a1c6f0ef487779e7df2e2..3df878551df33043e7be24d49eb7386d28943767 100644 (file)
@@ -363,13 +363,7 @@ AM_CONDITIONAL([ENABLE_SRTP],[test "${enable_srtp}" = "yes"])
 AC_ARG_ENABLE(zrtp,
        [AS_HELP_STRING([--enable-zrtp], [Compile with zrtp Support])],,[enable_zrtp="no"])
 if test "x$enable_zrtp" = "xyes" ; then
-   saved_LIBS="$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
+   LIBS="-lpthread $LIBS"
    APR_ADDTO(SWITCH_AM_CFLAGS, -DENABLE_ZRTP)
 fi
 
@@ -1090,6 +1084,9 @@ AC_CONFIG_SUBDIRS([libs/broadvoice])
 AC_CONFIG_SUBDIRS([libs/libg722_1])
 AC_CONFIG_SUBDIRS([libs/silk])
 AC_CONFIG_SUBDIRS([libs/libcodec2])
+if test "x${enable_zrtp}" = "xyes"; then
+   AC_CONFIG_SUBDIRS([libs/libzrtp/projects/gnu])
+fi
 
 case $host in
    *-openbsd*)
index 5e741c4eb7207a27315e9145983a51754b3ab0bd..932485eae7c3bad564f2a80aa29f366e08453c52 100644 (file)
@@ -71,7 +71,7 @@ static switch_mutex_t *port_lock = NULL;
 typedef srtp_hdr_t rtp_hdr_t;
 
 #ifdef ENABLE_ZRTP
-#include <libzrtp/zrtp.h>
+#include "zrtp.h"
 static zrtp_global_t *zrtp_global;
 static zrtp_zid_t zid = { "FreeSWITCH01" };
 static int zrtp_on = 0;