xref: /unit/configure (revision 2150:393e49268716)
10Sigor@sysoev.ru#!/bin/sh
20Sigor@sysoev.ru
30Sigor@sysoev.ru# Copyright (C) Igor Sysoev
40Sigor@sysoev.ru# Copyright (C) NGINX, Inc.
50Sigor@sysoev.ru
60Sigor@sysoev.ru
70Sigor@sysoev.ru# Disable localized program messages.
8734Svbart@nginx.comLC_ALL=C
9734Svbart@nginx.comexport LC_ALL
100Sigor@sysoev.ru
110Sigor@sysoev.ru# Stop on error exit status.
120Sigor@sysoev.ruset -e
130Sigor@sysoev.ru
140Sigor@sysoev.ru# Stop on uninitialized variable.
150Sigor@sysoev.ruset -u
160Sigor@sysoev.ru
170Sigor@sysoev.ru# Initialize variables with null values if they are not defined.
180Sigor@sysoev.ruCFLAGS=${CFLAGS=}
190Sigor@sysoev.ruNXT_TEST_CFLAGS=${NXT_TEST_CFLAGS=}
200Sigor@sysoev.ruNXT_TEST_LIBS=${NXT_TEST_LIBS=}
210Sigor@sysoev.ru
22266Sigor@sysoev.ruNXT_BUILD_DIR=${NXT_BUILD_DIR:-build}
23216Sigor@sysoev.ru
24216Sigor@sysoev.ruNXT_AUTOTEST=$NXT_BUILD_DIR/autotest
25216Sigor@sysoev.ruNXT_AUTOCONF_ERR=$NXT_BUILD_DIR/autoconf.err
26216Sigor@sysoev.ruNXT_AUTOCONF_DATA=$NXT_BUILD_DIR/autoconf.data
27216Sigor@sysoev.ruNXT_AUTO_CONFIG_H=$NXT_BUILD_DIR/nxt_auto_config.h
28953Salexander.borisov@nginx.comNXT_VERSION_H=$NXT_BUILD_DIR/nxt_version.h
29216Sigor@sysoev.ruNXT_MAKEFILE=$NXT_BUILD_DIR/Makefile
30235Sigor@sysoev.ru
31235Sigor@sysoev.ruCC=${CC:-cc}
32235Sigor@sysoev.ru
33265Smax.romanov@nginx.comNXT_DAEMON=unitd
34265Smax.romanov@nginx.comNXT_BINDIR="bin"
35265Smax.romanov@nginx.comNXT_SBINDIR="sbin"
36805Smax.romanov@nginx.comNXT_LIBDIR="lib"
37805Smax.romanov@nginx.comNXT_INCDIR="include"
381825Sthresh@nginx.comNXT_MANDIR="share/man"
39707Sigor@sysoev.ruNXT_MODULES="modules"
40707Sigor@sysoev.ruNXT_STATE="state"
411403Smax.romanov@nginx.comNXT_TMP="tmp"
42259Sigor@sysoev.ruNXT_PID="unit.pid"
43259Sigor@sysoev.ruNXT_LOG="unit.log"
44235Sigor@sysoev.ruNXT_CONTROL="unix:control.unit.sock"
45235Sigor@sysoev.ruNXT_USER="nobody"
46235Sigor@sysoev.ruNXT_GROUP=
47235Sigor@sysoev.ru
48235Sigor@sysoev.runxt_module=${1:-""}
49216Sigor@sysoev.ru
50216Sigor@sysoev.rucase $nxt_module in
51235Sigor@sysoev.ru    ""|--*)
52216Sigor@sysoev.ru    ;;
53216Sigor@sysoev.ru
54216Sigor@sysoev.ru    unit)
55216Sigor@sysoev.ru        shift
56216Sigor@sysoev.ru    ;;
57216Sigor@sysoev.ru
58216Sigor@sysoev.ru    *)
59216Sigor@sysoev.ru        . auto/modules/conf
60216Sigor@sysoev.ru        exit 0
61216Sigor@sysoev.ru    ;;
62216Sigor@sysoev.ruesac
63216Sigor@sysoev.ru
64235Sigor@sysoev.ru
65*2051Svbart@nginx.com. ./version
660Sigor@sysoev.ru. auto/os/test
670Sigor@sysoev.ru. auto/options
680Sigor@sysoev.ru
690Sigor@sysoev.rutest -d $NXT_BUILD_DIR || mkdir $NXT_BUILD_DIR
700Sigor@sysoev.ru
710Sigor@sysoev.ru> $NXT_AUTOCONF_ERR
720Sigor@sysoev.ru> $NXT_AUTO_CONFIG_H
730Sigor@sysoev.ru
740Sigor@sysoev.ru. auto/cc/test
750Sigor@sysoev.ru
760Sigor@sysoev.ru
770Sigor@sysoev.rucat << END >> $NXT_AUTO_CONFIG_H
780Sigor@sysoev.ru
790Sigor@sysoev.ru#define NXT_CONFIGURE_OPTIONS  "$NXT_CONFIGURE_OPTIONS"
800Sigor@sysoev.ru#define NXT_SYSTEM_VERSION     "$NXT_SYSTEM $NXT_SYSTEM_VERSION $NXT_SYSTEM_PLATFORM"
810Sigor@sysoev.ru#define NXT_COMPILER_VERSION   "$NXT_CC_VERSION"
820Sigor@sysoev.ru
83231Sigor@sysoev.ru#define NXT_PID                "$NXT_PID"
84230Sigor@sysoev.ru#define NXT_LOG                "$NXT_LOG"
85233Sigor@sysoev.ru#define NXT_MODULES            "$NXT_MODULES"
86314Svbart@nginx.com#define NXT_STATE              "$NXT_STATE"
871403Smax.romanov@nginx.com#define NXT_TMP                "$NXT_TMP"
88230Sigor@sysoev.ru
89234Sigor@sysoev.ru#define NXT_CONTROL_SOCK       "$NXT_CONTROL"
90234Sigor@sysoev.ru
91232Sigor@sysoev.ru#define NXT_USER               "$NXT_USER"
92232Sigor@sysoev.ru#define NXT_GROUP              "$NXT_GROUP"
93232Sigor@sysoev.ru
940Sigor@sysoev.ruEND
950Sigor@sysoev.ru
960Sigor@sysoev.ru
970Sigor@sysoev.ruif [ $echo = echo ]; then
980Sigor@sysoev.ru    # Build a portable "echo" program that supports only "-n" option.
990Sigor@sysoev.ru    # This also tests C compiler ability to create executables.
1000Sigor@sysoev.ru    . auto/echo/build
1010Sigor@sysoev.rufi
1020Sigor@sysoev.ru
1030Sigor@sysoev.ru
1040Sigor@sysoev.runxt_have=NXT_UNIX . auto/have
1050Sigor@sysoev.ru
1060Sigor@sysoev.ruif [ $NXT_UNIX_DOMAIN = YES ]; then
1070Sigor@sysoev.ru    nxt_have=NXT_HAVE_UNIX_DOMAIN . auto/have
1080Sigor@sysoev.rufi
1090Sigor@sysoev.ru
110334Spluknet@nginx.comNXT_LIBRT=
111334Spluknet@nginx.com
1120Sigor@sysoev.ru. auto/types
1130Sigor@sysoev.ru. auto/clang
1140Sigor@sysoev.ru. auto/atomic
1150Sigor@sysoev.ru. auto/malloc
1160Sigor@sysoev.ru. auto/mmap
11742Smax.romanov@nginx.com. auto/shmem
1180Sigor@sysoev.ru. auto/time
119223Sigor@sysoev.ru. auto/threads
1200Sigor@sysoev.ru. auto/events
1210Sigor@sysoev.ru. auto/sockets
1220Sigor@sysoev.ru. auto/sendfile
1230Sigor@sysoev.ru. auto/files
1240Sigor@sysoev.ru. auto/unix
1250Sigor@sysoev.ru. auto/os/conf
1260Sigor@sysoev.ru. auto/ssltls
1271721Saxel.duch@nginx.com
1281721Saxel.duch@nginx.comif [ $NXT_REGEX = YES ]; then
1291721Saxel.duch@nginx.com    . auto/pcre
1301721Saxel.duch@nginx.comfi
1311721Saxel.duch@nginx.com
1321182St.nateldemoura@f5.com. auto/isolation
1331182St.nateldemoura@f5.com. auto/capability
1340Sigor@sysoev.ru
1350Sigor@sysoev.ru
1360Sigor@sysoev.rucase "$NXT_SYSTEM_PLATFORM" in
1370Sigor@sysoev.ru    i386 | amd64 | x86_64)
1380Sigor@sysoev.ru        nxt_have=NXT_HAVE_LITTLE_ENDIAN . auto/have
1390Sigor@sysoev.ru        nxt_have=NXT_HAVE_NONALIGNED . auto/have
1400Sigor@sysoev.ru    ;;
1410Sigor@sysoev.ruesac
1420Sigor@sysoev.ru
1430Sigor@sysoev.ru
1440Sigor@sysoev.ruif [ $NXT_DEBUG = YES ]; then
145360Sigor@sysoev.ru    nxt_debug=1
146360Sigor@sysoev.ruelse
147360Sigor@sysoev.ru    nxt_debug=0
1480Sigor@sysoev.rufi
1490Sigor@sysoev.ru
150360Sigor@sysoev.rucat << END >> $NXT_AUTO_CONFIG_H
151360Sigor@sysoev.ru
152360Sigor@sysoev.ru#ifndef NXT_DEBUG
153360Sigor@sysoev.ru#define NXT_DEBUG  $nxt_debug
154360Sigor@sysoev.ru#endif
155360Sigor@sysoev.ru
156461Sigor@sysoev.ru#define NXT_SHM_PREFIX  "$NXT_SHM_PREFIX"
157461Sigor@sysoev.ru
158360Sigor@sysoev.ruEND
1590Sigor@sysoev.ru
1600Sigor@sysoev.ru. auto/test_build
1610Sigor@sysoev.ru. auto/sources
162216Sigor@sysoev.ru. auto/save
1630Sigor@sysoev.ru
1640Sigor@sysoev.ru# LOOK
1650Sigor@sysoev.ru
1660Sigor@sysoev.ruNXT_LIB_AUX_CFLAGS="$NXT_OPENSSL_CFLAGS $NXT_GNUTLS_CFLAGS \\
1670Sigor@sysoev.ru                    $NXT_CYASSL_CFLAGS $NXT_POLARSSL_CFLAGS \\
1680Sigor@sysoev.ru                    $NXT_PCRE_CFLAGS"
1690Sigor@sysoev.ru
1700Sigor@sysoev.ruNXT_LIB_AUX_LIBS="$NXT_OPENSSL_LIBS $NXT_GNUTLS_LIBS \\
1710Sigor@sysoev.ru                    $NXT_CYASSL_LIBS $NXT_POLARSSL_LIBS \\
1720Sigor@sysoev.ru                    $NXT_PCRE_LIB"
1730Sigor@sysoev.ru
1740Sigor@sysoev.ru. auto/make
175236Sigor@sysoev.ru. auto/summary
176