130-configure_disable_pthreads_tests.patch 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444
  1. --- a/configure
  2. +++ b/configure
  3. @@ -888,10 +888,6 @@ BUILD_RIPEMD_TRUE
  4. BUILD_RIPEMD_FALSE
  5. BUILD_SHA512_TRUE
  6. BUILD_SHA512_FALSE
  7. -acx_pthread_config
  8. -PTHREAD_CC
  9. -PTHREAD_LIBS
  10. -PTHREAD_CFLAGS
  11. LIBOBJS
  12. LTLIBOBJS'
  13. ac_subst_files=''
  14. @@ -22251,430 +22247,6 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS con
  15. ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
  16. ac_compiler_gnu=$ac_cv_c_compiler_gnu
  17. -acx_pthread_ok=no
  18. -
  19. -# We used to check for pthread.h first, but this fails if pthread.h
  20. -# requires special compiler flags (e.g. on True64 or Sequent).
  21. -# It gets checked for in the link test anyway.
  22. -
  23. -# First of all, check if the user has set any of the PTHREAD_LIBS,
  24. -# etcetera environment variables, and if threads linking works using
  25. -# them:
  26. -if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then
  27. - save_CFLAGS="$CFLAGS"
  28. - CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
  29. - save_LIBS="$LIBS"
  30. - LIBS="$PTHREAD_LIBS $LIBS"
  31. - { echo "$as_me:$LINENO: checking for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS" >&5
  32. -echo $ECHO_N "checking for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS... $ECHO_C" >&6; }
  33. - cat >conftest.$ac_ext <<_ACEOF
  34. -/* confdefs.h. */
  35. -_ACEOF
  36. -cat confdefs.h >>conftest.$ac_ext
  37. -cat >>conftest.$ac_ext <<_ACEOF
  38. -/* end confdefs.h. */
  39. -
  40. -/* Override any GCC internal prototype to avoid an error.
  41. - Use char because int might match the return type of a GCC
  42. - builtin and then its argument prototype would still apply. */
  43. -#ifdef __cplusplus
  44. -extern "C"
  45. -#endif
  46. -char pthread_join ();
  47. -int
  48. -main ()
  49. -{
  50. -return pthread_join ();
  51. - ;
  52. - return 0;
  53. -}
  54. -_ACEOF
  55. -rm -f conftest.$ac_objext conftest$ac_exeext
  56. -if { (ac_try="$ac_link"
  57. -case "(($ac_try" in
  58. - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  59. - *) ac_try_echo=$ac_try;;
  60. -esac
  61. -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  62. - (eval "$ac_link") 2>conftest.er1
  63. - ac_status=$?
  64. - grep -v '^ *+' conftest.er1 >conftest.err
  65. - rm -f conftest.er1
  66. - cat conftest.err >&5
  67. - echo "$as_me:$LINENO: \$? = $ac_status" >&5
  68. - (exit $ac_status); } && {
  69. - test -z "$ac_c_werror_flag" ||
  70. - test ! -s conftest.err
  71. - } && test -s conftest$ac_exeext &&
  72. - $as_test_x conftest$ac_exeext; then
  73. - acx_pthread_ok=yes
  74. -else
  75. - echo "$as_me: failed program was:" >&5
  76. -sed 's/^/| /' conftest.$ac_ext >&5
  77. -
  78. -
  79. -fi
  80. -
  81. -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
  82. - conftest$ac_exeext conftest.$ac_ext
  83. - { echo "$as_me:$LINENO: result: $acx_pthread_ok" >&5
  84. -echo "${ECHO_T}$acx_pthread_ok" >&6; }
  85. - if test x"$acx_pthread_ok" = xno; then
  86. - PTHREAD_LIBS=""
  87. - PTHREAD_CFLAGS=""
  88. - fi
  89. - LIBS="$save_LIBS"
  90. - CFLAGS="$save_CFLAGS"
  91. -fi
  92. -
  93. -# We must check for the threads library under a number of different
  94. -# names; the ordering is very important because some systems
  95. -# (e.g. DEC) have both -lpthread and -lpthreads, where one of the
  96. -# libraries is broken (non-POSIX).
  97. -
  98. -# Create a list of thread flags to try. Items starting with a "-" are
  99. -# C compiler flags, and other items are library names, except for "none"
  100. -# which indicates that we try without any flags at all, and "pthread-config"
  101. -# which is a program returning the flags for the Pth emulation library.
  102. -
  103. -acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
  104. -
  105. -# The ordering *is* (sometimes) important. Some notes on the
  106. -# individual items follow:
  107. -
  108. -# pthreads: AIX (must check this before -lpthread)
  109. -# none: in case threads are in libc; should be tried before -Kthread and
  110. -# other compiler flags to prevent continual compiler warnings
  111. -# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
  112. -# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
  113. -# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
  114. -# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads)
  115. -# -pthreads: Solaris/gcc
  116. -# -mthreads: Mingw32/gcc, Lynx/gcc
  117. -# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
  118. -# doesn't hurt to check since this sometimes defines pthreads too;
  119. -# also defines -D_REENTRANT)
  120. -# ... -mt is also the pthreads flag for HP/aCC
  121. -# pthread: Linux, etcetera
  122. -# --thread-safe: KAI C++
  123. -# pthread-config: use pthread-config program (for GNU Pth library)
  124. -
  125. -case "${host_cpu}-${host_os}" in
  126. - *solaris*)
  127. -
  128. - # On Solaris (at least, for some versions), libc contains stubbed
  129. - # (non-functional) versions of the pthreads routines, so link-based
  130. - # tests will erroneously succeed. (We need to link with -pthreads/-mt/
  131. - # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather
  132. - # a function called by this macro, so we could check for that, but
  133. - # who knows whether they'll stub that too in a future libc.) So,
  134. - # we'll just look for -pthreads and -lpthread first:
  135. -
  136. - acx_pthread_flags="-pthreads pthread -mt -pthread $acx_pthread_flags"
  137. - ;;
  138. -esac
  139. -
  140. -if test x"$acx_pthread_ok" = xno; then
  141. -for flag in $acx_pthread_flags; do
  142. -
  143. - case $flag in
  144. - none)
  145. - { echo "$as_me:$LINENO: checking whether pthreads work without any flags" >&5
  146. -echo $ECHO_N "checking whether pthreads work without any flags... $ECHO_C" >&6; }
  147. - ;;
  148. -
  149. - -*)
  150. - { echo "$as_me:$LINENO: checking whether pthreads work with $flag" >&5
  151. -echo $ECHO_N "checking whether pthreads work with $flag... $ECHO_C" >&6; }
  152. - PTHREAD_CFLAGS="$flag"
  153. - ;;
  154. -
  155. - pthread-config)
  156. - # Extract the first word of "pthread-config", so it can be a program name with args.
  157. -set dummy pthread-config; ac_word=$2
  158. -{ echo "$as_me:$LINENO: checking for $ac_word" >&5
  159. -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
  160. -if test "${ac_cv_prog_acx_pthread_config+set}" = set; then
  161. - echo $ECHO_N "(cached) $ECHO_C" >&6
  162. -else
  163. - if test -n "$acx_pthread_config"; then
  164. - ac_cv_prog_acx_pthread_config="$acx_pthread_config" # Let the user override the test.
  165. -else
  166. -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
  167. -for as_dir in $PATH
  168. -do
  169. - IFS=$as_save_IFS
  170. - test -z "$as_dir" && as_dir=.
  171. - for ac_exec_ext in '' $ac_executable_extensions; do
  172. - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
  173. - ac_cv_prog_acx_pthread_config="yes"
  174. - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
  175. - break 2
  176. - fi
  177. -done
  178. -done
  179. -IFS=$as_save_IFS
  180. -
  181. - test -z "$ac_cv_prog_acx_pthread_config" && ac_cv_prog_acx_pthread_config="no"
  182. -fi
  183. -fi
  184. -acx_pthread_config=$ac_cv_prog_acx_pthread_config
  185. -if test -n "$acx_pthread_config"; then
  186. - { echo "$as_me:$LINENO: result: $acx_pthread_config" >&5
  187. -echo "${ECHO_T}$acx_pthread_config" >&6; }
  188. -else
  189. - { echo "$as_me:$LINENO: result: no" >&5
  190. -echo "${ECHO_T}no" >&6; }
  191. -fi
  192. -
  193. -
  194. - if test x"$acx_pthread_config" = xno; then continue; fi
  195. - PTHREAD_CFLAGS="`pthread-config --cflags`"
  196. - PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
  197. - ;;
  198. -
  199. - *)
  200. - { echo "$as_me:$LINENO: checking for the pthreads library -l$flag" >&5
  201. -echo $ECHO_N "checking for the pthreads library -l$flag... $ECHO_C" >&6; }
  202. - PTHREAD_LIBS="-l$flag"
  203. - ;;
  204. - esac
  205. -
  206. - save_LIBS="$LIBS"
  207. - save_CFLAGS="$CFLAGS"
  208. - LIBS="$PTHREAD_LIBS $LIBS"
  209. - CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
  210. -
  211. - # Check for various functions. We must include pthread.h,
  212. - # since some functions may be macros. (On the Sequent, we
  213. - # need a special flag -Kthread to make this header compile.)
  214. - # We check for pthread_join because it is in -lpthread on IRIX
  215. - # while pthread_create is in libc. We check for pthread_attr_init
  216. - # due to DEC craziness with -lpthreads. We check for
  217. - # pthread_cleanup_push because it is one of the few pthread
  218. - # functions on Solaris that doesn't have a non-functional libc stub.
  219. - # We try pthread_create on general principles.
  220. - cat >conftest.$ac_ext <<_ACEOF
  221. -/* confdefs.h. */
  222. -_ACEOF
  223. -cat confdefs.h >>conftest.$ac_ext
  224. -cat >>conftest.$ac_ext <<_ACEOF
  225. -/* end confdefs.h. */
  226. -#include <pthread.h>
  227. -int
  228. -main ()
  229. -{
  230. -pthread_t th; pthread_join(th, 0);
  231. - pthread_attr_init(0); pthread_cleanup_push(0, 0);
  232. - pthread_create(0,0,0,0); pthread_cleanup_pop(0);
  233. - ;
  234. - return 0;
  235. -}
  236. -_ACEOF
  237. -rm -f conftest.$ac_objext conftest$ac_exeext
  238. -if { (ac_try="$ac_link"
  239. -case "(($ac_try" in
  240. - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  241. - *) ac_try_echo=$ac_try;;
  242. -esac
  243. -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  244. - (eval "$ac_link") 2>conftest.er1
  245. - ac_status=$?
  246. - grep -v '^ *+' conftest.er1 >conftest.err
  247. - rm -f conftest.er1
  248. - cat conftest.err >&5
  249. - echo "$as_me:$LINENO: \$? = $ac_status" >&5
  250. - (exit $ac_status); } && {
  251. - test -z "$ac_c_werror_flag" ||
  252. - test ! -s conftest.err
  253. - } && test -s conftest$ac_exeext &&
  254. - $as_test_x conftest$ac_exeext; then
  255. - acx_pthread_ok=yes
  256. -else
  257. - echo "$as_me: failed program was:" >&5
  258. -sed 's/^/| /' conftest.$ac_ext >&5
  259. -
  260. -
  261. -fi
  262. -
  263. -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
  264. - conftest$ac_exeext conftest.$ac_ext
  265. -
  266. - LIBS="$save_LIBS"
  267. - CFLAGS="$save_CFLAGS"
  268. -
  269. - { echo "$as_me:$LINENO: result: $acx_pthread_ok" >&5
  270. -echo "${ECHO_T}$acx_pthread_ok" >&6; }
  271. - if test "x$acx_pthread_ok" = xyes; then
  272. - break;
  273. - fi
  274. -
  275. - PTHREAD_LIBS=""
  276. - PTHREAD_CFLAGS=""
  277. -done
  278. -fi
  279. -
  280. -# Various other checks:
  281. -if test "x$acx_pthread_ok" = xyes; then
  282. - save_LIBS="$LIBS"
  283. - LIBS="$PTHREAD_LIBS $LIBS"
  284. - save_CFLAGS="$CFLAGS"
  285. - CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
  286. -
  287. - # Detect AIX lossage: JOINABLE attribute is called UNDETACHED.
  288. - { echo "$as_me:$LINENO: checking for joinable pthread attribute" >&5
  289. -echo $ECHO_N "checking for joinable pthread attribute... $ECHO_C" >&6; }
  290. - attr_name=unknown
  291. - for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do
  292. - cat >conftest.$ac_ext <<_ACEOF
  293. -/* confdefs.h. */
  294. -_ACEOF
  295. -cat confdefs.h >>conftest.$ac_ext
  296. -cat >>conftest.$ac_ext <<_ACEOF
  297. -/* end confdefs.h. */
  298. -#include <pthread.h>
  299. -int
  300. -main ()
  301. -{
  302. -int attr=$attr; return attr;
  303. - ;
  304. - return 0;
  305. -}
  306. -_ACEOF
  307. -rm -f conftest.$ac_objext conftest$ac_exeext
  308. -if { (ac_try="$ac_link"
  309. -case "(($ac_try" in
  310. - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  311. - *) ac_try_echo=$ac_try;;
  312. -esac
  313. -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
  314. - (eval "$ac_link") 2>conftest.er1
  315. - ac_status=$?
  316. - grep -v '^ *+' conftest.er1 >conftest.err
  317. - rm -f conftest.er1
  318. - cat conftest.err >&5
  319. - echo "$as_me:$LINENO: \$? = $ac_status" >&5
  320. - (exit $ac_status); } && {
  321. - test -z "$ac_c_werror_flag" ||
  322. - test ! -s conftest.err
  323. - } && test -s conftest$ac_exeext &&
  324. - $as_test_x conftest$ac_exeext; then
  325. - attr_name=$attr; break
  326. -else
  327. - echo "$as_me: failed program was:" >&5
  328. -sed 's/^/| /' conftest.$ac_ext >&5
  329. -
  330. -
  331. -fi
  332. -
  333. -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
  334. - conftest$ac_exeext conftest.$ac_ext
  335. - done
  336. - { echo "$as_me:$LINENO: result: $attr_name" >&5
  337. -echo "${ECHO_T}$attr_name" >&6; }
  338. - if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then
  339. -
  340. -cat >>confdefs.h <<_ACEOF
  341. -#define PTHREAD_CREATE_JOINABLE $attr_name
  342. -_ACEOF
  343. -
  344. - fi
  345. -
  346. - { echo "$as_me:$LINENO: checking if more special flags are required for pthreads" >&5
  347. -echo $ECHO_N "checking if more special flags are required for pthreads... $ECHO_C" >&6; }
  348. - flag=no
  349. - case "${host_cpu}-${host_os}" in
  350. - *-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";;
  351. - *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";;
  352. - esac
  353. - { echo "$as_me:$LINENO: result: ${flag}" >&5
  354. -echo "${ECHO_T}${flag}" >&6; }
  355. - if test "x$flag" != xno; then
  356. - PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS"
  357. - fi
  358. -
  359. - LIBS="$save_LIBS"
  360. - CFLAGS="$save_CFLAGS"
  361. -
  362. - # More AIX lossage: must compile with xlc_r or cc_r
  363. - if test x"$GCC" != xyes; then
  364. - for ac_prog in xlc_r cc_r
  365. -do
  366. - # Extract the first word of "$ac_prog", so it can be a program name with args.
  367. -set dummy $ac_prog; ac_word=$2
  368. -{ echo "$as_me:$LINENO: checking for $ac_word" >&5
  369. -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
  370. -if test "${ac_cv_prog_PTHREAD_CC+set}" = set; then
  371. - echo $ECHO_N "(cached) $ECHO_C" >&6
  372. -else
  373. - if test -n "$PTHREAD_CC"; then
  374. - ac_cv_prog_PTHREAD_CC="$PTHREAD_CC" # Let the user override the test.
  375. -else
  376. -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
  377. -for as_dir in $PATH
  378. -do
  379. - IFS=$as_save_IFS
  380. - test -z "$as_dir" && as_dir=.
  381. - for ac_exec_ext in '' $ac_executable_extensions; do
  382. - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
  383. - ac_cv_prog_PTHREAD_CC="$ac_prog"
  384. - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
  385. - break 2
  386. - fi
  387. -done
  388. -done
  389. -IFS=$as_save_IFS
  390. -
  391. -fi
  392. -fi
  393. -PTHREAD_CC=$ac_cv_prog_PTHREAD_CC
  394. -if test -n "$PTHREAD_CC"; then
  395. - { echo "$as_me:$LINENO: result: $PTHREAD_CC" >&5
  396. -echo "${ECHO_T}$PTHREAD_CC" >&6; }
  397. -else
  398. - { echo "$as_me:$LINENO: result: no" >&5
  399. -echo "${ECHO_T}no" >&6; }
  400. -fi
  401. -
  402. -
  403. - test -n "$PTHREAD_CC" && break
  404. -done
  405. -test -n "$PTHREAD_CC" || PTHREAD_CC="${CC}"
  406. -
  407. - else
  408. - PTHREAD_CC=$CC
  409. - fi
  410. -else
  411. - PTHREAD_CC="$CC"
  412. -fi
  413. -
  414. -
  415. -
  416. -
  417. -
  418. -# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
  419. -if test x"$acx_pthread_ok" = xyes; then
  420. -
  421. -cat >>confdefs.h <<\_ACEOF
  422. -#define HAVE_PTHREAD 1
  423. -_ACEOF
  424. -
  425. - :
  426. -else
  427. - acx_pthread_ok=no
  428. -
  429. -fi
  430. -ac_ext=c
  431. -ac_cpp='$CPP $CPPFLAGS'
  432. -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
  433. -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
  434. -ac_compiler_gnu=$ac_cv_c_compiler_gnu
  435. -
  436. -
  437. -
  438. -LIBS="$PTHREAD_LIBS $LIBS"
  439. -CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
  440. -
  441. { echo "$as_me:$LINENO: checking for library containing gethostbyname" >&5
  442. echo $ECHO_N "checking for library containing gethostbyname... $ECHO_C" >&6; }