Hello.

Thanks for the patch.
The git repository is now up to date, and includes your modifications.

I tried to build the library on Debian sid using the new Makefile.am, but it didn't succeed, and failed because of some undefined references to pthread_create.

According to one of the comments here: https://stackoverflow.com/q/1662909/3427069 the solution would be to have LDFLAGS= -pthread -lpthread.

Taking into account that modification (see attached patch), the library now successfully builds, and dpkg-shlibdeps mentions that libexadrums has been linked against libatomic.

It should also work if -lpthread was added to the libexadrums_la_LIBADD libraries, as libexadrums_lpthread.diff shows.

I don't know which one is the best, but I'm happy to fix and upload the package if one of the patches fixes the issue.
diff --git a/Makefile.am b/Makefile.am
index b87d93a..37e606d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -29,7 +29,7 @@ AM_LDFLAGS = -Wl,--as-needed -Wl,--no-undefined
 lib_LTLIBRARIES = libexadrums.la
 
 libexadrums_la_CXXFLAGS = $(AM_CXXFLAGS) \
-  -pthread \
+  -pthread -lpthread \
   -std=c++17 $(alsa_CFLAGS) $(tinyxml2_CFLAGS)
 libexadrums_la_LDFLAGS = $(AM_LDFLAGS) \
   -pthread \
diff --git a/Makefile.am b/Makefile.am
index b87d93a..fd17947 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -36,7 +36,7 @@ libexadrums_la_LDFLAGS = $(AM_LDFLAGS) \
   -version-info $(exadrums_libtool_version_info)
 # The -pthread compiler and linker option links with libpthread, but
 # also selects various architecture-dependent settings.
-libexadrums_la_LIBADD = $(alsa_LIBS) $(tinyxml2_LIBS) -latomic -lstdc++fs
+libexadrums_la_LIBADD = $(alsa_LIBS) $(tinyxml2_LIBS) -lpthread -latomic -lstdc++fs
 # The standard C++ library does not include libatomic on some
 # architectures (armel mips mipsel). It does not hurt to always list
 # it here, it will only be effective when used thanks to --as-needed.

Reply via email to