xref: /unit/auto/options (revision 1825:8d0b26746b02)
1
2# Copyright (C) Igor Sysoev
3# Copyright (C) Valentin V. Bartenev
4# Copyright (C) NGINX, Inc.
5
6
7NXT_CONFIGURE_OPTIONS=
8NXT_CFLAGS=
9NXT_CC_OPT=
10NXT_LD_OPT=
11
12NXT_PREFIX=
13
14NXT_DEBUG=NO
15
16NXT_INET6=YES
17NXT_UNIX_DOMAIN=YES
18
19NXT_PCRE_CFLAGS=
20NXT_PCRE_LIB=
21
22NXT_REGEX=YES
23NXT_TRY_PCRE2=YES
24
25NXT_TLS=NO
26NXT_OPENSSL=NO
27NXT_GNUTLS=NO
28NXT_CYASSL=NO
29NXT_POLARSSL=NO
30
31NXT_TEST_BUILD_EPOLL=NO
32NXT_TEST_BUILD_EVENTPORT=NO
33NXT_TEST_BUILD_DEVPOLL=NO
34NXT_TEST_BUILD_POLLSET=NO
35
36NXT_TEST_BUILD_FREEBSD_SENDFILE=NO
37NXT_TEST_BUILD_LINUX_SENDFILE=NO
38NXT_TEST_BUILD_MACOSX_SENDFILE=NO
39NXT_TEST_BUILD_SOLARIS_SENDFILEV=NO
40NXT_TEST_BUILD_AIX_SEND_FILE=NO
41NXT_TEST_BUILD_HPUX_SENDFILE=NO
42
43NXT_TESTS=NO
44
45for nxt_option
46do
47    case "$nxt_option" in
48        -*=*) value=`$echo "$nxt_option" | sed -e 's/[-_a-zA-Z0-9]*=//'`     ;;
49           *) value="" ;;
50    esac
51
52    case "$nxt_option" in
53        --cc=*)                          CC="$value"                         ;;
54        --cc-opt=*)                      NXT_CC_OPT="$value"                 ;;
55        --ld-opt=*)                      NXT_LD_OPT="$value"                 ;;
56
57        --prefix=*)                      NXT_PREFIX="$value"                 ;;
58        --bindir=*)                      NXT_BINDIR="$value"                 ;;
59        --sbindir=*)                     NXT_SBINDIR="$value"                ;;
60        --libdir=*)                      NXT_LIBDIR="$value"                 ;;
61        --incdir=*)                      NXT_INCDIR="$value"                 ;;
62        --mandir=*)                      NXT_MANDIR="$value"                 ;;
63        --modules=*)                     NXT_MODULES="$value"                ;;
64        --state=*)                       NXT_STATE="$value"                  ;;
65        --tmp=*)                         NXT_TMP="$value"                    ;;
66
67        --pid=*)                         NXT_PID="$value"                    ;;
68        --log=*)                         NXT_LOG="$value"                    ;;
69
70        --control=*)                     NXT_CONTROL="$value"                ;;
71
72        --user=*)                        NXT_USER="$value"                   ;;
73        --group=*)                       NXT_GROUP="$value"                  ;;
74
75        --debug)                         NXT_DEBUG=YES                       ;;
76
77        --no-ipv6)                       NXT_INET6=NO                        ;;
78        --no-unix-sockets)               NXT_UNIX_DOMAIN=NO                  ;;
79
80        --no-regex)                      NXT_REGEX=NO                        ;;
81        --no-pcre2)                      NXT_TRY_PCRE2=NO                    ;;
82
83        --openssl)                       NXT_OPENSSL=YES                     ;;
84        --gnutls)                        NXT_GNUTLS=YES                      ;;
85        --cyassl)                        NXT_CYASSL=YES                      ;;
86        --polarssl)                      NXT_POLARSSL=YES                    ;;
87
88        --test-build-epoll)              NXT_TEST_BUILD_EPOLL=YES            ;;
89        --test-build-eventport)          NXT_TEST_BUILD_EVENTPORT=YES        ;;
90        --test-build-devpoll)            NXT_TEST_BUILD_DEVPOLL=YES          ;;
91        --test-build-pollset)            NXT_TEST_BUILD_POLLSET=YES          ;;
92
93        --test-build-freebsd-sendfile)   NXT_TEST_BUILD_FREEBSD_SENDFILE=YES ;;
94        --test-build-linux-sendfile)     NXT_TEST_BUILD_LINUX_SENDFILE=YES   ;;
95        --test-build-solaris-sendfilev)  NXT_TEST_BUILD_SOLARIS_SENDFILEV=YES ;;
96        --test-build-macosx-sendfile)    NXT_TEST_BUILD_MACOSX_SENDFILE=YES  ;;
97        --test-build-aix-send_file)      NXT_TEST_BUILD_AIX_SEND_FILE=YES    ;;
98        --test-build-hpux-sendfile)      NXT_TEST_BUILD_HPUX_SENDFILE=YES    ;;
99
100        --tests)                         NXT_TESTS=YES                       ;;
101
102        --help)
103            . auto/help
104            exit 0
105        ;;
106
107        *)
108            $echo
109            $echo $0: error: invalid option \"$nxt_option\".
110            $echo Run \"$0 --help\" to see available options.
111            $echo
112            exit 1
113        ;;
114    esac
115
116    nxt_opt=`$echo $nxt_option | sed -e "s/\(--[^=]*=\)\(.* .*\)/\1'\2'/"`
117
118    NXT_CONFIGURE_OPTIONS="$NXT_CONFIGURE_OPTIONS $nxt_opt"
119
120done
121
122
123case "$NXT_PREFIX" in
124    ""|*/)  ;;
125     *)  NXT_PREFIX="$NXT_PREFIX/"  ;;
126esac
127
128case "$NXT_BINDIR" in
129    /*)  ;;
130     *)  NXT_BINDIR="$NXT_PREFIX$NXT_BINDIR"  ;;
131esac
132
133case "$NXT_SBINDIR" in
134    /*)  ;;
135     *)  NXT_SBINDIR="$NXT_PREFIX$NXT_SBINDIR"  ;;
136esac
137
138case "$NXT_LIBDIR" in
139    /*)  ;;
140     *)  NXT_LIBDIR="$NXT_PREFIX$NXT_LIBDIR"  ;;
141esac
142
143case "$NXT_INCDIR" in
144    /*)  ;;
145     *)  NXT_INCDIR="$NXT_PREFIX$NXT_INCDIR"  ;;
146esac
147
148case "$NXT_MANDIR" in
149    /*)  ;;
150     *)  NXT_MANDIR="$NXT_PREFIX$NXT_MANDIR"  ;;
151esac
152
153case "$NXT_MODULES" in
154    /*)  ;;
155     *)  NXT_MODULES="$NXT_PREFIX$NXT_MODULES"  ;;
156esac
157
158case "$NXT_STATE" in
159    /*)  ;;
160     *)  NXT_STATE="$NXT_PREFIX$NXT_STATE"  ;;
161esac
162
163case "$NXT_TMP" in
164    /*)  ;;
165     *)  NXT_TMP="$NXT_PREFIX$NXT_TMP"  ;;
166esac
167
168case "$NXT_PID" in
169    /*)  ;;
170     *)  NXT_PID="$NXT_PREFIX$NXT_PID"  ;;
171esac
172
173case "$NXT_LOG" in
174    /*)  ;;
175     *)  NXT_LOG="$NXT_PREFIX$NXT_LOG"  ;;
176esac
177
178case "$NXT_CONTROL" in
179    unix:/*)  ;;
180    unix:*)   NXT_CONTROL="unix:$NXT_PREFIX${NXT_CONTROL##unix:}" ;;
181    *)        ;;
182esac
183