1 commit aa43d358634ab9bf66250babab743a846e2bd689
2 Author: Sebastian Kemper <sebastian_ml@gmx.net>
3 Date: Thu Oct 3 19:58:08 2019 +0200
7 RTPProxy's configure script checks for both libsrtp and libsrtp2. When
8 both are available the configure script ends up setting
12 and defining both ENABLE_SRTP and ENABLE_SRTP2. But the below
13 preprocessor macro in extractaudio/eaud_crypto.c can only deal with one
14 or the other, not both:
17 # include <srtp/srtp.h>
18 # define srtp_crypto_policy_set_rtp_default crypto_policy_set_rtp_default
19 # define srtp_crypto_policy_set_rtcp_default crypto_policy_set_rtcp_default
20 # define srtp_sec_serv_t sec_serv_t
21 # define srtp_err_status_ok err_status_ok
23 # include <srtp2/srtp.h>
25 # error "One of srtp or srtp2 must be configured."
28 So it chooses a setup which would be valid for libsrtp and not libsrtp2.
29 But afterward the build system tries to link against libsrtp2 (because
30 of LIBS_SRTP="-lsrtp2") and the compile fails:
32 /home/sk/tmp/openwrt/staging_dir/toolchain-mips_24kc_gcc-7.4.0_musl/lib/gcc/mips-openwrt-linux-musl/7.4.0/../../../../mips-openwrt-linux-musl/bin/ld: extractaudio-eaud_crypto.o: in function `eaud_crypto_getopt_parse':
33 eaud_crypto.c:(.text+0xc8): undefined reference to `crypto_policy_set_rtp_default'
34 /home/sk/tmp/openwrt/staging_dir/toolchain-mips_24kc_gcc-7.4.0_musl/lib/gcc/mips-openwrt-linux-musl/7.4.0/../../../../mips-openwrt-linux-musl/bin/ld: eaud_crypto.c:(.text+0xd0): undefined reference to `crypto_policy_set_rtcp_default'
35 collect2: error: ld returned 1 exit status
36 make[4]: *** [Makefile:567: extractaudio] Error 1
38 Fix this by checking for libsrtp only if libsrtp2 is not found.
40 Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
44 @@ -140,22 +140,22 @@ then
45 AC_DEFINE([ENABLE_SNDFILE], 1, [Define if you have libsndfile library installed]))
49 -AC_CHECK_HEADER(srtp/srtp.h, found_libsrtp=yes)
50 -if test "$found_libsrtp" = yes
52 - AC_CHECK_LIB(srtp, srtp_init,
54 - AC_DEFINE([ENABLE_SRTP], 1, [Define if you have libsrtp library installed]))
58 +# libsrtp2 (preferred)
59 AC_CHECK_HEADER(srtp2/srtp.h, found_libsrtp2=yes)
60 if test "$found_libsrtp2" = yes
62 AC_CHECK_LIB(srtp2, srtp_init,
64 AC_DEFINE([ENABLE_SRTP2], 1, [Define if you have libsrtp2 library installed]))
67 + AC_CHECK_HEADER(srtp/srtp.h, found_libsrtp=yes)
68 + if test "$found_libsrtp" = yes
70 + AC_CHECK_LIB(srtp, srtp_init,
72 + AC_DEFINE([ENABLE_SRTP], 1, [Define if you have libsrtp library installed]))