blob: b734c336e28a3b483a963549b4bf196070b36083 [file] [log] [blame]
#!/bin/sh
# Copyright (C) Igor Sysoev
# Copyright (C) NGINX, Inc.
# Disable localized program messages.
LANG=C
export LANG
# Stop on error exit status.
set -e
# Stop on uninitialized variable.
set -u
# Initialize variables with null values if they are not defined.
CFLAGS=${CFLAGS=}
NXT_TEST_CFLAGS=${NXT_TEST_CFLAGS=}
NXT_TEST_LIBS=${NXT_TEST_LIBS=}
# Initialize variables with default if they are not defined.
CC=${CC:-cc}
NXT_CFLAGS=${NXT_CFLAGS=}
NXT_CC_OPT=${NXT_CC_OPT:--O}
NXT_LD_OPT=${NXT_CC_OPT:--O}
NXT_AUTO=${NXT_AUTO:-auto/}
NXT_AUTO_CONFIG_H=nxt_auto_config.h
NXT_MAKEFILE_CONF=Makefile.conf
NXT_BUILDDIR=${NXT_BUILDDIR:-build}
NXT_AUTOTEST=$NXT_BUILDDIR/autotest
NXT_AUTOCONF_ERR=$NXT_BUILDDIR/autoconf.err
test -d $NXT_BUILDDIR || mkdir $NXT_BUILDDIR
> $NXT_AUTOCONF_ERR
cat << END > $NXT_AUTO_CONFIG_H
/* This file is auto-generated by configure */
END
cat << END > $NXT_MAKEFILE_CONF
# This file is auto-generated by configure
END
. ${NXT_AUTO}os
. ${NXT_AUTO}clang
. ${NXT_AUTO}time
. ${NXT_AUTO}memalign
. ${NXT_AUTO}getrandom
. ${NXT_AUTO}pcre
cat << END >> $NXT_MAKEFILE_CONF
target: main
END