Skip to content
Snippets Groups Projects
Commit 5cca2625 authored by Maxim Cournoyer's avatar Maxim Cournoyer Committed by Adrien Béraud
Browse files

configure.ac: Resolve libnatpmp conftest issue.

Do not unnecessarily clutter CPPFLAGS; the variable is honored by
Autoconf while running its conftests and can cause issues such as
symbol clashes between the libnatpmp and webrtc-audio-processing
library observed below:

configure:20851: checking for initnatpmp in -lnatpmp
configure:20873: g++ -std=gnu++17 -o conftest  -DNDEBUG=1 -O3 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DPJ_AUTOCONF=1  -I/home/maxim/src/ring-project/daemon/contrib/x86_64-unknown-linux-gnu/include  -fvisibility=hidden -DDRING_BUILD  -Ddring_EXPORTS  -DASIO_STANDALONE -I/home/maxim/src/ring-project/daemon/contrib/x86_64-unknown-linux-gnu/include -I/gnu/store/zimpk6gqmjrwxc7fnam212kv3a6dwpzz-jsoncpp-1.9.2/include -DWEBRTC_AUDIO_PROCESSING_ONLY_BUILD -DWEBRTC_POSIX -I/home/maxim/src/ring-project/daemon/contrib/x86_64-unknown-linux-gnu/include/webrtc_audio_processing  -Wl,-Bsymbolic -ldl -L/home/maxim/src/ring-project/daemon/contrib/x86_64-unknown-linux-gnu/lib -L/gnu/store/zimpk6gqmjrwxc7fnam212kv3a6dwpzz-jsoncpp-1.9.2/lib -ljsoncpp -L/home/maxim/src/ring-project/daemon/contrib/x86_64-unknown-linux-gnu/lib -lwebrtc_audio_processing conftest.cpp -lnatpmp -lpthread  -lssl -lcrypto >&5
ld: /tmp/cc5prP4w.o: in function `main':
conftest.cpp:(.text.startup+0x0): multiple definition of `main'; /home/maxim/src/ring-project/daemon/contrib/x86_64-unknown-linux-gnu/lib/libwebrtc_audio_processing.a(libwebrtc_audio_processing_la-click_annotate.o):click_annotate.cc:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status
configure:20873: $? = 1

This was causing the link test of the libnatpmp library to fail,
which in turned caused the natpmp support to be disabled entirely.

* src/Makefile.am (libring_la_LDFLAGS): Add @WEBRTC_LIBS@.
(libring_la_CFLAGS): Add @WEBRTC_CFLAGS@.
* src/media/audio/Makefile.am (libaudio_la_CXXFLAGS)
[HAVE_WEBRTC_AP]: Add @WEBRTC_CFLAGS@.
* src/media/audio/echo-cancel/Makefile.am
(libecho_cancel_la_CXXFLAGS): Add @WEBRTC_CFLAGS@ and honor AM_CXXFLAGS.

GitLab: #487
Change-Id: I064d6a563318b34b2f3f516ca2aa8c2831205b09
parent f5119abd
No related branches found
No related tags found
No related merge requests found
...@@ -555,9 +555,8 @@ AC_ARG_WITH([webrtcap], ...@@ -555,9 +555,8 @@ AC_ARG_WITH([webrtcap],
AS_IF([test "x$with_webrtc_ap" = "xyes"], AS_IF([test "x$with_webrtc_ap" = "xyes"],
[PKG_CHECK_MODULES(WEBRTC, [webrtc-audio-processing >= 0.3.1], [PKG_CHECK_MODULES(WEBRTC, [webrtc-audio-processing >= 0.3.1],
[ [
AC_DEFINE([HAVE_WEBRTC_AP], 1, [Define if you have webrtc-audio-processing]) AC_DEFINE([HAVE_WEBRTC_AP], 1,
CPPFLAGS="${CPPFLAGS} ${WEBRTC_CFLAGS}" [Define if you have webrtc-audio-processing])
LDFLAGS="${LDFLAGS} ${WEBRTC_LIBS}"
], ],
AC_MSG_WARN([Missing webrtc-audio-processing development files])) AC_MSG_WARN([Missing webrtc-audio-processing development files]))
]) ])
......
...@@ -77,7 +77,8 @@ libring_la_LDFLAGS = \ ...@@ -77,7 +77,8 @@ libring_la_LDFLAGS = \
@LIBSWRESAMPLE_LIBS@ \ @LIBSWRESAMPLE_LIBS@ \
@LIBSWSCALE_LIBS@ \ @LIBSWSCALE_LIBS@ \
@LIBAVUTIL_LIBS@ \ @LIBAVUTIL_LIBS@ \
@LIBS@ @LIBS@ \
@WEBRTC_LIBS@
if ENABLE_PLUGIN if ENABLE_PLUGIN
libring_la_LDFLAGS+= \ libring_la_LDFLAGS+= \
...@@ -109,7 +110,8 @@ libring_la_CFLAGS = \ ...@@ -109,7 +110,8 @@ libring_la_CFLAGS = \
@LIBAVDEVICE_CFLAGS@ \ @LIBAVDEVICE_CFLAGS@ \
@LIBAVFILTER_CFLAGS@ \ @LIBAVFILTER_CFLAGS@ \
@LIBSWRESAMPLE_CFLAGS@ \ @LIBSWRESAMPLE_CFLAGS@ \
@LIBSWSCALE_CFLAGS@ @LIBSWSCALE_CFLAGS@ \
@WEBRTC_CFLAGS@
libring_la_CXXFLAGS = @JSONCPP_CFLAGS@ libring_la_CXXFLAGS = @JSONCPP_CFLAGS@
......
...@@ -61,6 +61,10 @@ libaudio_la_CXXFLAGS += @SPEEXDSP_CFLAGS@ ...@@ -61,6 +61,10 @@ libaudio_la_CXXFLAGS += @SPEEXDSP_CFLAGS@
libaudio_la_LDFLAGS += @SPEEXDSP_LIBS@ libaudio_la_LDFLAGS += @SPEEXDSP_LIBS@
endif endif
if HAVE_WEBRTC_AP
libaudio_la_CXXFLAGS += @WEBRTC_CFLAGS@
endif
noinst_HEADERS = \ noinst_HEADERS = \
audiobuffer.h \ audiobuffer.h \
audio_input.h \ audio_input.h \
......
...@@ -13,10 +13,11 @@ endif ...@@ -13,10 +13,11 @@ endif
if HAVE_WEBRTC_AP if HAVE_WEBRTC_AP
EC_SRC += webrtc_echo_canceller.cpp EC_SRC += webrtc_echo_canceller.cpp
EC_HDR += webrtc_echo_canceller.h EC_HDR += webrtc_echo_canceller.h
libecho_cancel_la_CXXFLAGS = @WEBRTC_CFLAGS@ $(AM_CXXFLAGS)
endif endif
libecho_cancel_la_SOURCES = \ libecho_cancel_la_SOURCES = \
$(EC_SRC) $(EC_SRC)
noinst_HEADERS = \ noinst_HEADERS = \
echo_canceller.h \ echo_canceller.h \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment