diff options
author | orbea <orbea@riseup.net> | 2021-04-01 17:47:53 -0700 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2021-04-07 08:29:50 +0200 |
commit | 3affccf29b53976a0cef5ea662f913d4913d44c8 (patch) | |
tree | 6a3c5ad4f286b4bf0927d12de1071b21fcfb974d /Makefile.am | |
parent | 0d8fe37d6447332356936e3b41cb4ebb19c20dc2 (diff) | |
download | NetworkManager-3affccf29b53976a0cef5ea662f913d4913d44c8.tar.gz |
tests: fix undefined references to pthread
When building NetworkManger with --enable-tests or using 'make check'
and slibtool the build will fail in many places with undefined references
to pthreads.
This is because -lpthread is never explicitly added to the appropriate
variable, src_core_libNetworkManagerTest_la_LIBADD. When analyzing the
build log with GNU libtool it can be seen that it silently adds -pthread
on its own which hides the issue.
To solve this ax_pthread.m4 from the autoconf-archives project can be
used which provides the $(PTHREAD_LIBS) linker flag.
Source: https://github.com/autoconf-archive/autoconf-archive/blob/master/m4/ax_pthread.m4
See-also: https://www.gnu.org/software/autoconf-archive/ax_pthread.html
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/804
Diffstat (limited to 'Makefile.am')
-rw-r--r-- | Makefile.am | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Makefile.am b/Makefile.am index db0b0a9f5d..1454a607a4 100644 --- a/Makefile.am +++ b/Makefile.am @@ -2647,6 +2647,7 @@ src_core_libNetworkManagerTest_la_LIBADD = \ $(CODE_COVERAGE_LDFLAGS) \ $(GLIB_LIBS) \ $(LIBUDEV_LIBS) \ + $(PTHREAD_LIBS) \ $(NULL) $(src_core_libNetworkManagerTest_la_OBJECTS): $(src_libnm_core_public_mkenums_h) |