llvm.org GIT mirror llvm / 1000b73
For PR1019: Add HAVE_PTHREAD to makefiles with support from configure and use it to determine whether to build examples/ParallelJIT. Patch by Anton Korobeynikov. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32054 91177308-0d34-0410-b5e6-96231b3b80d8 Reid Spencer 12 years ago
4 changed file(s) with 83 addition(s) and 79 deletion(s). Raw diff Collapse all Expand all
164164 TCLSH := @TCLSH@
165165 ZIP := @ZIP@
166166
167 HAVE_PERL := @HAVE_PERL@
167 HAVE_PERL := @HAVE_PERL@
168 HAVE_PTHREAD := @HAVE_PTHREAD@
168169
169170 LIBS := @LIBS@
170171
636636 AC_CHECK_HEADERS([windows.h sys/mman.h sys/param.h sys/resource.h sys/time.h])
637637 AC_CHECK_HEADERS([sys/types.h malloc/malloc.h mach/mach.h])
638638 if test "$ENABLE_THREADS" -eq 1 ; then
639 AC_CHECK_HEADERS(pthread.h)
639 AC_CHECK_HEADER(pthread.h,
640 AC_SUBST(HAVE_PTHREAD, 1),
641 AC_SUBST(HAVE_PTHREAD, 0))
642 else
643 AC_SUBST(HAVE_PTHREAD, 0)
640644 fi
641645
642646 dnl===-----------------------------------------------------------------------===
895895 ETAGSFLAGS
896896 LLVMGCC
897897 LLVMGXX
898 HAVE_PTHREAD
898899 HUGE_VAL_SANITY
899900 ALLOCA
900901 MMAP_FILE
1029710298 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1029810299 lt_status=$lt_dlunknown
1029910300 cat > conftest.$ac_ext <
10300 #line 10301 "configure"
10301 #line 10302 "configure"
1030110302 #include "confdefs.h"
1030210303
1030310304 #if HAVE_DLFCN_H
1244112442 ;;
1244212443 *-*-irix6*)
1244312444 # Find out which ABI we are using.
12444 echo '#line 12445 "configure"' > conftest.$ac_ext
12445 echo '#line 12446 "configure"' > conftest.$ac_ext
1244512446 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
1244612447 (eval $ac_compile) 2>&5
1244712448 ac_status=$?
1415914160 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1416014161 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
1416114162 -e 's:$: $lt_compiler_flag:'`
14162 (eval echo "\"\$as_me:14163: $lt_compile\"" >&5)
14163 (eval echo "\"\$as_me:14164: $lt_compile\"" >&5)
1416314164 (eval "$lt_compile" 2>conftest.err)
1416414165 ac_status=$?
1416514166 cat conftest.err >&5
14166 echo "$as_me:14167: \$? = $ac_status" >&5
14167 echo "$as_me:14168: \$? = $ac_status" >&5
1416714168 if (exit $ac_status) && test -s "$ac_outfile"; then
1416814169 # The compiler can only warn and ignore the option if not recognized
1416914170 # So say no if there are warnings other than the usual output.
1442714428 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1442814429 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
1442914430 -e 's:$: $lt_compiler_flag:'`
14430 (eval echo "\"\$as_me:14431: $lt_compile\"" >&5)
14431 (eval echo "\"\$as_me:14432: $lt_compile\"" >&5)
1443114432 (eval "$lt_compile" 2>conftest.err)
1443214433 ac_status=$?
1443314434 cat conftest.err >&5
14434 echo "$as_me:14435: \$? = $ac_status" >&5
14435 echo "$as_me:14436: \$? = $ac_status" >&5
1443514436 if (exit $ac_status) && test -s "$ac_outfile"; then
1443614437 # The compiler can only warn and ignore the option if not recognized
1443714438 # So say no if there are warnings other than the usual output.
1453114532 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1453214533 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
1453314534 -e 's:$: $lt_compiler_flag:'`
14534 (eval echo "\"\$as_me:14535: $lt_compile\"" >&5)
14535 (eval echo "\"\$as_me:14536: $lt_compile\"" >&5)
1453514536 (eval "$lt_compile" 2>out/conftest.err)
1453614537 ac_status=$?
1453714538 cat out/conftest.err >&5
14538 echo "$as_me:14539: \$? = $ac_status" >&5
14539 echo "$as_me:14540: \$? = $ac_status" >&5
1453914540 if (exit $ac_status) && test -s out/conftest2.$ac_objext
1454014541 then
1454114542 # The compiler can only warn and ignore the option if not recognized
1698316984 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1698416985 lt_status=$lt_dlunknown
1698516986 cat > conftest.$ac_ext <
16986 #line 16987 "configure"
16987 #line 16988 "configure"
1698716988 #include "confdefs.h"
1698816989
1698916990 #if HAVE_DLFCN_H
1708317084 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1708417085 lt_status=$lt_dlunknown
1708517086 cat > conftest.$ac_ext <
17086 #line 17087 "configure"
17087 #line 17088 "configure"
1708717088 #include "confdefs.h"
1708817089
1708917090 #if HAVE_DLFCN_H
1945119452 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1945219453 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
1945319454 -e 's:$: $lt_compiler_flag:'`
19454 (eval echo "\"\$as_me:19455: $lt_compile\"" >&5)
19455 (eval echo "\"\$as_me:19456: $lt_compile\"" >&5)
1945519456 (eval "$lt_compile" 2>conftest.err)
1945619457 ac_status=$?
1945719458 cat conftest.err >&5
19458 echo "$as_me:19459: \$? = $ac_status" >&5
19459 echo "$as_me:19460: \$? = $ac_status" >&5
1945919460 if (exit $ac_status) && test -s "$ac_outfile"; then
1946019461 # The compiler can only warn and ignore the option if not recognized
1946119462 # So say no if there are warnings other than the usual output.
1955519556 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1955619557 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
1955719558 -e 's:$: $lt_compiler_flag:'`
19558 (eval echo "\"\$as_me:19559: $lt_compile\"" >&5)
19559 (eval echo "\"\$as_me:19560: $lt_compile\"" >&5)
1955919560 (eval "$lt_compile" 2>out/conftest.err)
1956019561 ac_status=$?
1956119562 cat out/conftest.err >&5
19562 echo "$as_me:19563: \$? = $ac_status" >&5
19563 echo "$as_me:19564: \$? = $ac_status" >&5
1956319564 if (exit $ac_status) && test -s out/conftest2.$ac_objext
1956419565 then
1956519566 # The compiler can only warn and ignore the option if not recognized
2112521126 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
2112621127 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
2112721128 -e 's:$: $lt_compiler_flag:'`
21128 (eval echo "\"\$as_me:21129: $lt_compile\"" >&5)
21129 (eval echo "\"\$as_me:21130: $lt_compile\"" >&5)
2112921130 (eval "$lt_compile" 2>conftest.err)
2113021131 ac_status=$?
2113121132 cat conftest.err >&5
21132 echo "$as_me:21133: \$? = $ac_status" >&5
21133 echo "$as_me:21134: \$? = $ac_status" >&5
2113321134 if (exit $ac_status) && test -s "$ac_outfile"; then
2113421135 # The compiler can only warn and ignore the option if not recognized
2113521136 # So say no if there are warnings other than the usual output.
2122921230 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
2123021231 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
2123121232 -e 's:$: $lt_compiler_flag:'`
21232 (eval echo "\"\$as_me:21233: $lt_compile\"" >&5)
21233 (eval echo "\"\$as_me:21234: $lt_compile\"" >&5)
2123321234 (eval "$lt_compile" 2>out/conftest.err)
2123421235 ac_status=$?
2123521236 cat out/conftest.err >&5
21236 echo "$as_me:21237: \$? = $ac_status" >&5
21237 echo "$as_me:21238: \$? = $ac_status" >&5
2123721238 if (exit $ac_status) && test -s out/conftest2.$ac_objext
2123821239 then
2123921240 # The compiler can only warn and ignore the option if not recognized
2346423465 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
2346523466 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
2346623467 -e 's:$: $lt_compiler_flag:'`
23467 (eval echo "\"\$as_me:23468: $lt_compile\"" >&5)
23468 (eval echo "\"\$as_me:23469: $lt_compile\"" >&5)
2346823469 (eval "$lt_compile" 2>conftest.err)
2346923470 ac_status=$?
2347023471 cat conftest.err >&5
23471 echo "$as_me:23472: \$? = $ac_status" >&5
23472 echo "$as_me:23473: \$? = $ac_status" >&5
2347223473 if (exit $ac_status) && test -s "$ac_outfile"; then
2347323474 # The compiler can only warn and ignore the option if not recognized
2347423475 # So say no if there are warnings other than the usual output.
2373223733 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
2373323734 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
2373423735 -e 's:$: $lt_compiler_flag:'`
23735 (eval echo "\"\$as_me:23736: $lt_compile\"" >&5)
23736 (eval echo "\"\$as_me:23737: $lt_compile\"" >&5)
2373623737 (eval "$lt_compile" 2>conftest.err)
2373723738 ac_status=$?
2373823739 cat conftest.err >&5
23739 echo "$as_me:23740: \$? = $ac_status" >&5
23740 echo "$as_me:23741: \$? = $ac_status" >&5
2374023741 if (exit $ac_status) && test -s "$ac_outfile"; then
2374123742 # The compiler can only warn and ignore the option if not recognized
2374223743 # So say no if there are warnings other than the usual output.
2383623837 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
2383723838 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
2383823839 -e 's:$: $lt_compiler_flag:'`
23839 (eval echo "\"\$as_me:23840: $lt_compile\"" >&5)
23840 (eval echo "\"\$as_me:23841: $lt_compile\"" >&5)
2384023841 (eval "$lt_compile" 2>out/conftest.err)
2384123842 ac_status=$?
2384223843 cat out/conftest.err >&5
23843 echo "$as_me:23844: \$? = $ac_status" >&5
23844 echo "$as_me:23845: \$? = $ac_status" >&5
2384423845 if (exit $ac_status) && test -s out/conftest2.$ac_objext
2384523846 then
2384623847 # The compiler can only warn and ignore the option if not recognized
2903229033 done
2903329034
2903429035 if test "$ENABLE_THREADS" -eq 1 ; then
29035
29036 for ac_header in pthread.h
29037 do
29038 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
29039 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
29040 { echo "$as_me:$LINENO: checking for $ac_header" >&5
29041 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
29042 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
29036 if test "${ac_cv_header_pthread_h+set}" = set; then
29037 { echo "$as_me:$LINENO: checking for pthread.h" >&5
29038 echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6; }
29039 if test "${ac_cv_header_pthread_h+set}" = set; then
2904329040 echo $ECHO_N "(cached) $ECHO_C" >&6
2904429041 fi
29045 ac_res=`eval echo '${'$as_ac_Header'}'`
29046 { echo "$as_me:$LINENO: result: $ac_res" >&5
29047 echo "${ECHO_T}$ac_res" >&6; }
29042 { echo "$as_me:$LINENO: result: $ac_cv_header_pthread_h" >&5
29043 echo "${ECHO_T}$ac_cv_header_pthread_h" >&6; }
2904829044 else
2904929045 # Is the header compilable?
29050 { echo "$as_me:$LINENO: checking $ac_header usability" >&5
29051 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
29046 { echo "$as_me:$LINENO: checking pthread.h usability" >&5
29047 echo $ECHO_N "checking pthread.h usability... $ECHO_C" >&6; }
2905229048 cat >conftest.$ac_ext <<_ACEOF
2905329049 /* confdefs.h. */
2905429050 _ACEOF
2905629052 cat >>conftest.$ac_ext <<_ACEOF
2905729053 /* end confdefs.h. */
2905829054 $ac_includes_default
29059 #include <$ac_header>
29055 #include <pthread.h>
2906029056 _ACEOF
2906129057 rm -f conftest.$ac_objext
2906229058 if { (ac_try="$ac_compile"
2910529101 echo "${ECHO_T}$ac_header_compiler" >&6; }
2910629102
2910729103 # Is the header present?
29108 { echo "$as_me:$LINENO: checking $ac_header presence" >&5
29109 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
29104 { echo "$as_me:$LINENO: checking pthread.h presence" >&5
29105 echo $ECHO_N "checking pthread.h presence... $ECHO_C" >&6; }
2911029106 cat >conftest.$ac_ext <<_ACEOF
2911129107 /* confdefs.h. */
2911229108 _ACEOF
2911329109 cat confdefs.h >>conftest.$ac_ext
2911429110 cat >>conftest.$ac_ext <<_ACEOF
2911529111 /* end confdefs.h. */
29116 #include <$ac_header>
29112 #include <pthread.h>
2911729113 _ACEOF
2911829114 if { (ac_try="$ac_cpp conftest.$ac_ext"
2911929115 case "(($ac_try" in
2915329149 # So? What about this header?
2915429150 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
2915529151 yes:no: )
29156 { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
29157 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
29158 { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
29159 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
29152 { echo "$as_me:$LINENO: WARNING: pthread.h: accepted by the compiler, rejected by the preprocessor!" >&5
29153 echo "$as_me: WARNING: pthread.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
29154 { echo "$as_me:$LINENO: WARNING: pthread.h: proceeding with the compiler's result" >&5
29155 echo "$as_me: WARNING: pthread.h: proceeding with the compiler's result" >&2;}
2916029156 ac_header_preproc=yes
2916129157 ;;
2916229158 no:yes:* )
29163 { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
29164 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
29165 { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
29166 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
29167 { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
29168 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
29169 { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
29170 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
29171 { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
29172 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
29173 { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
29174 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
29159 { echo "$as_me:$LINENO: WARNING: pthread.h: present but cannot be compiled" >&5
29160 echo "$as_me: WARNING: pthread.h: present but cannot be compiled" >&2;}
29161 { echo "$as_me:$LINENO: WARNING: pthread.h: check for missing prerequisite headers?" >&5
29162 echo "$as_me: WARNING: pthread.h: check for missing prerequisite headers?" >&2;}
29163 { echo "$as_me:$LINENO: WARNING: pthread.h: see the Autoconf documentation" >&5
29164 echo "$as_me: WARNING: pthread.h: see the Autoconf documentation" >&2;}
29165 { echo "$as_me:$LINENO: WARNING: pthread.h: section \"Present But Cannot Be Compiled\"" >&5
29166 echo "$as_me: WARNING: pthread.h: section \"Present But Cannot Be Compiled\"" >&2;}
29167 { echo "$as_me:$LINENO: WARNING: pthread.h: proceeding with the preprocessor's result" >&5
29168 echo "$as_me: WARNING: pthread.h: proceeding with the preprocessor's result" >&2;}
29169 { echo "$as_me:$LINENO: WARNING: pthread.h: in the future, the compiler will take precedence" >&5
29170 echo "$as_me: WARNING: pthread.h: in the future, the compiler will take precedence" >&2;}
2917529171 ( cat <<\_ASBOX
2917629172 ## ----------------------------------- ##
2917729173 ## Report this to llvmbugs@cs.uiuc.edu ##
2918029176 ) | sed "s/^/$as_me: WARNING: /" >&2
2918129177 ;;
2918229178 esac
29183 { echo "$as_me:$LINENO: checking for $ac_header" >&5
29184 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
29185 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
29179 { echo "$as_me:$LINENO: checking for pthread.h" >&5
29180 echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6; }
29181 if test "${ac_cv_header_pthread_h+set}" = set; then
2918629182 echo $ECHO_N "(cached) $ECHO_C" >&6
2918729183 else
29188 eval "$as_ac_Header=\$ac_header_preproc"
29189 fi
29190 ac_res=`eval echo '${'$as_ac_Header'}'`
29191 { echo "$as_me:$LINENO: result: $ac_res" >&5
29192 echo "${ECHO_T}$ac_res" >&6; }
29193
29194 fi
29195 if test `eval echo '${'$as_ac_Header'}'` = yes; then
29196 cat >>confdefs.h <<_ACEOF
29197 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
29198 _ACEOF
29199
29200 fi
29201
29202 done
29184 ac_cv_header_pthread_h=$ac_header_preproc
29185 fi
29186 { echo "$as_me:$LINENO: result: $ac_cv_header_pthread_h" >&5
29187 echo "${ECHO_T}$ac_cv_header_pthread_h" >&6; }
29188
29189 fi
29190 if test $ac_cv_header_pthread_h = yes; then
29191 HAVE_PTHREAD=1
29192
29193 else
29194 HAVE_PTHREAD=0
29195
29196 fi
29197
29198
29199 else
29200 HAVE_PTHREAD=0
2920329201
2920429202 fi
2920529203
3427534273 ETAGSFLAGS!$ETAGSFLAGS$ac_delim
3427634274 LLVMGCC!$LLVMGCC$ac_delim
3427734275 LLVMGXX!$LLVMGXX$ac_delim
34276 HAVE_PTHREAD!$HAVE_PTHREAD$ac_delim
3427834277 HUGE_VAL_SANITY!$HUGE_VAL_SANITY$ac_delim
3427934278 ALLOCA!$ALLOCA$ac_delim
3428034279 MMAP_FILE!$MMAP_FILE$ac_delim
3429834297 LTLIBOBJS!$LTLIBOBJS$ac_delim
3429934298 _ACEOF
3430034299
34301 if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 64; then
34300 if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 65; then
3430234301 break
3430334302 elif $ac_last_try; then
3430434303 { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
1111
1212 PARALLEL_DIRS:= Fibonacci HowToUseJIT ModuleMaker BFtoLLVM
1313
14 ifeq ($(ENABLE_THREADS),1)
14 ifeq ($(HAVE_PTHREAD),1)
1515 PARALLEL_DIRS += ParallelJIT
1616 endif
1717