Description: Fix PThread and ATFork linking
Author: Thomas Andrejak <thomas.andrejak@gmail.com>
Last-Update: 2019-09-13
Forwarded: https://www.prelude-siem.org/issues/885

--- prelude-admin/Makefile.am	2016-09-15 08:49:10.785000884 +0200
+++ prelude-admin/Makefile.am	2017-04-25 23:55:55.141482528 +0200
@@ -7,7 +7,7 @@
 			$(top_builddir)/src/variable.lo \
 		        $(top_builddir)/src/libprelude.la \
 			@PRELUDE_ADMIN_LIBS@ \
-			../libmissing/libmissing.la $(GETADDRINFO_LIB) $(GETHOSTNAME_LIB) $(HOSTENT_LIB) $(INET_NTOP_LIB) $(INET_PTON_LIB) $(LIBSOCKET) $(LIB_POLL) $(LIB_SELECT) $(LTLIBINTL) $(LTLIBTHREAD) $(SERVENT_LIB)
+			../libmissing/libmissing.la $(GETADDRINFO_LIB) $(GETHOSTNAME_LIB) $(HOSTENT_LIB) $(INET_NTOP_LIB) $(INET_PTON_LIB) $(LIBSOCKET) $(LIB_POLL) $(LIB_SELECT) $(LTLIBINTL) $(LTLIBMULTITHREAD) $(SERVENT_LIB)
 
 
 prelude_admin_SOURCES = 		\
--- src/libprelude-error/Makefile.am	2016-09-15 08:49:10.805000884 +0200
+++ src/libprelude-error/Makefile.am	2017-04-25 23:57:02.636949645 +0200
@@ -14,7 +14,7 @@
 nodist_include_HEADERS = prelude-error.h
 
 noinst_LTLIBRARIES = libprelude-error.la
-libprelude_error_la_LIBADD  = @LTLIBTHREAD@
+libprelude_error_la_LIBADD  = $(LTLIBMULTITHREAD)
 libprelude_error_la_LDFLAGS = -no-undefined
 libprelude_error_la_SOURCES = prelude-error.h prelude-error.c strsource.c strerror.c
 
--- src/Makefile.am	2018-12-23 21:59:17.870000000 +0100
+++ src/Makefile.am	2019-02-26 23:49:47.973788402 +0100
@@ -9,7 +9,7 @@
 
 libpreludeincludedir = $(includedir)/
 libprelude_la_LIBADD = @LIBPRELUDE_LIBS@ $(LIBLTDL) $(top_builddir)/libmissing/libmissing.la libprelude-error/libprelude-error.la
-libprelude_la_LDFLAGS = $(GETADDRINFO_LIB) $(GETHOSTNAME_LIB) $(HOSTENT_LIB) $(INET_NTOP_LIB) $(INET_PTON_LIB) $(LIBSOCKET) $(LIB_POLL) $(LIB_PTHREAD_SIGMASK) $(LIB_SELECT) $(LTLIBINTL) $(LTLIBTHREAD) $(SERVENT_LIB) -no-undefined -version-info @LIBPRELUDE_SONAME@ -export-symbols-regex "^(idmef|_?prelude)_"
+libprelude_la_LDFLAGS = $(GETADDRINFO_LIB) $(GETHOSTNAME_LIB) $(HOSTENT_LIB) $(INET_NTOP_LIB) $(INET_PTON_LIB) $(LIBSOCKET) $(LIB_POLL) $(LIB_PTHREAD_SIGMASK) $(LIB_SELECT) $(LTLIBINTL) $(LTLIBMULTITHREAD) $(SERVENT_LIB) -no-undefined -version-info @LIBPRELUDE_SONAME@ -export-symbols-regex "^(idmef|_?prelude)_" -Wl,-u,pthread_atfork
 lib_LTLIBRARIES = libprelude.la
 BUILT_SOURCES = $(LTDLDEPS) 
 
--- src/Makefile.in	2018-12-23 22:01:04.767000000 +0100
+++ src/Makefile.in 	2019-02-26 23:56:08.385091987 +0100
@@ -1132,7 +1132,7 @@
 LIBS = @LIBS@
 LIBSOCKET = @LIBSOCKET@
 LIBTESTS_LIBDEPS = @LIBTESTS_LIBDEPS@
-LIBTHREAD = @LIBTHREAD@
+LIBMULTITHREAD = @LIBMULTITHREAD@
 LIBTOOL = @LIBTOOL@
 LIB_NANOSLEEP = @LIB_NANOSLEEP@
 LIB_POLL = @LIB_POLL@
@@ -1156,7 +1156,7 @@
 LTLIBMULTITHREAD = @LTLIBMULTITHREAD@
 LTLIBOBJS = @LTLIBOBJS@
 LTLIBPTH = @LTLIBPTH@
-LTLIBTHREAD = @LTLIBTHREAD@
+LTLIBMULTITHREAD = @LTLIBMULTITHREAD@
 LT_CONFIG_H = @LT_CONFIG_H@
 LT_DLLOADERS = @LT_DLLOADERS@
 LT_DLPREOPEN = @LT_DLPREOPEN@
@@ -1553,7 +1553,7 @@
 DISTCLEANFILES = $(pkgconfig_DATA) idmef-criteria-string.yac.h idmef-criteria-string.lex.c idmef-criteria-string.yac.c
 libpreludeincludedir = $(includedir)/
 libprelude_la_LIBADD = @LIBPRELUDE_LIBS@ $(LIBLTDL) $(top_builddir)/libmissing/libmissing.la libprelude-error/libprelude-error.la
-libprelude_la_LDFLAGS = $(GETADDRINFO_LIB) $(GETHOSTNAME_LIB) $(HOSTENT_LIB) $(INET_NTOP_LIB) $(INET_PTON_LIB) $(LIBSOCKET) $(LIB_POLL) $(LIB_PTHREAD_SIGMASK) $(LIB_SELECT) $(LTLIBINTL) $(LTLIBTHREAD) $(SERVENT_LIB) -no-undefined -version-info @LIBPRELUDE_SONAME@ -export-symbols-regex "^(idmef|_?prelude)_"
+libprelude_la_LDFLAGS = $(GETADDRINFO_LIB) $(GETHOSTNAME_LIB) $(HOSTENT_LIB) $(INET_NTOP_LIB) $(INET_PTON_LIB) $(LIBSOCKET) $(LIB_POLL) $(LIB_PTHREAD_SIGMASK) $(LIB_SELECT) $(LTLIBINTL) $(LTLIBMULTITHREAD) $(SERVENT_LIB) -no-undefined -version-info @LIBPRELUDE_SONAME@ -export-symbols-regex "^(idmef|_?prelude)_" -Wl,-u,pthread_atfork
 lib_LTLIBRARIES = libprelude.la
 BUILT_SOURCES = $(LTDLDEPS) 
 AM_YFLAGS = -d
--- prelude-admin/Makefile.in	2019-02-26 23:58:08.154668826 +0100
+++ prelude-admin/Makefile.in	2019-02-26 23:57:12.940785905 +0100
@@ -1062,7 +1062,7 @@
 LIBS = @LIBS@
 LIBSOCKET = @LIBSOCKET@
 LIBTESTS_LIBDEPS = @LIBTESTS_LIBDEPS@
+LIBMULTITHREAD = @LIBMULTITHREAD@
-LIBTHREAD = @LIBTHREAD@
 LIBTOOL = @LIBTOOL@
 LIB_NANOSLEEP = @LIB_NANOSLEEP@
 LIB_POLL = @LIB_POLL@
@@ -1086,7 +1086,7 @@
 LTLIBMULTITHREAD = @LTLIBMULTITHREAD@
 LTLIBOBJS = @LTLIBOBJS@
 LTLIBPTH = @LTLIBPTH@
+LTLIBMULTITHREAD = @LTLIBMULTITHREAD@
-LTLIBTHREAD = @LTLIBTHREAD@
 LT_CONFIG_H = @LT_CONFIG_H@
 LT_DLLOADERS = @LT_DLLOADERS@
 LT_DLPREOPEN = @LT_DLPREOPEN@
@@ -1480,7 +1480,7 @@
 			$(top_builddir)/src/variable.lo \
 		        $(top_builddir)/src/libprelude.la \
 			@PRELUDE_ADMIN_LIBS@ \
+			../libmissing/libmissing.la $(GETADDRINFO_LIB) $(GETHOSTNAME_LIB) $(HOSTENT_LIB) $(INET_NTOP_LIB) $(INET_PTON_LIB) $(LIBSOCKET) $(LIB_POLL) $(LIB_SELECT) $(LTLIBINTL) $(LTLIBMULTITHREAD) $(SERVENT_LIB)
-			../libmissing/libmissing.la $(GETADDRINFO_LIB) $(GETHOSTNAME_LIB) $(HOSTENT_LIB) $(INET_NTOP_LIB) $(INET_PTON_LIB) $(LIBSOCKET) $(LIB_POLL) $(LIB_SELECT) $(LTLIBINTL) $(LTLIBTHREAD) $(SERVENT_LIB)
 
 prelude_admin_SOURCES = \
 	prelude-admin.c		\
--- src/libprelude-error/Makefile.in	2018-12-23 22:01:05.090000000 +0100
+++ src/libprelude-error/Makefile.in	2019-02-27 00:00:34.842539289 +0100
@@ -1053,7 +1053,7 @@
 LIBS = @LIBS@
 LIBSOCKET = @LIBSOCKET@
 LIBTESTS_LIBDEPS = @LIBTESTS_LIBDEPS@
-LIBTHREAD = @LIBTHREAD@
+LIBMULTITHREAD = @LIBMULTITHREAD@
 LIBTOOL = @LIBTOOL@
 LIB_NANOSLEEP = @LIB_NANOSLEEP@
 LIB_POLL = @LIB_POLL@
@@ -1077,7 +1077,7 @@
 LTLIBMULTITHREAD = @LTLIBMULTITHREAD@
 LTLIBOBJS = @LTLIBOBJS@
 LTLIBPTH = @LTLIBPTH@
-LTLIBTHREAD = @LTLIBTHREAD@
+LTLIBMULTITHREAD = @LTLIBMULTITHREAD@
 LT_CONFIG_H = @LT_CONFIG_H@
 LT_DLLOADERS = @LT_DLLOADERS@
 LT_DLPREOPEN = @LT_DLPREOPEN@
@@ -1477,7 +1477,7 @@
 
 nodist_include_HEADERS = prelude-error.h
 noinst_LTLIBRARIES = libprelude-error.la
-libprelude_error_la_LIBADD = @LTLIBTHREAD@
+libprelude_error_la_LIBADD = @LTLIBMULTITHREAD@
 libprelude_error_la_LDFLAGS = -no-undefined
 libprelude_error_la_SOURCES = prelude-error.h prelude-error.c strsource.c strerror.c
 all: $(BUILT_SOURCES)
