Skip to content
  • Maxim Cournoyer's avatar
    configure.ac: Resolve libnatpmp conftest issue. · 5cca2625
    Maxim Cournoyer authored and Adrien Béraud's avatar Adrien Béraud committed
    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
    5cca2625