drachtio / drachtio-server

A SIP call processing server that can be controlled via nodejs applications
https://drachtio.org
MIT License
237 stars 92 forks source link

Fix shadow build with boost submodule #298

Closed orgads closed 1 year ago

davehorton commented 1 year ago

This fails at a different place on a debian 11 server

onst*)'
/usr/bin/ld: src/drachtio-ua-invalid.o: in function `boost::log::v2_mt_posix::aux::record_pump<boost::log::v2_mt_posix::sources::severity_logger_mt<drachtio::severity_levels> >::auto_release::~auto_release()':
/usr/local/src/drachtio-server/build/../deps/boost/boost/log/sources/record_ostream.hpp:493: undefined reference to `boost::log::v2_mt_posix::aux::stream_provider<char>::release_compound(boost::log::v2_mt_posix::aux::stream_provider<char>::stream_compound*)'
/usr/bin/ld: src/drachtio-ua-invalid.o: in function `boost::log::v2_mt_posix::record::reset()':
/usr/local/src/drachtio-server/build/../deps/boost/boost/log/core/record.hpp:157: undefined reference to `boost::log::v2_mt_posix::record_view::public_data::destroy(boost::log::v2_mt_posix::record_view::public_data const*)'
/usr/bin/ld: src/drachtio-ua-invalid.o: in function `boost::log::v2_mt_posix::aux::record_pump<boost::log::v2_mt_posix::sources::severity_logger_mt<drachtio::severity_levels> >::auto_release::~auto_release()':
/usr/local/src/drachtio-server/build/../deps/boost/boost/log/sources/record_ostream.hpp:493: undefined reference to `boost::log::v2_mt_posix::aux::stream_provider<char>::release_compound(boost::log::v2_mt_posix::aux::stream_provider<char>::stream_compound*)'
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:604: drachtio] Error 1
make[1]: Leaving directory '/usr/local/src/drachtio-server/build'
make: *** [Makefile:461: all] Error 2

I ran these commands:

git clone https://github.com/drachtio/drachtio-server.git
cd drachtio-server/
git fetch origin pull/298/head:compile-fix
git checkout compile-fix
git submodule update --init --recursive
 ./autogen.sh
 mkdir build && cd $_
 ../configure
 make
davehorton commented 1 year ago

I'm guessing the issue is that if DEP_BOOST is true you need to link explicitly to the boost libs

drachtio_LDADD += ${srcdir}/deps/boost/stage/lib/libboost_thread.a \
    ${srcdir}/deps/boost/stage/lib/libboost_system.a ${srcdir}/deps/boost/stage/lib/libboost_log.a \
    ${srcdir}/deps/boost/stage/lib/libboost_filesystem.a \

which was what it did before

?

orgads commented 1 year ago

No, this doesn't matter. Should be fixed now.

davehorton commented 1 year ago

Another issue is that this change

MYVERSION=$(shell [ -e .git ] && git describe --always || echo 1.0.0)

always fails when building from a subdirectory (e.g. incorrectly returns version 1.0.0 instead of git tag). Could you fix this?