summaryrefslogtreecommitdiffstats
path: root/configure.in
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 /configure.in
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
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in19
1 files changed, 15 insertions, 4 deletions
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)