llvm.org GIT mirror llvm / 0a262ba
For PR616: These patches make threading optional in LLVM. The configuration scripts are now modified to accept a --disable-threads switch. If this is used, the Mutex class will be implemented with all functions as no-op. Furthermore, linking against libpthread will not be done. Finally, the ParallelJIT example needs libpthread so its makefile was changed to always add -lpthread to the link line. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23003 91177308-0d34-0410-b5e6-96231b3b80d8 Reid Spencer 14 years ago
6 changed file(s) with 118 addition(s) and 53 deletion(s). Raw diff Collapse all Expand all
228228 default) AC_SUBST(ENABLE_DOXYGEN,[0]) ;;
229229 *) AC_MSG_ERROR([Invalid setting for --enable-doxygen. Use "yes" or "no"]) ;;
230230 esac
231
232 dnl Allow disablement of threads
233 AC_ARG_ENABLE(threads,
234 AS_HELP_STRING([--enable-threads],
235 [Use threads if available (default is YES)]),,
236 enableval=yes)
237 case "$enableval" in
238 yes) AC_SUBST(ENABLE_THREADS,[1]) ;;
239 no) AC_SUBST(ENABLE_THREADS,[0]) ;;
240 *) AC_MSG_ERROR([Invalid setting for --enable-threads. Use "yes" or "no"]) ;;
241 esac
242 AC_DEFINE_UNQUOTED([ENABLE_THREADS],$ENABLE_THREADS,[Define if threads enabled])
231243
232244 dnl Allow specific targets to be specified for building (or not)
233245 TARGETS_TO_BUILD=""
446458
447459 dnl pthread locking functions are optional - but llvm will not be thread-safe
448460 dnl without locks.
449 AC_CHECK_LIB(pthread,pthread_mutex_init)
450 AC_SEARCH_LIBS(pthread_mutex_lock,pthread,
451 AC_DEFINE([HAVE_PTHREAD_MUTEX_LOCK],[1],
452 [Have pthread_mutex_lock]))
461 if test "$ENABLE_THREADS" -eq 1 ; then
462 AC_CHECK_LIB(pthread,pthread_mutex_init)
463 AC_SEARCH_LIBS(pthread_mutex_lock,pthread,
464 AC_DEFINE([HAVE_PTHREAD_MUTEX_LOCK],[1],
465 [Have pthread_mutex_lock]))
466 fi
453467
454468 dnl===-----------------------------------------------------------------------===
455469 dnl===
469483 AC_HEADER_TIME
470484
471485 AC_CHECK_HEADERS([dlfcn.h execinfo.h fcntl.h inttypes.h limits.h link.h])
472 AC_CHECK_HEADERS([malloc.h pthread.h signal.h stdint.h unistd.h utime.h])
473 AC_CHECK_HEADERS([windows.h])
486 AC_CHECK_HEADERS([malloc.h signal.h stdint.h unistd.h utime.h windows.h])
474487 AC_CHECK_HEADERS([sys/mman.h sys/param.h sys/resource.h sys/time.h sys/types.h])
475488 AC_CHECK_HEADERS([rw/stdex/hash_map.h rw/stdex/hash_set.h])
489 if test "$ENABLE_THREADS" -eq 1 ; then
490 AC_CHECK_HEADERS(pthread.h)
491 fi
476492
477493 dnl===-----------------------------------------------------------------------===
478494 dnl===
474474 # include
475475 #endif"
476476
477 ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS LLVM_COPYRIGHT subdirs build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os OS LLVM_ON_UNIX LLVM_ON_WIN32 ARCH ENDIAN CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT ENABLE_OPTIMIZED JIT ENABLE_DOXYGEN TARGETS_TO_BUILD CPP CXX CXXFLAGS ac_ct_CXX LEX LEXLIB LEX_OUTPUT_ROOT FLEX YACC BISON ifGNUmake LN_S CMP CP DATE FIND GREP MKDIR MV RANLIB ac_ct_RANLIB RM SED TAR GRAPHVIZ GV INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA BZIP2 DOT DOXYGEN ETAGS GROFF GZIP POD2HTML POD2MAN RUNTEST TCLSH ZIP EGREP INSTALL_LTDL_TRUE INSTALL_LTDL_FALSE CONVENIENCE_LTDL_TRUE CONVENIENCE_LTDL_FALSE LIBADD_DL ECHO AR ac_ct_AR STRIP ac_ct_STRIP CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL ETAGSFLAGS LLVMGCC LLVMGXX ALLOCA MMAP_FILE LLVMCC1 LLVMCC1PLUS LLVMGCCDIR SHLIBEXT LLVM_PREFIX LLVM_BINDIR LLVM_LIBDIR LLVM_DATADIR LLVM_DOCSDIR LLVM_ETCDIR LLVM_INCLUDEDIR LLVM_INFODIR LLVM_MANDIR LLVM_CONFIGTIME LIBOBJS LTLIBOBJS'
477 ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS LLVM_COPYRIGHT subdirs build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os OS LLVM_ON_UNIX LLVM_ON_WIN32 ARCH ENDIAN CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT ENABLE_OPTIMIZED JIT ENABLE_DOXYGEN ENABLE_THREADS TARGETS_TO_BUILD CPP CXX CXXFLAGS ac_ct_CXX LEX LEXLIB LEX_OUTPUT_ROOT FLEX YACC BISON ifGNUmake LN_S CMP CP DATE FIND GREP MKDIR MV RANLIB ac_ct_RANLIB RM SED TAR GRAPHVIZ GV INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA BZIP2 DOT DOXYGEN ETAGS GROFF GZIP POD2HTML POD2MAN RUNTEST TCLSH ZIP EGREP INSTALL_LTDL_TRUE INSTALL_LTDL_FALSE CONVENIENCE_LTDL_TRUE CONVENIENCE_LTDL_FALSE LIBADD_DL ECHO AR ac_ct_AR STRIP ac_ct_STRIP CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL ETAGSFLAGS LLVMGCC LLVMGXX ALLOCA MMAP_FILE LLVMCC1 LLVMCC1PLUS LLVMGCCDIR SHLIBEXT LLVM_PREFIX LLVM_BINDIR LLVM_LIBDIR LLVM_DATADIR LLVM_DOCSDIR LLVM_ETCDIR LLVM_INCLUDEDIR LLVM_INFODIR LLVM_MANDIR LLVM_CONFIGTIME LIBOBJS LTLIBOBJS'
478478 ac_subst_files=''
479479
480480 # Initialize some variables set by options.
10351035 --enable-optimized
10361036 --enable-jit Enable Just In Time Compiling (default is YES)
10371037 --enable-doxygen Build doxygen documentation (default is NO)
1038 --enable-threads Use threads if available (default is YES)
10381039 --enable-target Build specific host targets:
10391040 all,host-only,{target-name} (default=all)
10401041 --enable-ltdl-install install libltdl
30243025 { (exit 1); exit 1; }; } ;;
30253026 esac
30263027
3028 # Check whether --enable-threads or --disable-threads was given.
3029 if test "${enable_threads+set}" = set; then
3030 enableval="$enable_threads"
3031
3032 else
3033 enableval=yes
3034 fi;
3035 case "$enableval" in
3036 yes) ENABLE_THREADS=1
3037 ;;
3038 no) ENABLE_THREADS=0
3039 ;;
3040 *) { { echo "$as_me:$LINENO: error: Invalid setting for --enable-threads. Use \"yes\" or \"no\"" >&5
3041 echo "$as_me: error: Invalid setting for --enable-threads. Use \"yes\" or \"no\"" >&2;}
3042 { (exit 1); exit 1; }; } ;;
3043 esac
3044
3045 cat >>confdefs.h <<_ACEOF
3046 #define ENABLE_THREADS $ENABLE_THREADS
3047 _ACEOF
3048
3049
30273050 TARGETS_TO_BUILD=""
30283051 # Check whether --enable-targets or --disable-targets was given.
30293052 if test "${enable_targets+set}" = set; then
83328355 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
83338356 lt_status=$lt_dlunknown
83348357 cat > conftest.$ac_ext <
8335 #line 8336 "configure"
8358 #line 8359 "configure"
83368359 #include "confdefs.h"
83378360
83388361 #if HAVE_DLFCN_H
1032310346 ;;
1032410347 *-*-irix6*)
1032510348 # Find out which ABI we are using.
10326 echo '#line 10327 "configure"' > conftest.$ac_ext
10349 echo '#line 10350 "configure"' > conftest.$ac_ext
1032710350 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
1032810351 (eval $ac_compile) 2>&5
1032910352 ac_status=$?
1080810831
1080910832
1081010833 # Provide some information about the compiler.
10811 echo "$as_me:10812:" \
10834 echo "$as_me:10835:" \
1081210835 "checking for Fortran 77 compiler version" >&5
1081310836 ac_compiler=`set X $ac_compile; echo $2`
1081410837 { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5
1186511888 -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
1186611889 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
1186711890 -e 's:$: $lt_compiler_flag:'`
11868 (eval echo "\"\$as_me:11869: $lt_compile\"" >&5)
11891 (eval echo "\"\$as_me:11892: $lt_compile\"" >&5)
1186911892 (eval "$lt_compile" 2>conftest.err)
1187011893 ac_status=$?
1187111894 cat conftest.err >&5
11872 echo "$as_me:11873: \$? = $ac_status" >&5
11895 echo "$as_me:11896: \$? = $ac_status" >&5
1187311896 if (exit $ac_status) && test -s "$ac_outfile"; then
1187411897 # The compiler can only warn and ignore the option if not recognized
1187511898 # So say no if there are warnings
1210812131 -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
1210912132 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
1211012133 -e 's:$: $lt_compiler_flag:'`
12111 (eval echo "\"\$as_me:12112: $lt_compile\"" >&5)
12134 (eval echo "\"\$as_me:12135: $lt_compile\"" >&5)
1211212135 (eval "$lt_compile" 2>conftest.err)
1211312136 ac_status=$?
1211412137 cat conftest.err >&5
12115 echo "$as_me:12116: \$? = $ac_status" >&5
12138 echo "$as_me:12139: \$? = $ac_status" >&5
1211612139 if (exit $ac_status) && test -s "$ac_outfile"; then
1211712140 # The compiler can only warn and ignore the option if not recognized
1211812141 # So say no if there are warnings
1216812191 -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
1216912192 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
1217012193 -e 's:$: $lt_compiler_flag:'`
12171 (eval echo "\"\$as_me:12172: $lt_compile\"" >&5)
12194 (eval echo "\"\$as_me:12195: $lt_compile\"" >&5)
1217212195 (eval "$lt_compile" 2>out/conftest.err)
1217312196 ac_status=$?
1217412197 cat out/conftest.err >&5
12175 echo "$as_me:12176: \$? = $ac_status" >&5
12198 echo "$as_me:12199: \$? = $ac_status" >&5
1217612199 if (exit $ac_status) && test -s out/conftest2.$ac_objext
1217712200 then
1217812201 # The compiler can only warn and ignore the option if not recognized
1435314376 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1435414377 lt_status=$lt_dlunknown
1435514378 cat > conftest.$ac_ext <
14356 #line 14357 "configure"
14379 #line 14380 "configure"
1435714380 #include "confdefs.h"
1435814381
1435914382 #if HAVE_DLFCN_H
1445114474 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1445214475 lt_status=$lt_dlunknown
1445314476 cat > conftest.$ac_ext <
14454 #line 14455 "configure"
14477 #line 14478 "configure"
1445514478 #include "confdefs.h"
1445614479
1445714480 #if HAVE_DLFCN_H
1664416667 -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
1664516668 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
1664616669 -e 's:$: $lt_compiler_flag:'`
16647 (eval echo "\"\$as_me:16648: $lt_compile\"" >&5)
16670 (eval echo "\"\$as_me:16671: $lt_compile\"" >&5)
1664816671 (eval "$lt_compile" 2>conftest.err)
1664916672 ac_status=$?
1665016673 cat conftest.err >&5
16651 echo "$as_me:16652: \$? = $ac_status" >&5
16674 echo "$as_me:16675: \$? = $ac_status" >&5
1665216675 if (exit $ac_status) && test -s "$ac_outfile"; then
1665316676 # The compiler can only warn and ignore the option if not recognized
1665416677 # So say no if there are warnings
1670416727 -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
1670516728 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
1670616729 -e 's:$: $lt_compiler_flag:'`
16707 (eval echo "\"\$as_me:16708: $lt_compile\"" >&5)
16730 (eval echo "\"\$as_me:16731: $lt_compile\"" >&5)
1670816731 (eval "$lt_compile" 2>out/conftest.err)
1670916732 ac_status=$?
1671016733 cat out/conftest.err >&5
16711 echo "$as_me:16712: \$? = $ac_status" >&5
16734 echo "$as_me:16735: \$? = $ac_status" >&5
1671216735 if (exit $ac_status) && test -s out/conftest2.$ac_objext
1671316736 then
1671416737 # The compiler can only warn and ignore the option if not recognized
1806518088 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1806618089 lt_status=$lt_dlunknown
1806718090 cat > conftest.$ac_ext <
18068 #line 18069 "configure"
18091 #line 18092 "configure"
1806918092 #include "confdefs.h"
1807018093
1807118094 #if HAVE_DLFCN_H
1816318186 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1816418187 lt_status=$lt_dlunknown
1816518188 cat > conftest.$ac_ext <
18166 #line 18167 "configure"
18189 #line 18190 "configure"
1816718190 #include "confdefs.h"
1816818191
1816918192 #if HAVE_DLFCN_H
1900019023 -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
1900119024 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
1900219025 -e 's:$: $lt_compiler_flag:'`
19003 (eval echo "\"\$as_me:19004: $lt_compile\"" >&5)
19026 (eval echo "\"\$as_me:19027: $lt_compile\"" >&5)
1900419027 (eval "$lt_compile" 2>conftest.err)
1900519028 ac_status=$?
1900619029 cat conftest.err >&5
19007 echo "$as_me:19008: \$? = $ac_status" >&5
19030 echo "$as_me:19031: \$? = $ac_status" >&5
1900819031 if (exit $ac_status) && test -s "$ac_outfile"; then
1900919032 # The compiler can only warn and ignore the option if not recognized
1901019033 # So say no if there are warnings
1906019083 -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
1906119084 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
1906219085 -e 's:$: $lt_compiler_flag:'`
19063 (eval echo "\"\$as_me:19064: $lt_compile\"" >&5)
19086 (eval echo "\"\$as_me:19087: $lt_compile\"" >&5)
1906419087 (eval "$lt_compile" 2>out/conftest.err)
1906519088 ac_status=$?
1906619089 cat out/conftest.err >&5
19067 echo "$as_me:19068: \$? = $ac_status" >&5
19090 echo "$as_me:19091: \$? = $ac_status" >&5
1906819091 if (exit $ac_status) && test -s out/conftest2.$ac_objext
1906919092 then
1907019093 # The compiler can only warn and ignore the option if not recognized
2109921122 -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
2110021123 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
2110121124 -e 's:$: $lt_compiler_flag:'`
21102 (eval echo "\"\$as_me:21103: $lt_compile\"" >&5)
21125 (eval echo "\"\$as_me:21126: $lt_compile\"" >&5)
2110321126 (eval "$lt_compile" 2>conftest.err)
2110421127 ac_status=$?
2110521128 cat conftest.err >&5
21106 echo "$as_me:21107: \$? = $ac_status" >&5
21129 echo "$as_me:21130: \$? = $ac_status" >&5
2110721130 if (exit $ac_status) && test -s "$ac_outfile"; then
2110821131 # The compiler can only warn and ignore the option if not recognized
2110921132 # So say no if there are warnings
2134221365 -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
2134321366 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
2134421367 -e 's:$: $lt_compiler_flag:'`
21345 (eval echo "\"\$as_me:21346: $lt_compile\"" >&5)
21368 (eval echo "\"\$as_me:21369: $lt_compile\"" >&5)
2134621369 (eval "$lt_compile" 2>conftest.err)
2134721370 ac_status=$?
2134821371 cat conftest.err >&5
21349 echo "$as_me:21350: \$? = $ac_status" >&5
21372 echo "$as_me:21373: \$? = $ac_status" >&5
2135021373 if (exit $ac_status) && test -s "$ac_outfile"; then
2135121374 # The compiler can only warn and ignore the option if not recognized
2135221375 # So say no if there are warnings
2140221425 -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
2140321426 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
2140421427 -e 's:$: $lt_compiler_flag:'`
21405 (eval echo "\"\$as_me:21406: $lt_compile\"" >&5)
21428 (eval echo "\"\$as_me:21429: $lt_compile\"" >&5)
2140621429 (eval "$lt_compile" 2>out/conftest.err)
2140721430 ac_status=$?
2140821431 cat out/conftest.err >&5
21409 echo "$as_me:21410: \$? = $ac_status" >&5
21432 echo "$as_me:21433: \$? = $ac_status" >&5
2141021433 if (exit $ac_status) && test -s out/conftest2.$ac_objext
2141121434 then
2141221435 # The compiler can only warn and ignore the option if not recognized
2358723610 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
2358823611 lt_status=$lt_dlunknown
2358923612 cat > conftest.$ac_ext <
23590 #line 23591 "configure"
23613 #line 23614 "configure"
2359123614 #include "confdefs.h"
2359223615
2359323616 #if HAVE_DLFCN_H
2368523708 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
2368623709 lt_status=$lt_dlunknown
2368723710 cat > conftest.$ac_ext <
23688 #line 23689 "configure"
23711 #line 23712 "configure"
2368923712 #include "confdefs.h"
2369023713
2369123714 #if HAVE_DLFCN_H
2533825361 fi
2533925362
2534025363
25364 if test "$ENABLE_THREADS" -eq 1 ; then
2534125365
2534225366 echo "$as_me:$LINENO: checking for pthread_mutex_init in -lpthread" >&5
2534325367 echo $ECHO_N "checking for pthread_mutex_init in -lpthread... $ECHO_C" >&6
2541225436
2541325437 fi
2541425438
25415 echo "$as_me:$LINENO: checking for library containing pthread_mutex_lock" >&5
25439 echo "$as_me:$LINENO: checking for library containing pthread_mutex_lock" >&5
2541625440 echo $ECHO_N "checking for library containing pthread_mutex_lock... $ECHO_C" >&6
2541725441 if test "${ac_cv_search_pthread_mutex_lock+set}" = set; then
2541825442 echo $ECHO_N "(cached) $ECHO_C" >&6
2554225566
2554325567 fi
2554425568
25569 fi
2554525570
2554625571
2554725572
2647226497
2647326498
2647426499
26475 for ac_header in malloc.h pthread.h signal.h stdint.h unistd.h utime.h
26500 for ac_header in malloc.h signal.h stdint.h unistd.h utime.h windows.h
2647626501 do
2647726502 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
2647826503 if eval "test \"\${$as_ac_Header+set}\" = set"; then
2662226647 done
2662326648
2662426649
26625 for ac_header in windows.h
26650
26651
26652
26653
26654 for ac_header in sys/mman.h sys/param.h sys/resource.h sys/time.h sys/types.h
2662626655 do
2662726656 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
2662826657 if eval "test \"\${$as_ac_Header+set}\" = set"; then
2677326802
2677426803
2677526804
26776
26777
26778
26779 for ac_header in sys/mman.h sys/param.h sys/resource.h sys/time.h sys/types.h
26805 for ac_header in rw/stdex/hash_map.h rw/stdex/hash_set.h
2678026806 do
2678126807 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
2678226808 if eval "test \"\${$as_ac_Header+set}\" = set"; then
2692526951
2692626952 done
2692726953
26928
26929
26930 for ac_header in rw/stdex/hash_map.h rw/stdex/hash_set.h
26954 if test "$ENABLE_THREADS" -eq 1 ; then
26955
26956 for ac_header in pthread.h
2693126957 do
2693226958 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
2693326959 if eval "test \"\${$as_ac_Header+set}\" = set"; then
2707627102
2707727103 done
2707827104
27105 fi
2707927106
2708027107
2708127108 echo "$as_me:$LINENO: checking for pid_t" >&5
3132131348 s,@ENABLE_OPTIMIZED@,$ENABLE_OPTIMIZED,;t t
3132231349 s,@JIT@,$JIT,;t t
3132331350 s,@ENABLE_DOXYGEN@,$ENABLE_DOXYGEN,;t t
31351 s,@ENABLE_THREADS@,$ENABLE_THREADS,;t t
3132431352 s,@TARGETS_TO_BUILD@,$TARGETS_TO_BUILD,;t t
3132531353 s,@CPP@,$CPP,;t t
3132631354 s,@CXX@,$CXX,;t t
1313 LLVMLIBS := JIT
1414
1515 include $(LEVEL)/Makefile.common
16
17 LIBS += -lpthread
99
1010 /* Define to 1 if using `alloca.c'. */
1111 #undef C_ALLOCA
12
13 /* Define if threads enabled */
14 #undef ENABLE_THREADS
1215
1316 /* Define to 1 if you have `alloca', as a function or macro. */
1417 #undef HAVE_ALLOCA
448451 /* If using the C implementation of alloca, define if you know the
449452 direction of stack growth for your system; otherwise it will be
450453 automatically deduced at run-time.
451 STACK_DIRECTION > 0 => grows toward higher addresses
452 STACK_DIRECTION < 0 => grows toward lower addresses
453 STACK_DIRECTION = 0 => direction of growth unknown */
454 STACK_DIRECTION > 0 => grows toward higher addresses
455 STACK_DIRECTION < 0 => grows toward lower addresses
456 STACK_DIRECTION = 0 => direction of growth unknown */
454457 #undef STACK_DIRECTION
455458
456459 /* Define to 1 if the `S_IS*' macros in do not work properly. */
6565 /// @name Platform Dependent Data
6666 /// @{
6767 private:
68 #ifdef ENABLE_THREADS
6869 void* data_; ///< We don't know what the data will be
70 #endif
6971
7072 /// @}
7173 /// @name Do Not Implement
1010 //
1111 //===----------------------------------------------------------------------===//
1212
13 #include "llvm/Config/config.h"
1314 #include "llvm/System/Mutex.h"
14 #include "llvm/Config/config.h"
1515
1616 //===----------------------------------------------------------------------===//
1717 //=== WARNING: Implementation here must contain only TRULY operating system
1818 //=== independent code.
1919 //===----------------------------------------------------------------------===//
2020
21 #if !defined(ENABLE_THREADS) || ENABLE_THREADS == 0
22 // Define all methods as no-ops if threading is explicitly disabled
23 namespace llvm {
24 using namespace sys;
25 Mutex::Mutex( bool recursive) { }
26 Mutex::~Mutex() { }
27 bool Mutex::acquire() { return true; }
28 bool Mutex::release() { return true; }
29 bool Mutex::tryacquire() { return true; }
30 }
31 #else
32
2133 #if defined(HAVE_PTHREAD_H) && defined(HAVE_PTHREAD_MUTEX_LOCK)
34
35 #include
36 #include
37 #include
2238
2339 namespace llvm {
2440 using namespace sys;
2541
26 #include
27 #include
28 #include
2942
3043 // This variable is useful for situations where the pthread library has been
3144 // compiled with weak linkage for its interface symbols. This allows the
142155 #else
143156 #warning Neither LLVM_ON_UNIX nor LLVM_ON_WIN32 was set in System/Mutex.cpp
144157 #endif
158 #endif