Lines 332-338
Link Here
|
332 |
fi |
332 |
fi |
333 |
# Create a list of thread flags to try. Items starting with a "-" are |
333 |
# Create a list of thread flags to try. Items starting with a "-" are |
334 |
# C compiler flags, and other items are library names, except for "none" |
334 |
# C compiler flags, and other items are library names, except for "none" |
335 |
# which indicates that we try without any flags at all. |
335 |
# which indicates that we try without any flags at all. Also, combinations |
|
|
336 |
# of items (for instance, both a compiler flag and a library name) can be |
337 |
# specified using a colon separator. |
336 |
acx_pthread_flags="pthreads none -Kthread -kthread lthread |
338 |
acx_pthread_flags="pthreads none -Kthread -kthread lthread |
337 |
-pthread -pthreads -mthreads pthread |
339 |
-pthread -pthreads -mthreads pthread |
338 |
--thread-safe -mt" |
340 |
--thread-safe -mt" |
Lines 364-375
Link Here
|
364 |
acx_pthread_flags="-pthread -pthreads pthread -mt $acx_pthread_flags" |
366 |
acx_pthread_flags="-pthread -pthreads pthread -mt $acx_pthread_flags" |
365 |
;; |
367 |
;; |
366 |
esac |
368 |
esac |
|
|
369 |
case "${host_os}-${GCC}" in |
370 |
*linux*-yes) |
371 |
# On Linux/GCC, libtool uses -nostdlib for linking, which cancel part |
372 |
# of the -pthread flag effect (libpthread is not automatically linked). |
373 |
# So we'll try to link with both -pthread and -lpthread first: |
374 |
acx_pthread_flags="-pthread:pthread $acx_pthread_flags" |
375 |
;; |
376 |
esac |
367 |
if test x"$acx_pthread_ok" = xno; then |
377 |
if test x"$acx_pthread_ok" = xno; then |
368 |
for flag in $acx_pthread_flags; do |
378 |
for flag in $acx_pthread_flags; do |
369 |
case $flag in |
379 |
case $flag in |
370 |
none) |
380 |
none) |
371 |
AC_MSG_CHECKING([whether pthreads work without any flags]) |
381 |
AC_MSG_CHECKING([whether pthreads work without any flags]) |
372 |
;; |
382 |
;; |
|
|
383 |
*:*) |
384 |
PTHREAD_CFLAGS="" |
385 |
PTHREAD_LIBS="" |
386 |
message="whether pthreads work with" |
387 |
while test x"$flag" != x; do |
388 |
subflag=`echo $flag | cut -d: -f1` |
389 |
case $subflag in |
390 |
-*) |
391 |
PTHREAD_CFLAGS="$PTHREAD_CFLAGS $subflag" |
392 |
message="$message $subflag" |
393 |
;; |
394 |
*) |
395 |
PTHREAD_LIBS="$PTHREAD_LIBS -l$subflag" |
396 |
message="$message -l$subflag" |
397 |
;; |
398 |
esac |
399 |
flag=`echo $flag | cut -s -d: -f2-` |
400 |
done |
401 |
AC_MSG_CHECKING([$message]) |
402 |
;; |
373 |
-*) |
403 |
-*) |
374 |
AC_MSG_CHECKING([whether pthreads work with $flag]) |
404 |
AC_MSG_CHECKING([whether pthreads work with $flag]) |
375 |
PTHREAD_CFLAGS="$flag" |
405 |
PTHREAD_CFLAGS="$flag" |