fi
fi
], [with_libpthread="yes"])
+
+AC_SUBST([PTHREAD_LIBS])
if test "x$with_libpthread" = "xyes"
then
- AC_CHECK_LIB(pthread, pthread_create, [with_libpthread="yes"], [with_libpthread="no (libpthread not found)"], [])
+ SAVE_LIBS="$LIBS"
+ AC_CHECK_LIB(pthread, pthread_create, [], [with_libpthread="no (libpthread not found)"], [])
+ PTHREAD_LIBS="$LIBS"
+ LIBS="$SAVE_LIBS"
fi
if test "x$with_libpthread" = "xyes"
if test "x$LIBNETAPP_LIBS" = "x"
then
- LIBNETAPP_LIBS="-lpthread -lxml -ladt -lssl -lm -lcrypto -lz"
+ LIBNETAPP_LIBS="$PTHREAD_LIBS -lxml -ladt -lssl -lm -lcrypto -lz"
fi
AC_MSG_NOTICE([netapp LIBS: $LIBNETAPP_LIBS])
AC_MSG_NOTICE([Not checking for Intel Mic: Manually configured])
with_mic_cflags="-I$withval/include"
with_mic_ldpath="-L$withval/lib/Linux"
- with_mic_libs="-lMicAccessSDK -lscif -lpthread"
+ with_mic_libs="$PTHREAD_LIBS -lMicAccessSDK -lscif"
with_mic="yes"
fi; fi; fi
],
AC_CHECK_LIB(MicAccessSDK, MicInitAPI,
[with_mic_ldpath="$with_mic_ldpath"
- with_mic_libs="-lMicAccessSDK -lscif -lpthread"],
- [with_mic="no (symbol MicInitAPI not found)"],[-lscif -lpthread])
+ with_mic_libs="$PTHREAD_LIBS -lMicAccessSDK -lscif"],
+ [with_mic="no (symbol MicInitAPI not found)"],[$PTHREAD_LIBS -lscif])
CPPFLAGS="$SAVE_CPPFLAGS"
LDFLAGS="$SAVE_LDFLAGS"
collectd_tg_LDADD += -lm
endif
if BUILD_WITH_LIBPTHREAD
-collectd_tg_LDADD += -lpthread
+collectd_tg_LDADD += $(PTHREAD_LIBS)
endif
collectd_tg_LDADD += libcollectdclient/libcollectdclient.la
collectd_tg_DEPENDENCIES = libcollectdclient/libcollectdclient.la
pkglib_LTLIBRARIES += dns.la
dns_la_SOURCES = dns.c utils_dns.c utils_dns.h
dns_la_LDFLAGS = $(PLUGIN_LDFLAGS)
-dns_la_LIBADD = -lpcap -lpthread
+dns_la_LIBADD = $(PTHREAD_LIBS) -lpcap
endif
if BUILD_PLUGIN_DRBD
pkglib_LTLIBRARIES += drbd.la
drbd_la_SOURCES = drbd.c
drbd_la_LDFLAGS = $(PLUGIN_LDFLAGS)
-drbd_la_LIBADD = -lpthread
+drbd_la_LIBADD = $(PTHREAD_LIBS)
endif
if BUILD_PLUGIN_EMAIL
pkglib_LTLIBRARIES += email.la
email_la_SOURCES = email.c
email_la_LDFLAGS = $(PLUGIN_LDFLAGS)
-email_la_LIBADD = -lpthread
+email_la_LIBADD = $(PTHREAD_LIBS)
endif
if BUILD_PLUGIN_ENTROPY
utils_cmd_putval.c utils_cmd_putval.h \
utils_parse_option.h utils_parse_option.c
exec_la_LDFLAGS = $(PLUGIN_LDFLAGS)
-exec_la_LIBADD = -lpthread
+exec_la_LIBADD = $(PTHREAD_LIBS)
endif
if BUILD_PLUGIN_ETHSTAT
utils_fbhash.c utils_fbhash.h
network_la_CPPFLAGS = $(AM_CPPFLAGS)
network_la_LDFLAGS = $(PLUGIN_LDFLAGS)
-network_la_LIBADD = -lpthread
+network_la_LIBADD = $(PTHREAD_LIBS)
if BUILD_WITH_LIBSOCKET
network_la_LIBADD += -lsocket
endif
pkglib_LTLIBRARIES += notify_email.la
notify_email_la_SOURCES = notify_email.c
notify_email_la_LDFLAGS = $(PLUGIN_LDFLAGS)
-notify_email_la_LIBADD = -lesmtp -lssl -lcrypto -lpthread
+notify_email_la_LIBADD = $(PTHREAD_LIBS) -lesmtp -lssl -lcrypto
endif
if BUILD_PLUGIN_NOTIFY_NAGIOS
nut_la_SOURCES = nut.c
nut_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBUPSCLIENT_CFLAGS)
nut_la_LDFLAGS = $(PLUGIN_LDFLAGS)
-nut_la_LIBADD = -lpthread $(BUILD_WITH_LIBUPSCLIENT_LIBS)
+nut_la_LIBADD = $(PTHREAD_LIBS) $(BUILD_WITH_LIBUPSCLIENT_LIBS)
endif
if BUILD_PLUGIN_OLSRD
snmp_la_LIBADD += $(BUILD_WITH_LIBSNMP_LIBS)
endif
if BUILD_WITH_LIBPTHREAD
-snmp_la_LIBADD += -lpthread
+snmp_la_LIBADD += $(PTHREAD_LIBS)
endif
endif
pkglib_LTLIBRARIES += statsd.la
statsd_la_SOURCES = statsd.c
statsd_la_LDFLAGS = $(PLUGIN_LDFLAGS)
-statsd_la_LIBADD = liblatency.la -lpthread -lm
+statsd_la_LIBADD = $(PTHREAD_LIBS) liblatency.la -lm
endif
if BUILD_PLUGIN_SWAP
utils_cmd_putnotif.h utils_cmd_putnotif.c \
utils_parse_option.h utils_parse_option.c
unixsock_la_LDFLAGS = $(PLUGIN_LDFLAGS)
-unixsock_la_LIBADD = -lpthread
+unixsock_la_LIBADD = $(PTHREAD_LIBS)
endif
if BUILD_PLUGIN_UPTIME