summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn (J5) Palmieri <johnp@redhat.com>2006-10-26 18:06:07 +0000
committerJohn (J5) Palmieri <johnp@redhat.com>2006-10-26 18:06:07 +0000
commit82c9cd05cd19a397043db94025c7a80e75386e8a (patch)
treebcca99054997670fb765ae6d9ca815f150dd1e07
parentf17c060c7234cec9df8ce90628db299d3dd9c4b9 (diff)
* configure.in, dbus-1.pc.in: Check to see if thread methods
are in glibc or libpthread and add -lpthread to the link stage if it is the latter
-rw-r--r--ChangeLog6
-rw-r--r--configure.in19
-rw-r--r--dbus-1.pc.in2
-rw-r--r--dbus/Makefile.am2
-rw-r--r--test/name-test/Makefile.am6
-rw-r--r--tools/Makefile.am8
6 files changed, 30 insertions, 13 deletions
diff --git a/ChangeLog b/ChangeLog
index 09e0ca33..3fba2caf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2006-10-26 John (J5) Palmieri <johnp@redhat.com>
+
+ * configure.in, dbus-1.pc.in: Check to see if thread methods
+ are in glibc or libpthread and add -lpthread to the link stage
+ if it is the latter
+
2006-10-26 Thiago Macieira <thiago@kde.org>
* dbus/dbus-connection.c (_dbus_connection_open_internal): Fix
diff --git a/configure.in b/configure.in
index 9efd8178..2d5c713d 100644
--- a/configure.in
+++ b/configure.in
@@ -526,6 +526,8 @@ AC_CHECK_FUNC(gethostbyname,,[AC_CHECK_LIB(nsl,gethostbyname)])
AC_CHECK_FUNCS(vsnprintf vasprintf nanosleep usleep poll setenv unsetenv socketpair getgrouplist fpathconf)
+
+
AC_MSG_CHECKING(for dirfd)
AC_TRY_COMPILE([
#include <sys/types.h>
@@ -776,6 +778,10 @@ if $dbus_use_libxml; then
XML_CFLAGS=$LIBXML_CFLAGS
fi
+# Thread lib detection
+AC_CHECK_FUNC(pthread_cond_timedwait,,[AC_CHECK_LIB(pthread,pthread_cond_timedwait,
+ [THREAD_LIBS="-lpthread"])])
+
# SELinux detection
if test x$enable_selinux = xno ; then
have_selinux=no;
@@ -810,7 +816,12 @@ fi
AM_CONDITIONAL(HAVE_SELINUX, test x$have_selinux = xyes)
if test x$have_selinux = xyes ; then
- SELINUX_LIBS="-lselinux -lpthread"
+ # the selinux code creates threads
+ # which requires libpthread even on linux
+ AC_CHECK_FUNC(pthread_create,,[AC_CHECK_LIB(pthread,pthread_create,
+ [SELINUX_THREAD_LIBS="-lpthread"])])
+
+ SELINUX_LIBS="-lselinux $SELINUX_THREAD_LIBS"
AC_DEFINE(HAVE_SELINUX,1,[SELinux support])
else
SELINUX_LIBS=
@@ -872,17 +883,17 @@ AM_CONDITIONAL(HAVE_CONSOLE_OWNER_FILE, test x$have_console_owner_file = xyes)
#### Set up final flags
DBUS_CLIENT_CFLAGS=
-DBUS_CLIENT_LIBS=
+DBUS_CLIENT_LIBS="$THREAD_LIBS"
AC_SUBST(DBUS_CLIENT_CFLAGS)
AC_SUBST(DBUS_CLIENT_LIBS)
DBUS_BUS_CFLAGS=$XML_CFLAGS
-DBUS_BUS_LIBS="$XML_LIBS $SELINUX_LIBS $INTLLIBS"
+DBUS_BUS_LIBS="$XML_LIBS $SELINUX_LIBS $INTLLIBS $THREAD_LIBS"
AC_SUBST(DBUS_BUS_CFLAGS)
AC_SUBST(DBUS_BUS_LIBS)
DBUS_TEST_CFLAGS=
-DBUS_TEST_LIBS=
+DBUS_TEST_LIBS="$THREAD_LIBS"
AC_SUBST(DBUS_TEST_CFLAGS)
AC_SUBST(DBUS_TEST_LIBS)
diff --git a/dbus-1.pc.in b/dbus-1.pc.in
index 174d87dd..889f72d5 100644
--- a/dbus-1.pc.in
+++ b/dbus-1.pc.in
@@ -9,6 +9,6 @@ session_bus_services_dir=@EXPANDED_DATADIR@/dbus-1/services
Name: dbus
Description: Free desktop message bus
Version: @VERSION@
-Libs: -L${libdir} -ldbus-1
+Libs: -L${libdir} -ldbus-1 @DBUS_CLIENT_LIBS@
Cflags: -I${includedir}/dbus-1.0 -I${libdir}/dbus-1.0/include
diff --git a/dbus/Makefile.am b/dbus/Makefile.am
index c1d7bc2a..b8d97783 100644
--- a/dbus/Makefile.am
+++ b/dbus/Makefile.am
@@ -185,7 +185,7 @@ noinst_PROGRAMS=$(TESTS)
dbus_test_SOURCES= \
dbus-test-main.c
-dbus_test_LDADD=libdbus-convenience.la
+dbus_test_LDADD=libdbus-convenience.la $(DBUS_TEST_LIBS)
dbus_test_LDFLAGS=@R_DYNAMIC_LDFLAG@
## mop up the gcov files
diff --git a/test/name-test/Makefile.am b/test/name-test/Makefile.am
index ea35bc73..eec358aa 100644
--- a/test/name-test/Makefile.am
+++ b/test/name-test/Makefile.am
@@ -21,19 +21,19 @@ noinst_PROGRAMS=test-names test-pending-call-dispatch test-threads-init
test_names_SOURCES= \
test-names.c
-test_names_LDADD=$(top_builddir)/dbus/libdbus-convenience.la
+test_names_LDADD=$(top_builddir)/dbus/libdbus-convenience.la $(DBUS_TEST_LIBS)
test_names_LDFLAGS=@R_DYNAMIC_LDFLAG@
test_pending_call_dispatch_SOURCES = \
test-pending-call-dispatch.c
-test_pending_call_dispatch_LDADD=$(top_builddir)/dbus/libdbus-convenience.la
+test_pending_call_dispatch_LDADD=$(top_builddir)/dbus/libdbus-convenience.la $(DBUS_TEST_LIBS)
test_pending_call_dispatch_LDFLAGS=@R_DYNAMIC_LDFLAG@
test_threads_init_SOURCES = \
test-threads-init.c
-test_threads_init_LDADD=$(top_builddir)/dbus/libdbus-convenience.la
+test_threads_init_LDADD=$(top_builddir)/dbus/libdbus-convenience.la $(DBUS_TEST_LIBS)
test_threads_init_LDFLAGS=@R_DYNAMIC_LDFLAG@
endif
diff --git a/tools/Makefile.am b/tools/Makefile.am
index 015354d7..c6814e9d 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -25,16 +25,16 @@ dbus_cleanup_sockets_SOURCES= \
dbus_uuidgen_SOURCES= \
dbus-uuidgen.c
-dbus_send_LDADD= $(top_builddir)/dbus/libdbus-1.la
+dbus_send_LDADD= $(top_builddir)/dbus/libdbus-1.la $(DBUS_CLIENT_LIBS)
dbus_send_LDFLAGS=@R_DYNAMIC_LDFLAG@
-dbus_monitor_LDADD= $(top_builddir)/dbus/libdbus-1.la
+dbus_monitor_LDADD= $(top_builddir)/dbus/libdbus-1.la $(DBUS_CLIENT_LIBS)
dbus_monitor_LDFLAGS=@R_DYNAMIC_LDFLAG@
-dbus_uuidgen_LDADD= $(top_builddir)/dbus/libdbus-1.la
+dbus_uuidgen_LDADD= $(top_builddir)/dbus/libdbus-1.la $(DBUS_CLIENT_LIBS)
dbus_uuidgen_LDFLAGS=@R_DYNAMIC_LDFLAG@
-dbus_launch_LDADD= $(DBUS_X_LIBS)
+dbus_launch_LDADD= $(DBUS_X_LIBS) $(DBUS_CLIENT_LIBS)
dbus_launch_LDFLAGS=@R_DYNAMIC_LDFLAG@
man_MANS = dbus-send.1 dbus-monitor.1 dbus-launch.1 dbus-cleanup-sockets.1 dbus-uuidgen.1