xref: /unit/auto/options (revision 0:a63ceefd6ab0)
1
2# Copyright (C) Igor Sysoev
3# Copyright (C) Valentin V. Bartenev
4# Copyright (C) NGINX, Inc.
5
6
7CC=${CC:-cc}
8
9NXT_BUILD_DIR=build
10NXT_CONFIGURE_OPTIONS=
11NXT_CFLAGS=
12NXT_CC_OPT=
13NXT_LD_OPT=
14
15NXT_DEBUG=NO
16NXT_THREADS=YES
17
18NXT_INET6=NO
19NXT_UNIX_DOMAIN=YES
20
21NXT_REGEX=NO
22NXT_PCRE=NO
23
24NXT_SSLTLS=NO
25NXT_OPENSSL=NO
26NXT_GNUTLS=NO
27NXT_CYASSL=NO
28NXT_POLARSSL=NO
29
30NXT_TEST_BUILD_EPOLL=NO
31NXT_TEST_BUILD_EVENTPORT=NO
32NXT_TEST_BUILD_DEVPOLL=NO
33NXT_TEST_BUILD_POLLSET=NO
34
35NXT_TEST_BUILD_FREEBSD_SENDFILE=NO
36NXT_TEST_BUILD_LINUX_SENDFILE=NO
37NXT_TEST_BUILD_MACOSX_SENDFILE=NO
38NXT_TEST_BUILD_SOLARIS_SENDFILEV=NO
39NXT_TEST_BUILD_AIX_SEND_FILE=NO
40NXT_TEST_BUILD_HPUX_SENDFILE=NO
41
42NXT_LIB_UNIT_TEST=NO
43
44NXT_PYTHON=python
45NXT_PYTHON_MODULE=NO
46
47
48for nxt_option
49do
50    case "$nxt_option" in
51        -*=*) value=`$echo "$nxt_option" | sed -e 's/[-_a-zA-Z0-9]*=//'`     ;;
52           *) value="" ;;
53    esac
54
55    case "$nxt_option" in
56        --with-cc=*)                     CC="$value"                         ;;
57        --with-cc-opt=*)                 NXT_CC_OPT="$value"                 ;;
58        --with-ld-opt=*)                 NXT_LD_OPT="$value"                 ;;
59
60        --build-dir=*)                   NXT_BUILD_DIR="$value"              ;;
61
62        --with-debug)                    NXT_DEBUG=YES                       ;;
63
64        --with-threads)                  NXT_THREADS=YES                     ;;
65        --without-threads)               NXT_THREADS=NO                      ;;
66
67        --with-ipv6)                     NXT_INET6=YES                       ;;
68        --with-inet6)                    NXT_INET6=YES                       ;;
69        --without-unix-domain)           NXT_UNIX_DOMAIN=NO                  ;;
70
71        --with-pcre)                     NXT_PCRE=YES                        ;;
72
73        --with-ssltls)                   NXT_SSLTLS=YES                      ;;
74        --with-openssl)                  NXT_OPENSSL=YES                     ;;
75        --with-gnutls)                   NXT_GNUTLS=YES                      ;;
76        --with-cyassl)                   NXT_CYASSL=YES                      ;;
77        --with-polarssl)                 NXT_POLARSSL=YES                    ;;
78
79        --test-build-epoll)              NXT_TEST_BUILD_EPOLL=YES            ;;
80        --test-build-eventport)          NXT_TEST_BUILD_EVENTPORT=YES        ;;
81        --test-build-devpoll)            NXT_TEST_BUILD_DEVPOLL=YES          ;;
82        --test-build-pollset)            NXT_TEST_BUILD_POLLSET=YES          ;;
83
84        --test-build-freebsd-sendfile)   NXT_TEST_BUILD_FREEBSD_SENDFILE=YES ;;
85        --test-build-linux-sendfile)     NXT_TEST_BUILD_LINUX_SENDFILE=YES   ;;
86        --test-build-solaris-sendfilev)  NXT_TEST_BUILD_SOLARIS_SENDFILEV=YES ;;
87        --test-build-macosx-sendfile)    NXT_TEST_BUILD_MACOSX_SENDFILE=YES  ;;
88        --test-build-aix-send_file)      NXT_TEST_BUILD_AIX_SEND_FILE=YES    ;;
89        --test-build-hpux-sendfile)      NXT_TEST_BUILD_HPUX_SENDFILE=YES    ;;
90
91        --with-lib-unit-tests)           NXT_LIB_UNIT_TEST=YES               ;;
92
93        --with-python=*)                 NXT_PYTHON="$value"                 ;;
94        --with-python_module)            NXT_PYTHON_MODULE=YES               ;;
95
96        *)
97            $echo
98            $echo "$0: error: invalid option \"$nxt_option\"".
99            $echo
100            exit 1
101        ;;
102    esac
103
104    nxt_opt=`$echo $nxt_option | sed -e "s/\(--[^=]*=\)\(.* .*\)/\1'\2'/"`
105
106    NXT_CONFIGURE_OPTIONS="$NXT_CONFIGURE_OPTIONS $nxt_opt"
107
108done
109