3 @@ -888,10 +888,6 @@ BUILD_RIPEMD_TRUE
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
20 -# We used to check for pthread.h first, but this fails if pthread.h
21 -# requires special compiler flags (e.g. on True64 or Sequent).
22 -# It gets checked for in the link test anyway.
24 -# First of all, check if the user has set any of the PTHREAD_LIBS,
25 -# etcetera environment variables, and if threads linking works using
27 -if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then
28 - save_CFLAGS="$CFLAGS"
29 - CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
31 - LIBS="$PTHREAD_LIBS $LIBS"
32 - { echo "$as_me:$LINENO: checking for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS" >&5
33 -echo $ECHO_N "checking for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS... $ECHO_C" >&6; }
34 - cat >conftest.$ac_ext <<_ACEOF
37 -cat confdefs.h >>conftest.$ac_ext
38 -cat >>conftest.$ac_ext <<_ACEOF
39 -/* end confdefs.h. */
41 -/* Override any GCC internal prototype to avoid an error.
42 - Use char because int might match the return type of a GCC
43 - builtin and then its argument prototype would still apply. */
47 -char pthread_join ();
51 -return pthread_join ();
56 -rm -f conftest.$ac_objext conftest$ac_exeext
57 -if { (ac_try="$ac_link"
59 - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
60 - *) ac_try_echo=$ac_try;;
62 -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
63 - (eval "$ac_link") 2>conftest.er1
65 - grep -v '^ *+' conftest.er1 >conftest.err
67 - cat conftest.err >&5
68 - echo "$as_me:$LINENO: \$? = $ac_status" >&5
69 - (exit $ac_status); } && {
70 - test -z "$ac_c_werror_flag" ||
71 - test ! -s conftest.err
72 - } && test -s conftest$ac_exeext &&
73 - $as_test_x conftest$ac_exeext; then
76 - echo "$as_me: failed program was:" >&5
77 -sed 's/^/| /' conftest.$ac_ext >&5
82 -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
83 - conftest$ac_exeext conftest.$ac_ext
84 - { echo "$as_me:$LINENO: result: $acx_pthread_ok" >&5
85 -echo "${ECHO_T}$acx_pthread_ok" >&6; }
86 - if test x"$acx_pthread_ok" = xno; then
91 - CFLAGS="$save_CFLAGS"
94 -# We must check for the threads library under a number of different
95 -# names; the ordering is very important because some systems
96 -# (e.g. DEC) have both -lpthread and -lpthreads, where one of the
97 -# libraries is broken (non-POSIX).
99 -# Create a list of thread flags to try. Items starting with a "-" are
100 -# C compiler flags, and other items are library names, except for "none"
101 -# which indicates that we try without any flags at all, and "pthread-config"
102 -# which is a program returning the flags for the Pth emulation library.
104 -acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
106 -# The ordering *is* (sometimes) important. Some notes on the
107 -# individual items follow:
109 -# pthreads: AIX (must check this before -lpthread)
110 -# none: in case threads are in libc; should be tried before -Kthread and
111 -# other compiler flags to prevent continual compiler warnings
112 -# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
113 -# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
114 -# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
115 -# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads)
116 -# -pthreads: Solaris/gcc
117 -# -mthreads: Mingw32/gcc, Lynx/gcc
118 -# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
119 -# doesn't hurt to check since this sometimes defines pthreads too;
120 -# also defines -D_REENTRANT)
121 -# ... -mt is also the pthreads flag for HP/aCC
122 -# pthread: Linux, etcetera
123 -# --thread-safe: KAI C++
124 -# pthread-config: use pthread-config program (for GNU Pth library)
126 -case "${host_cpu}-${host_os}" in
129 - # On Solaris (at least, for some versions), libc contains stubbed
130 - # (non-functional) versions of the pthreads routines, so link-based
131 - # tests will erroneously succeed. (We need to link with -pthreads/-mt/
132 - # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather
133 - # a function called by this macro, so we could check for that, but
134 - # who knows whether they'll stub that too in a future libc.) So,
135 - # we'll just look for -pthreads and -lpthread first:
137 - acx_pthread_flags="-pthreads pthread -mt -pthread $acx_pthread_flags"
141 -if test x"$acx_pthread_ok" = xno; then
142 -for flag in $acx_pthread_flags; do
146 - { echo "$as_me:$LINENO: checking whether pthreads work without any flags" >&5
147 -echo $ECHO_N "checking whether pthreads work without any flags... $ECHO_C" >&6; }
151 - { echo "$as_me:$LINENO: checking whether pthreads work with $flag" >&5
152 -echo $ECHO_N "checking whether pthreads work with $flag... $ECHO_C" >&6; }
153 - PTHREAD_CFLAGS="$flag"
157 - # Extract the first word of "pthread-config", so it can be a program name with args.
158 -set dummy pthread-config; ac_word=$2
159 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5
160 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
161 -if test "${ac_cv_prog_acx_pthread_config+set}" = set; then
162 - echo $ECHO_N "(cached) $ECHO_C" >&6
164 - if test -n "$acx_pthread_config"; then
165 - ac_cv_prog_acx_pthread_config="$acx_pthread_config" # Let the user override the test.
167 -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
171 - test -z "$as_dir" && as_dir=.
172 - for ac_exec_ext in '' $ac_executable_extensions; do
173 - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
174 - ac_cv_prog_acx_pthread_config="yes"
175 - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
182 - test -z "$ac_cv_prog_acx_pthread_config" && ac_cv_prog_acx_pthread_config="no"
185 -acx_pthread_config=$ac_cv_prog_acx_pthread_config
186 -if test -n "$acx_pthread_config"; then
187 - { echo "$as_me:$LINENO: result: $acx_pthread_config" >&5
188 -echo "${ECHO_T}$acx_pthread_config" >&6; }
190 - { echo "$as_me:$LINENO: result: no" >&5
191 -echo "${ECHO_T}no" >&6; }
195 - if test x"$acx_pthread_config" = xno; then continue; fi
196 - PTHREAD_CFLAGS="`pthread-config --cflags`"
197 - PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
201 - { echo "$as_me:$LINENO: checking for the pthreads library -l$flag" >&5
202 -echo $ECHO_N "checking for the pthreads library -l$flag... $ECHO_C" >&6; }
203 - PTHREAD_LIBS="-l$flag"
208 - save_CFLAGS="$CFLAGS"
209 - LIBS="$PTHREAD_LIBS $LIBS"
210 - CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
212 - # Check for various functions. We must include pthread.h,
213 - # since some functions may be macros. (On the Sequent, we
214 - # need a special flag -Kthread to make this header compile.)
215 - # We check for pthread_join because it is in -lpthread on IRIX
216 - # while pthread_create is in libc. We check for pthread_attr_init
217 - # due to DEC craziness with -lpthreads. We check for
218 - # pthread_cleanup_push because it is one of the few pthread
219 - # functions on Solaris that doesn't have a non-functional libc stub.
220 - # We try pthread_create on general principles.
221 - cat >conftest.$ac_ext <<_ACEOF
224 -cat confdefs.h >>conftest.$ac_ext
225 -cat >>conftest.$ac_ext <<_ACEOF
226 -/* end confdefs.h. */
227 -#include <pthread.h>
231 -pthread_t th; pthread_join(th, 0);
232 - pthread_attr_init(0); pthread_cleanup_push(0, 0);
233 - pthread_create(0,0,0,0); pthread_cleanup_pop(0);
238 -rm -f conftest.$ac_objext conftest$ac_exeext
239 -if { (ac_try="$ac_link"
241 - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
242 - *) ac_try_echo=$ac_try;;
244 -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
245 - (eval "$ac_link") 2>conftest.er1
247 - grep -v '^ *+' conftest.er1 >conftest.err
249 - cat conftest.err >&5
250 - echo "$as_me:$LINENO: \$? = $ac_status" >&5
251 - (exit $ac_status); } && {
252 - test -z "$ac_c_werror_flag" ||
253 - test ! -s conftest.err
254 - } && test -s conftest$ac_exeext &&
255 - $as_test_x conftest$ac_exeext; then
258 - echo "$as_me: failed program was:" >&5
259 -sed 's/^/| /' conftest.$ac_ext >&5
264 -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
265 - conftest$ac_exeext conftest.$ac_ext
268 - CFLAGS="$save_CFLAGS"
270 - { echo "$as_me:$LINENO: result: $acx_pthread_ok" >&5
271 -echo "${ECHO_T}$acx_pthread_ok" >&6; }
272 - if test "x$acx_pthread_ok" = xyes; then
281 -# Various other checks:
282 -if test "x$acx_pthread_ok" = xyes; then
284 - LIBS="$PTHREAD_LIBS $LIBS"
285 - save_CFLAGS="$CFLAGS"
286 - CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
288 - # Detect AIX lossage: JOINABLE attribute is called UNDETACHED.
289 - { echo "$as_me:$LINENO: checking for joinable pthread attribute" >&5
290 -echo $ECHO_N "checking for joinable pthread attribute... $ECHO_C" >&6; }
292 - for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do
293 - cat >conftest.$ac_ext <<_ACEOF
296 -cat confdefs.h >>conftest.$ac_ext
297 -cat >>conftest.$ac_ext <<_ACEOF
298 -/* end confdefs.h. */
299 -#include <pthread.h>
303 -int attr=$attr; return attr;
308 -rm -f conftest.$ac_objext conftest$ac_exeext
309 -if { (ac_try="$ac_link"
311 - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
312 - *) ac_try_echo=$ac_try;;
314 -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
315 - (eval "$ac_link") 2>conftest.er1
317 - grep -v '^ *+' conftest.er1 >conftest.err
319 - cat conftest.err >&5
320 - echo "$as_me:$LINENO: \$? = $ac_status" >&5
321 - (exit $ac_status); } && {
322 - test -z "$ac_c_werror_flag" ||
323 - test ! -s conftest.err
324 - } && test -s conftest$ac_exeext &&
325 - $as_test_x conftest$ac_exeext; then
326 - attr_name=$attr; break
328 - echo "$as_me: failed program was:" >&5
329 -sed 's/^/| /' conftest.$ac_ext >&5
334 -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
335 - conftest$ac_exeext conftest.$ac_ext
337 - { echo "$as_me:$LINENO: result: $attr_name" >&5
338 -echo "${ECHO_T}$attr_name" >&6; }
339 - if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then
341 -cat >>confdefs.h <<_ACEOF
342 -#define PTHREAD_CREATE_JOINABLE $attr_name
347 - { echo "$as_me:$LINENO: checking if more special flags are required for pthreads" >&5
348 -echo $ECHO_N "checking if more special flags are required for pthreads... $ECHO_C" >&6; }
350 - case "${host_cpu}-${host_os}" in
351 - *-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";;
352 - *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";;
354 - { echo "$as_me:$LINENO: result: ${flag}" >&5
355 -echo "${ECHO_T}${flag}" >&6; }
356 - if test "x$flag" != xno; then
357 - PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS"
361 - CFLAGS="$save_CFLAGS"
363 - # More AIX lossage: must compile with xlc_r or cc_r
364 - if test x"$GCC" != xyes; then
365 - for ac_prog in xlc_r cc_r
367 - # Extract the first word of "$ac_prog", so it can be a program name with args.
368 -set dummy $ac_prog; ac_word=$2
369 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5
370 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
371 -if test "${ac_cv_prog_PTHREAD_CC+set}" = set; then
372 - echo $ECHO_N "(cached) $ECHO_C" >&6
374 - if test -n "$PTHREAD_CC"; then
375 - ac_cv_prog_PTHREAD_CC="$PTHREAD_CC" # Let the user override the test.
377 -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
381 - test -z "$as_dir" && as_dir=.
382 - for ac_exec_ext in '' $ac_executable_extensions; do
383 - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
384 - ac_cv_prog_PTHREAD_CC="$ac_prog"
385 - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
394 -PTHREAD_CC=$ac_cv_prog_PTHREAD_CC
395 -if test -n "$PTHREAD_CC"; then
396 - { echo "$as_me:$LINENO: result: $PTHREAD_CC" >&5
397 -echo "${ECHO_T}$PTHREAD_CC" >&6; }
399 - { echo "$as_me:$LINENO: result: no" >&5
400 -echo "${ECHO_T}no" >&6; }
404 - test -n "$PTHREAD_CC" && break
406 -test -n "$PTHREAD_CC" || PTHREAD_CC="${CC}"
419 -# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
420 -if test x"$acx_pthread_ok" = xyes; then
422 -cat >>confdefs.h <<\_ACEOF
423 -#define HAVE_PTHREAD 1
432 -ac_cpp='$CPP $CPPFLAGS'
433 -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
434 -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
435 -ac_compiler_gnu=$ac_cv_c_compiler_gnu
439 -LIBS="$PTHREAD_LIBS $LIBS"
440 -CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
443 { echo "$as_me:$LINENO: checking for library containing gethostbyname" >&5
444 echo $ECHO_N "checking for library containing gethostbyname... $ECHO_C" >&6; }