xref: /unit/auto/options (revision 1721:53b6ab9b324b)
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        --modules=*)                     NXT_MODULES="$value"                ;;
63        --state=*)                       NXT_STATE="$value"                  ;;
64        --tmp=*)                         NXT_TMP="$value"                    ;;
65
66        --pid=*)                         NXT_PID="$value"                    ;;
67        --log=*)                         NXT_LOG="$value"                    ;;
68
69        --control=*)                     NXT_CONTROL="$value"                ;;
70
71        --user=*)                        NXT_USER="$value"                   ;;
72        --group=*)                       NXT_GROUP="$value"                  ;;
73
74        --debug)                         NXT_DEBUG=YES                       ;;
75
76        --no-ipv6)                       NXT_INET6=NO                        ;;
77        --no-unix-sockets)               NXT_UNIX_DOMAIN=NO                  ;;
78
79        --no-regex)                      NXT_REGEX=NO                        ;;
80        --no-pcre2)                      NXT_TRY_PCRE2=NO                    ;;
81
82        --openssl)                       NXT_OPENSSL=YES                     ;;
83        --gnutls)                        NXT_GNUTLS=YES                      ;;
84        --cyassl)                        NXT_CYASSL=YES                      ;;
85        --polarssl)                      NXT_POLARSSL=YES                    ;;
86
87        --test-build-epoll)              NXT_TEST_BUILD_EPOLL=YES            ;;
88        --test-build-eventport)          NXT_TEST_BUILD_EVENTPORT=YES        ;;
89        --test-build-devpoll)            NXT_TEST_BUILD_DEVPOLL=YES          ;;
90        --test-build-pollset)            NXT_TEST_BUILD_POLLSET=YES          ;;
91
92        --test-build-freebsd-sendfile)   NXT_TEST_BUILD_FREEBSD_SENDFILE=YES ;;
93        --test-build-linux-sendfile)     NXT_TEST_BUILD_LINUX_SENDFILE=YES   ;;
94        --test-build-solaris-sendfilev)  NXT_TEST_BUILD_SOLARIS_SENDFILEV=YES ;;
95        --test-build-macosx-sendfile)    NXT_TEST_BUILD_MACOSX_SENDFILE=YES  ;;
96        --test-build-aix-send_file)      NXT_TEST_BUILD_AIX_SEND_FILE=YES    ;;
97        --test-build-hpux-sendfile)      NXT_TEST_BUILD_HPUX_SENDFILE=YES    ;;
98
99        --tests)                         NXT_TESTS=YES                       ;;
100
101        --help)
102            . auto/help
103            exit 0
104        ;;
105
106        *)
107            $echo
108            $echo $0: error: invalid option \"$nxt_option\".
109            $echo Run \"$0 --help\" to see available options.
110            $echo
111            exit 1
112        ;;
113    esac
114
115    nxt_opt=`$echo $nxt_option | sed -e "s/\(--[^=]*=\)\(.* .*\)/\1'\2'/"`
116
117    NXT_CONFIGURE_OPTIONS="$NXT_CONFIGURE_OPTIONS $nxt_opt"
118
119done
120
121
122case "$NXT_PREFIX" in
123    ""|*/)  ;;
124     *)  NXT_PREFIX="$NXT_PREFIX/"  ;;
125esac
126
127case "$NXT_BINDIR" in
128    /*)  ;;
129     *)  NXT_BINDIR="$NXT_PREFIX$NXT_BINDIR"  ;;
130esac
131
132case "$NXT_SBINDIR" in
133    /*)  ;;
134     *)  NXT_SBINDIR="$NXT_PREFIX$NXT_SBINDIR"  ;;
135esac
136
137case "$NXT_LIBDIR" in
138    /*)  ;;
139     *)  NXT_LIBDIR="$NXT_PREFIX$NXT_LIBDIR"  ;;
140esac
141
142case "$NXT_INCDIR" in
143    /*)  ;;
144     *)  NXT_INCDIR="$NXT_PREFIX$NXT_INCDIR"  ;;
145esac
146
147case "$NXT_MODULES" in
148    /*)  ;;
149     *)  NXT_MODULES="$NXT_PREFIX$NXT_MODULES"  ;;
150esac
151
152case "$NXT_STATE" in
153    /*)  ;;
154     *)  NXT_STATE="$NXT_PREFIX$NXT_STATE"  ;;
155esac
156
157case "$NXT_TMP" in
158    /*)  ;;
159     *)  NXT_TMP="$NXT_PREFIX$NXT_TMP"  ;;
160esac
161
162case "$NXT_PID" in
163    /*)  ;;
164     *)  NXT_PID="$NXT_PREFIX$NXT_PID"  ;;
165esac
166
167case "$NXT_LOG" in
168    /*)  ;;
169     *)  NXT_LOG="$NXT_PREFIX$NXT_LOG"  ;;
170esac
171
172case "$NXT_CONTROL" in
173    unix:/*)  ;;
174    unix:*)   NXT_CONTROL="unix:$NXT_PREFIX${NXT_CONTROL##unix:}" ;;
175    *)        ;;
176esac
177