/crypto/heimdal/cf/pthreads.m4

https://bitbucket.org/freebsd/freebsd-head/ · m4 · 75 lines · 68 code · 7 blank · 0 comment · 0 complexity · defa9b04e74151eefd7f5e329df74d59 MD5 · raw file

  1. dnl $Id: pthreads.m4 20295 2007-04-11 11:08:08Z lha $
  2. AC_DEFUN([KRB_PTHREADS], [
  3. AC_MSG_CHECKING(if compiling threadsafe libraries)
  4. AC_ARG_ENABLE(pthread-support,
  5. AS_HELP_STRING([--enable-pthread-support],
  6. [if you want thread safe libraries]),
  7. [],[enable_pthread_support=maybe])
  8. case "$host" in
  9. *-*-solaris2*)
  10. native_pthread_support=yes
  11. if test "$GCC" = yes; then
  12. PTHREADS_CFLAGS=-pthreads
  13. PTHREADS_LIBS=-pthreads
  14. else
  15. PTHREADS_CFLAGS=-mt
  16. PTHREADS_LIBS=-mt
  17. fi
  18. ;;
  19. *-*-netbsd*)
  20. native_pthread_support="if running netbsd 1.6T or newer"
  21. dnl heim_threads.h knows this
  22. PTHREADS_LIBS=""
  23. ;;
  24. *-*-freebsd5*)
  25. native_pthread_support=yes
  26. ;;
  27. *-*-linux* | *-*-linux-gnu)
  28. case `uname -r` in
  29. 2.*)
  30. native_pthread_support=yes
  31. PTHREADS_CFLAGS=-pthread
  32. PTHREADS_LIBS=-pthread
  33. ;;
  34. esac
  35. ;;
  36. *-*-aix*)
  37. dnl AIX is disabled since we don't handle the utmp/utmpx
  38. dnl problems that aix causes when compiling with pthread support
  39. native_pthread_support=no
  40. ;;
  41. mips-sgi-irix6.[[5-9]]) # maybe works for earlier versions too
  42. native_pthread_support=yes
  43. PTHREADS_LIBS="-lpthread"
  44. ;;
  45. *-*-darwin*)
  46. native_pthread_support=yes
  47. ;;
  48. *)
  49. native_pthread_support=no
  50. ;;
  51. esac
  52. if test "$enable_pthread_support" = maybe ; then
  53. enable_pthread_support="$native_pthread_support"
  54. fi
  55. if test "$enable_pthread_support" != no; then
  56. AC_DEFINE(ENABLE_PTHREAD_SUPPORT, 1,
  57. [Define if you want have a thread safe libraries])
  58. dnl This sucks, but libtool doesn't save the depenecy on -pthread
  59. dnl for libraries.
  60. LIBS="$PTHREADS_LIBS $LIBS"
  61. else
  62. PTHREADS_CFLAGS=""
  63. PTHREADS_LIBS=""
  64. fi
  65. AC_SUBST(PTHREADS_CFLAGS)
  66. AC_SUBST(PTHREADS_LIBS)
  67. AC_MSG_RESULT($enable_pthread_support)
  68. ])