shithub: opus-tools

Download patch

ref: 14f38dbc9c443f4b806cc21d49ba4d13b94118b3
parent: 6d4364f1c2468dc8807c9c4c2ca482cbe2812446
author: Ralph Giles <giles@mozilla.com>
date: Wed Aug 22 11:55:23 EDT 2012

Add build support for opusrtp.c.

Detect libpcap and add it to the link line.

We should disable the pcap support if libpcap isn't available,
but the source doesn't do this. Instead it will fail to compile.

--- a/Makefile.am
+++ b/Makefile.am
@@ -8,7 +8,7 @@
 
 AM_CFLAGS = $(OGG_CFLAGS) $(Opus_CFLAGS) -DOPUSTOOLS -D_FORTIFY_SOURCE=2 -DHAVE_GETOPT_H -DSPX_RESAMPLE_EXPORT= -DRANDOM_PREFIX=opustools -DOUTSIDE_SPEEX -DFLOATING_POINT
 
-bin_PROGRAMS = opusenc opusdec opusinfo
+bin_PROGRAMS = opusenc opusdec opusinfo opusrtp
 
 noinst_HEADERS = src/arch.h \
                  src/diag_range.h \
@@ -52,5 +52,8 @@
 opusinfo_SOURCES = src/opus_header.c src/opusinfo.c src/info_opus.c win32/unicode_support.c
 opusinfo_LDADD = $(OGG_LIBS)
 opusinfo_MANS = man/opusinfo.1
+
+opusrtp_SOURCES = src/opusrtp.c
+opusrtp_LDADD = @LIBPCAP@ $(OGG_LIBS)
 
 #TESTS = FIXME
--- a/configure.ac
+++ b/configure.ac
@@ -182,6 +182,12 @@
   AC_MSG_WARN([Audio support not found -- no direct audio output in opusdec])
 fi
 
+dnl check for pcap
+AC_CHECK_LIB([pcap], [pcap_open_live], [
+  AC_DEFINE([HAVE_PCAP], 1, [Define in building with libpcap support])
+  LIBPCAP="-lpcap"
+])
+AC_SUBST(LIBPCAP)
 
 on_x86=no
 case "$host_cpu" in