aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Carroll <thecarrolls@jiminger.com>2011-07-12 00:52:54 -0400
committerJim Carroll <thecarrolls@jiminger.com>2011-07-20 00:58:28 -0400
commit33aad0ee9e75e4665aff708d117c0cfb55229bc0 (patch)
tree8a4d4d7162898a5a7e7b9306d1e6ff04b5d438b8
parent7c17463d76f8015ba8339df973b47d78c1ff9817 (diff)
Updated the build to allow --enable-pthreads to select the pthread threading implementation.
-rw-r--r--configure.in21
-rw-r--r--xbmc/threads/platform/platform.select9
2 files changed, 19 insertions, 11 deletions
diff --git a/configure.in b/configure.in
index 129b2c1a82..1d8baed65f 100644
--- a/configure.in
+++ b/configure.in
@@ -318,6 +318,12 @@ AC_ARG_ENABLE([external-ffmpeg],
[use_external_ffmpeg=$enableval],
[use_external_ffmpeg=$use_external_libraries])
+AC_ARG_ENABLE([pthreads],
+ [AS_HELP_STRING([--enable-pthreads],
+ [prefer the use of pthreads over boost (default is to use boost for threading) 'Linux only'])],
+ [use_pthreads=$enableval],
+ [use_pthreads=no])
+
### End of external library options
if test "x$host_vendor" != "xapple"; then
@@ -527,7 +533,6 @@ AC_CHECK_HEADER([sys/inotify.h], AC_DEFINE([HAVE_INOTIFY],[1],[Define if we have
# Checks for boost headers using CXX instead of CC
AC_LANG_PUSH([C++])
AC_CHECK_HEADER([boost/shared_ptr.hpp],, AC_MSG_ERROR($missing_library))
-AC_CHECK_HEADER([boost/thread.hpp],, AC_MSG_ERROR($missing_library))
AC_LANG_POP([C++])
# Checks for platforms libraries.
@@ -600,7 +605,19 @@ AC_CHECK_LIB([ssh], [sftp_tell64],, AC_MSG_RESULT([Could not find suitab
AC_CHECK_LIB([smbclient], [main],, AC_MSG_ERROR($missing_library))
AC_CHECK_LIB([bluetooth], [hci_devid],, AC_MSG_RESULT([Could not find suitable version of libbluetooth]))
AC_CHECK_LIB([yajl], [main],, AC_MSG_ERROR($missing_library))
-AC_CHECK_LIB([boost_thread],[main],, AC_MSG_ERROR($missing_library))
+AC_LANG_PUSH([C++])
+if test "$use_pthreads" = "no"; then
+ AC_CHECK_HEADER([boost/thread.hpp],, AC_MSG_ERROR($missing_library))
+ AC_CHECK_LIB([boost_thread],[main],, AC_MSG_ERROR($missing_library))
+ AC_DEFINE([USE_BOOST_THREADING], [1], [Whether to use boost as the threading implementation.])
+ final_message="$final_message\n Threading:\tBoost"
+else
+ AC_CHECK_HEADER([boost/thread.hpp],AC_CHECK_LIB([boost_thread],[main],,), [Missing the boost threading libraries. Using pthreads])
+ AC_DEFINE([USE_PTHREADS_THREADING], [1], [Whether to use pthreads as the threading implementation.])
+ final_message="$final_message\n Threading:\tpthreads"
+fi
+AC_LANG_POP([C++])
+
PKG_CHECK_MODULES([FONTCONFIG], [fontconfig],
[INCLUDES="$INCLUDES $FONTCONFIG_CFLAGS"; LIBS="$LIBS $FONTCONFIG_LIBS"],
AC_MSG_ERROR($missing_library))
diff --git a/xbmc/threads/platform/platform.select b/xbmc/threads/platform/platform.select
index e20f35b17e..a8a2ef8dd5 100644
--- a/xbmc/threads/platform/platform.select
+++ b/xbmc/threads/platform/platform.select
@@ -27,15 +27,6 @@
#define USE_BOOST_THREADING 1
#endif
-// currently just hack it
-//#define USE_BOOST_THREADING 1
-#define USE_PTHREADS_THREADING 1
-
-/**
- * Eventually there should be c-preprocessor logic here that selects the
- * platform implementation based on some compiler flags or config settings
- */
-
#ifdef USE_BOOST_THREADING
#define USE_BOOST_LOCKING 1
#define USE_BOOST_TLS 1