summaryrefslogtreecommitdiff
path: root/autoconf
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2009-05-19 22:18:56 +0000
committerOwen Anderson <resistor@mac.com>2009-05-19 22:18:56 +0000
commita86037084d8c2338c305533807b3213cfdc47a3e (patch)
treecedee6e1057dcd871c41a1e150497f264ef4bffa /autoconf
parent6aa219a18c59a9bc0b1eeb6eece09cfabaaefabe (diff)
downloadllvm-a86037084d8c2338c305533807b3213cfdc47a3e.tar.gz
llvm-a86037084d8c2338c305533807b3213cfdc47a3e.tar.bz2
llvm-a86037084d8c2338c305533807b3213cfdc47a3e.tar.xz
Split the ENABLE_THREADS #define in two. Now ENABLE_THREADS indicates the ability to run multiple threads at once in the JIT, and requires only
mutex support. LLVM_MULTITHREADED indicates (or will indicate) the ability to run LLVM itself across multiple threads, and requires atomics support. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72140 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'autoconf')
-rw-r--r--autoconf/configure.ac33
1 files changed, 16 insertions, 17 deletions
diff --git a/autoconf/configure.ac b/autoconf/configure.ac
index 56853e96bf..7f625d4bed 100644
--- a/autoconf/configure.ac
+++ b/autoconf/configure.ac
@@ -372,6 +372,7 @@ case "$enableval" in
default) AC_SUBST(ENABLE_THREADS,[1]) ;;
*) AC_MSG_ERROR([Invalid setting for --enable-threads. Use "yes" or "no"]) ;;
esac
+AC_DEFINE_UNQUOTED([ENABLE_THREADS],$ENABLE_THREADS,[Define if threads enabled])
dnl Allow building without position independent code
AC_ARG_ENABLE(pic,
@@ -897,24 +898,22 @@ if test "$llvm_cv_platform_type" = "Unix" ; then
fi
dnl atomic builtins are required for threading support.
-if test "$ENABLE_THREADS" -eq 1 ; then
- AC_MSG_CHECKING(for GCC atomic builtins)
- AC_LINK_IFELSE(
- AC_LANG_SOURCE(
- [[int main() {
- volatile unsigned long val = 1;
- __sync_synchronize();
- __sync_val_compare_and_swap(&val, 1, 0);
- return 0;
- }
- ]]),
- AC_MSG_RESULT(yes),
- AC_MSG_RESULT(no)
- AC_SUBST(ENABLE_THREADS, [0])
- AC_MSG_WARN([Threading support disabled because atomic builtins are missing]))
-fi
+AC_MSG_CHECKING(for GCC atomic builtins)
+AC_LINK_IFELSE(
+ AC_LANG_SOURCE(
+ [[int main() {
+ volatile unsigned long val = 1;
+ __sync_synchronize();
+ __sync_val_compare_and_swap(&val, 1, 0);
+ return 0;
+ }
+ ]]),
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(LLVM_MULTITHREADED, 1, Build multithreading support into LLVM),
+ AC_MSG_RESULT(no)
+ AC_DEFINE(LLVM_MULTITHREADED, 0, Build multithreading support into LLVM)
+ AC_MSG_WARN([LLVM will be built thread-unsafe because atomic builtins are missing]))
-AC_DEFINE_UNQUOTED([ENABLE_THREADS],$ENABLE_THREADS,[Define if threads enabled])
dnl===-----------------------------------------------------------------------===
dnl===