Link C modules with libpthread under Unix systems

Specify -pthread option which should be universally supported under
non-{MSW,Mac} platforms by now and which is required under Linux to link
the tests using boost::shared_ptr<>, which uses pthread_mutex_xxx().
This commit is contained in:
Vadim Zeitlin 2021-10-15 23:02:39 +02:00
commit e45d8f94fc

View file

@ -2434,20 +2434,31 @@ fi
AC_SUBST(RBIN)
# C module on Mac OS X tweaks
#----------------------------------------------------------------
# Nothing to look for in C case, just define some variables
#----------------------------------------------------------------
# Some tweaks for creating shared modules.
C_SO='$(SO)'
case $host in
*-*-darwin*)
C_LDSHARED="cc -dynamiclib"
CXX_LDSHARED="g++ -dynamiclib"
*-*-darwin*)
C_LDFLAGS='-dynamiclib'
C_SO=".dylib"
;;
*-*-cygwin* | *-*-mingw*)
# Nothing special to do.
;;
*)
C_LDSHARED='$(LDSHARED)'
CXX_LDSHARED='$(CXXSHARED)'
C_SO='$(SO)'
# This is needed for linking with Boost which uses mutexes and does no
# harm in all the other cases.
C_LDFLAGS='-pthread'
;;
esac
C_LDSHARED="\$(LDSHARED) $C_LDFLAGS"
CXX_LDSHARED="\$(CXXSHARED) $C_LDFLAGS"
AC_SUBST(C_LDSHARED)
AC_SUBST(CXX_LDSHARED)
AC_SUBST(C_SO)