From 66efe896483c58f3ef9bd218c02bb7ea604f68ee Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 2 Oct 2012 14:55:32 -0400 Subject: [PATCH] Check for pthreads --- configure.ac | 7 +++++++ src/Makefile.am | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/configure.ac b/configure.ac index 93c08fdfb..571f96b28 100644 --- a/configure.ac +++ b/configure.ac @@ -100,6 +100,13 @@ esac AC_MSG_RESULT([$hb_os_win32]) AM_CONDITIONAL(OS_WIN32, test "$hb_os_win32" = "yes") +have_pthread=false +AX_PTHREAD([have_pthread=true]) +if $have_pthread; then + AC_DEFINE(HAVE_PTHREAD, 1, [Have POSIX threads]) +fi +AM_CONDITIONAL(HAVE_PTHREAD, $have_pthread) + dnl ========================================================================== have_ot=true diff --git a/src/Makefile.am b/src/Makefile.am index d1a94cd2a..d91113a7f 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -100,6 +100,11 @@ HBHEADERS += \ $(NULL) endif +if HAVE_PTHREAD +HBCFLAGS += $(PTHREAD_CFLAGS) +HBLIBS += $(PTHREAD_LIBS) +endif + if HAVE_GLIB HBCFLAGS += $(GLIB_CFLAGS) HBLIBS += $(GLIB_LIBS)