threads 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. # Copyright (C) Igor Sysoev
  2. case $USE_THREADS in
  3. rfork)
  4. have=NGX_THREADS . auto/have
  5. have=NGX_USE_RFORK . auto/have
  6. CORE_DEPS="$CORE_DEPS $FREEBSD_RFORK_DEPS"
  7. CORE_SRCS="$CORE_SRCS $FREEBSD_RFORK_SRCS"
  8. case "$NGX_PLATFORM" in
  9. *:i386)
  10. if [ \( $version -gt 500000 -a $version -lt 501000 \) \
  11. -o $version -lt 491000 ]
  12. then
  13. CORE_SRCS="$CORE_SRCS $FREEBSD_RFORK_THREAD_SRCS"
  14. fi
  15. ;;
  16. esac
  17. ;;
  18. pthreads)
  19. have=NGX_THREADS . auto/have
  20. CORE_SRCS="$CORE_SRCS $PTHREAD_SRCS"
  21. CORE_LIBS="$CORE_LIBS -lpthread"
  22. ;;
  23. libthr)
  24. have=NGX_THREADS . auto/have
  25. CORE_SRCS="$CORE_SRCS $PTHREAD_SRCS"
  26. CORE_LIBS="$CORE_LIBS -lthr"
  27. ;;
  28. linuxthreads)
  29. have=NGX_THREADS . auto/have
  30. have=NGX_LINUXTHREADS . auto/have
  31. CFLAGS="$CFLAGS -D_THREAD_SAFE"
  32. CFLAGS="$CFLAGS -I /usr/local/include/pthread/linuxthreads"
  33. CORE_SRCS="$CORE_SRCS $PTHREAD_SRCS"
  34. CORE_LIBS="$CORE_LIBS -L /usr/local/lib -llthread -llgcc_r"
  35. ;;
  36. libc_r)
  37. case "$NGX_PLATFORM" in
  38. FreeBSD:[34]*)
  39. have=NGX_THREADS . auto/have
  40. CFLAGS="$CFLAGS -pthread"
  41. CORE_SRCS="$CORE_SRCS $PTHREAD_SRCS"
  42. CORE_LIBS="$CORE_LIBS -pthread"
  43. ;;
  44. FreeBSD:[56]*)
  45. have=NGX_THREADS . auto/have
  46. CORE_SRCS="$CORE_SRCS $PTHREAD_SRCS"
  47. CORE_LIBS="$CORE_LIBS -lc_r"
  48. ;;
  49. esac
  50. ;;
  51. NO)
  52. ;;
  53. *)
  54. have=NGX_THREADS . auto/have
  55. CORE_SRCS="$CORE_SRCS $PTHREAD_SRCS"
  56. CORE_LIBS="$CORE_LIBS -l$USE_THREADS"
  57. ;;
  58. esac