Commit 82c9cd05 authored by John Palmieri's avatar John Palmieri

* 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
parent f17c060c
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
......
......@@ -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)
......
......@@ -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
......@@ -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
......
......@@ -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
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment