Synopsis - Cross-Reference

File: /config/pthread.m4
 1# The following is an adaptation of AC_SEARCH_LIBS to
 2# check for flags required to link with pthread
 3# SYN_SEARCH_PTHREAD
 4# --------------------------------------------------------
 5# Search for a library defining FUNC, if it's not already available.
 6AC_DEFUN([SYN_SEARCH_PTHREAD],
 7[AC_CACHE_CHECK([for flags needed for threading], [ac_cv_search_pthread_create],
 8[ac_func_search_save_LIBS=$LIBS
 9ac_cv_search_pthread_create=no
10AC_LINK_IFELSE([AC_LANG_CALL([], [pthread_create])],
11	       [ac_cv_search_pthread_create="none required"])
12if test "$ac_cv_search_pthread_create" = no; then
13  for ac_lib in -lpthread -Kpthread -Kthread -pthread; do
14    LIBS="$ac_lib $5 $ac_func_search_save_LIBS"
15    AC_LINK_IFELSE([AC_LANG_CALL([], [pthread_create])],
16		   [ac_cv_search_pthread_create="$ac_lib"
17break])
18  done
19fi
20LIBS=$ac_func_search_save_LIBS])
21AS_IF([test "$ac_cv_search_pthread_create" != no],
22  [test "$ac_cv_search_pthread_create" = "none required" || LIBS="$ac_cv_search_pthread_create $LIBS"],
23  [])dnl
24])