diff options
author | NAKAMURA Takumi <geek4civic@gmail.com> | 2010-12-29 03:59:03 +0000 |
---|---|---|
committer | NAKAMURA Takumi <geek4civic@gmail.com> | 2010-12-29 03:59:03 +0000 |
commit | 0dc8439f54ca58bf417f68e79d0eb323b387c04e (patch) | |
tree | 2aa6a81b4f9947ee726cc2df1487f8971f78c766 /autoconf | |
parent | 5c083b174e755e17664e50dfd3638aedb0f2be2e (diff) |
autoconf: [PR7874] Add --disable-pthreads to suppress detecting pthreads on certain hosts.
This would be needed to build pthread*.dll-free distribution on recent MinGW-MSYS distros.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122621 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'autoconf')
-rw-r--r-- | autoconf/configure.ac | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/autoconf/configure.ac b/autoconf/configure.ac index eca0ae4f06..93a31c894a 100644 --- a/autoconf/configure.ac +++ b/autoconf/configure.ac @@ -530,6 +530,18 @@ case "$enableval" in esac AC_DEFINE_UNQUOTED([ENABLE_THREADS],$ENABLE_THREADS,[Define if threads enabled]) +dnl Allow disablement of pthread.h +AC_ARG_ENABLE(pthreads, + AS_HELP_STRING([--enable-pthreads], + [Use pthreads if available (default is YES)]),, + enableval=default) +case "$enableval" in + yes) AC_SUBST(ENABLE_PTHREADS,[1]) ;; + no) AC_SUBST(ENABLE_PTHREADS,[0]) ;; + default) AC_SUBST(ENABLE_PTHREADS,[1]) ;; + *) AC_MSG_ERROR([Invalid setting for --enable-pthreads. Use "yes" or "no"]) ;; +esac + dnl Allow building without position independent code AC_ARG_ENABLE(pic, AS_HELP_STRING([--enable-pic], @@ -1216,7 +1228,7 @@ AC_SEARCH_LIBS(mallinfo,malloc,AC_DEFINE([HAVE_MALLINFO],[1], dnl pthread locking functions are optional - but llvm will not be thread-safe dnl without locks. -if test "$ENABLE_THREADS" -eq 1 ; then +if test "$ENABLE_THREADS" -eq 1 && test "$ENABLE_PTHREADS" -eq 1 ; then AC_CHECK_LIB(pthread, pthread_mutex_init) AC_SEARCH_LIBS(pthread_mutex_lock,pthread, AC_DEFINE([HAVE_PTHREAD_MUTEX_LOCK],[1], @@ -1308,7 +1320,7 @@ AC_CHECK_HEADERS([sys/mman.h sys/param.h sys/resource.h sys/time.h]) AC_CHECK_HEADERS([sys/types.h sys/ioctl.h malloc/malloc.h mach/mach.h]) AC_CHECK_HEADERS([valgrind/valgrind.h]) AC_CHECK_HEADERS([fenv.h]) -if test "$ENABLE_THREADS" -eq 1 ; then +if test "$ENABLE_THREADS" -eq 1 && test "$ENABLE_PTHREADS" -eq 1 ; then AC_CHECK_HEADERS(pthread.h, AC_SUBST(HAVE_PTHREAD, 1), AC_SUBST(HAVE_PTHREAD, 0)) |