llvm.org GIT mirror llvm / 0dc8439
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 NAKAMURA Takumi 8 years ago
2 changed file(s) with 42 addition(s) and 8 deletion(s). Raw diff Collapse all Expand all
529529 esac
530530 AC_DEFINE_UNQUOTED([ENABLE_THREADS],$ENABLE_THREADS,[Define if threads enabled])
531531
532 dnl Allow disablement of pthread.h
533 AC_ARG_ENABLE(pthreads,
534 AS_HELP_STRING([--enable-pthreads],
535 [Use pthreads if available (default is YES)]),,
536 enableval=default)
537 case "$enableval" in
538 yes) AC_SUBST(ENABLE_PTHREADS,[1]) ;;
539 no) AC_SUBST(ENABLE_PTHREADS,[0]) ;;
540 default) AC_SUBST(ENABLE_PTHREADS,[1]) ;;
541 *) AC_MSG_ERROR([Invalid setting for --enable-pthreads. Use "yes" or "no"]) ;;
542 esac
543
532544 dnl Allow building without position independent code
533545 AC_ARG_ENABLE(pic,
534546 AS_HELP_STRING([--enable-pic],
12151227
12161228 dnl pthread locking functions are optional - but llvm will not be thread-safe
12171229 dnl without locks.
1218 if test "$ENABLE_THREADS" -eq 1 ; then
1230 if test "$ENABLE_THREADS" -eq 1 && test "$ENABLE_PTHREADS" -eq 1 ; then
12191231 AC_CHECK_LIB(pthread, pthread_mutex_init)
12201232 AC_SEARCH_LIBS(pthread_mutex_lock,pthread,
12211233 AC_DEFINE([HAVE_PTHREAD_MUTEX_LOCK],[1],
13071319 AC_CHECK_HEADERS([sys/types.h sys/ioctl.h malloc/malloc.h mach/mach.h])
13081320 AC_CHECK_HEADERS([valgrind/valgrind.h])
13091321 AC_CHECK_HEADERS([fenv.h])
1310 if test "$ENABLE_THREADS" -eq 1 ; then
1322 if test "$ENABLE_THREADS" -eq 1 && test "$ENABLE_PTHREADS" -eq 1 ; then
13111323 AC_CHECK_HEADERS(pthread.h,
13121324 AC_SUBST(HAVE_PTHREAD, 1),
13131325 AC_SUBST(HAVE_PTHREAD, 0))
690690 ENABLE_DOCS
691691 ENABLE_DOXYGEN
692692 ENABLE_THREADS
693 ENABLE_PTHREADS
693694 ENABLE_PIC
694695 ENABLE_SHARED
695696 ENABLE_TIMESTAMPS
14141415 --enable-docs Build documents (default is YES)
14151416 --enable-doxygen Build doxygen documentation (default is NO)
14161417 --enable-threads Use threads if available (default is YES)
1418 --enable-pthreads Use pthreads if available (default is YES)
14171419 --enable-pic Build LLVM with Position Independent Code (default
14181420 is YES)
14191421 --enable-shared Build a shared library and link tools against it
49344936 _ACEOF
49354937
49364938
4939 # Check whether --enable-pthreads was given.
4940 if test "${enable_pthreads+set}" = set; then
4941 enableval=$enable_pthreads;
4942 else
4943 enableval=default
4944 fi
4945
4946 case "$enableval" in
4947 yes) ENABLE_PTHREADS=1
4948 ;;
4949 no) ENABLE_PTHREADS=0
4950 ;;
4951 default) ENABLE_PTHREADS=1
4952 ;;
4953 *) { { echo "$as_me:$LINENO: error: Invalid setting for --enable-pthreads. Use \"yes\" or \"no\"" >&5
4954 echo "$as_me: error: Invalid setting for --enable-pthreads. Use \"yes\" or \"no\"" >&2;}
4955 { (exit 1); exit 1; }; } ;;
4956 esac
4957
49374958 # Check whether --enable-pic was given.
49384959 if test "${enable_pic+set}" = set; then
49394960 enableval=$enable_pic;
1151711538 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1151811539 lt_status=$lt_dlunknown
1151911540 cat > conftest.$ac_ext <
11520 #line 11521 "configure"
11541 #line 11542 "configure"
1152111542 #include "confdefs.h"
1152211543
1152311544 #if HAVE_DLFCN_H
1399314014 fi
1399414015
1399514016
13996 if test "$ENABLE_THREADS" -eq 1 ; then
14017 if test "$ENABLE_THREADS" -eq 1 && test "$ENABLE_PTHREADS" -eq 1 ; then
1399714018
1399814019 { echo "$as_me:$LINENO: checking for pthread_mutex_init in -lpthread" >&5
1399914020 echo $ECHO_N "checking for pthread_mutex_init in -lpthread... $ECHO_C" >&6; }
1689616917
1689716918 done
1689816919
16899 if test "$ENABLE_THREADS" -eq 1 ; then
16920 if test "$ENABLE_THREADS" -eq 1 && test "$ENABLE_PTHREADS" -eq 1 ; then
1690016921
1690116922 for ac_header in pthread.h
1690216923 do
2178721808 ENABLE_DOCS!$ENABLE_DOCS$ac_delim
2178821809 ENABLE_DOXYGEN!$ENABLE_DOXYGEN$ac_delim
2178921810 ENABLE_THREADS!$ENABLE_THREADS$ac_delim
21811 ENABLE_PTHREADS!$ENABLE_PTHREADS$ac_delim
2179021812 ENABLE_PIC!$ENABLE_PIC$ac_delim
2179121813 ENABLE_SHARED!$ENABLE_SHARED$ac_delim
2179221814 ENABLE_TIMESTAMPS!$ENABLE_TIMESTAMPS$ac_delim
2179421816 LLVM_ENUM_TARGETS!$LLVM_ENUM_TARGETS$ac_delim
2179521817 LLVM_ENUM_ASM_PRINTERS!$LLVM_ENUM_ASM_PRINTERS$ac_delim
2179621818 LLVM_ENUM_ASM_PARSERS!$LLVM_ENUM_ASM_PARSERS$ac_delim
21797 LLVM_ENUM_DISASSEMBLERS!$LLVM_ENUM_DISASSEMBLERS$ac_delim
2179821819 _ACEOF
2179921820
2180021821 if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
2183621857 ac_delim='%!_!# '
2183721858 for ac_last_try in false false false false false :; do
2183821859 cat >conf$$subs.sed <<_ACEOF
21860 LLVM_ENUM_DISASSEMBLERS!$LLVM_ENUM_DISASSEMBLERS$ac_delim
2183921861 ENABLE_CBE_PRINTF_A!$ENABLE_CBE_PRINTF_A$ac_delim
2184021862 CLANGPATH!$CLANGPATH$ac_delim
2184121863 CLANGXXPATH!$CLANGXXPATH$ac_delim
2193221954 ALL_BINDINGS!$ALL_BINDINGS$ac_delim
2193321955 OCAML_LIBDIR!$OCAML_LIBDIR$ac_delim
2193421956 ENABLE_VISIBILITY_INLINES_HIDDEN!$ENABLE_VISIBILITY_INLINES_HIDDEN$ac_delim
21935 RPATH!$RPATH$ac_delim
2193621957 _ACEOF
2193721958
2193821959 if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
2197421995 ac_delim='%!_!# '
2197521996 for ac_last_try in false false false false false :; do
2197621997 cat >conf$$subs.sed <<_ACEOF
21998 RPATH!$RPATH$ac_delim
2197721999 RDYNAMIC!$RDYNAMIC$ac_delim
2197822000 LIBOBJS!$LIBOBJS$ac_delim
2197922001 LTLIBOBJS!$LTLIBOBJS$ac_delim
2198022002 _ACEOF
2198122003
21982 if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 3; then
22004 if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 4; then
2198322005 break
2198422006 elif $ac_last_try; then
2198522007 { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5