blob: 29bc72476f99fe7991c5e16ea8da821b8e8a36b5 [file] [log] [blame]
Igor Sysoevb54698b2004-02-23 20:57:12 +00001
Igor Sysoevff8da912004-09-29 16:00:49 +00002# Copyright (C) Igor Sysoev
3
4
Igor Sysoev32fcd5c2004-07-05 06:55:54 +00005case $USE_THREADS in
6 rfork)
7 have=NGX_THREADS . auto/have
8 have=NGX_USE_RFORK . auto/have
9 CORE_DEPS="$CORE_DEPS $FREEBSD_RFORK_DEPS"
10 CORE_SRCS="$CORE_SRCS $FREEBSD_RFORK_SRCS"
Igor Sysoev48fef662004-02-24 17:31:46 +000011
Igor Sysoevd039a2e2005-02-22 14:40:13 +000012 case "$NGX_PLATFORM" in
Igor Sysoev32fcd5c2004-07-05 06:55:54 +000013 *:i386)
14 if [ \( $version -gt 500000 -a $version -lt 501000 \) \
15 -o $version -lt 491000 ]
16 then
17 CORE_SRCS="$CORE_SRCS $FREEBSD_RFORK_THREAD_SRCS"
18 fi
19 ;;
20 esac
21 ;;
Igor Sysoev48fef662004-02-24 17:31:46 +000022
Igor Sysoev723e6cc2004-10-25 15:29:23 +000023 pthreads)
Igor Sysoev32fcd5c2004-07-05 06:55:54 +000024 have=NGX_THREADS . auto/have
25 CORE_SRCS="$CORE_SRCS $PTHREAD_SRCS"
26 CORE_LIBS="$CORE_LIBS -lpthread"
27 ;;
Igor Sysoev48fef662004-02-24 17:31:46 +000028
Igor Sysoev723e6cc2004-10-25 15:29:23 +000029 libthr)
Igor Sysoev32fcd5c2004-07-05 06:55:54 +000030 have=NGX_THREADS . auto/have
Igor Sysoev32fcd5c2004-07-05 06:55:54 +000031 CORE_SRCS="$CORE_SRCS $PTHREAD_SRCS"
Igor Sysoev723e6cc2004-10-25 15:29:23 +000032 CORE_LIBS="$CORE_LIBS -lthr"
Igor Sysoev32fcd5c2004-07-05 06:55:54 +000033 ;;
34
Igor Sysoev8e811c12004-07-07 19:48:31 +000035 linuxthreads)
36 have=NGX_THREADS . auto/have
37 have=NGX_LINUXTHREADS . auto/have
38 CFLAGS="$CFLAGS -D_THREAD_SAFE"
39 CFLAGS="$CFLAGS -I /usr/local/include/pthread/linuxthreads"
40 CORE_SRCS="$CORE_SRCS $PTHREAD_SRCS"
41 CORE_LIBS="$CORE_LIBS -L /usr/local/lib -llthread -llgcc_r"
42 ;;
43
Igor Sysoev723e6cc2004-10-25 15:29:23 +000044 libc_r)
Igor Sysoevd039a2e2005-02-22 14:40:13 +000045 case "$NGX_PLATFORM" in
Igor Sysoev723e6cc2004-10-25 15:29:23 +000046 FreeBSD:[34]*)
47 have=NGX_THREADS . auto/have
48 CFLAGS="$CFLAGS -pthread"
49 CORE_SRCS="$CORE_SRCS $PTHREAD_SRCS"
50 CORE_LIBS="$CORE_LIBS -pthread"
51 ;;
52
Igor Sysoev697d1ae2005-10-27 15:46:13 +000053 FreeBSD:[56]*)
Igor Sysoev723e6cc2004-10-25 15:29:23 +000054 have=NGX_THREADS . auto/have
55 CORE_SRCS="$CORE_SRCS $PTHREAD_SRCS"
56 CORE_LIBS="$CORE_LIBS -lc_r"
57 ;;
58 esac
Igor Sysoev32fcd5c2004-07-05 06:55:54 +000059 ;;
60
Igor Sysoev723e6cc2004-10-25 15:29:23 +000061 NO)
Igor Sysoev32fcd5c2004-07-05 06:55:54 +000062 ;;
63
Igor Sysoev723e6cc2004-10-25 15:29:23 +000064 *)
Igor Sysoev32fcd5c2004-07-05 06:55:54 +000065 have=NGX_THREADS . auto/have
66 CORE_SRCS="$CORE_SRCS $PTHREAD_SRCS"
Igor Sysoev723e6cc2004-10-25 15:29:23 +000067 CORE_LIBS="$CORE_LIBS -l$USE_THREADS"
Igor Sysoev32fcd5c2004-07-05 06:55:54 +000068 ;;
69
70esac