#!/bin/bash
# Copyright (c) 2000-2018 Synology Inc. All rights reserved.

case ${MakeClean} in
	[Yy][Ee][Ss])
		make distclean
		;;
esac

case ${CleanOnly} in
	[Yy][Ee][Ss])
		return
		;;
esac

CFLAGS="${CFLAGS} -DSYNO"
GSSAPI_PATH="no"

if [ "${PLATFORM_FAMILY}" == "SYNOPLAT_F_X86_64" ]; then
    GSSAPI_PATH="/usr/local/x86_64-pc-linux-gnu/x86_64-pc-linux-gnu/sys-root/usr"
fi

# enable epoll for preventing core dump in nslookup/nsupdate.
env CC="${CC}" CFLAGS="${CFLAGS}" BUILD_CC=gcc \
	LDFLAGS="-L${SysRootLib} -L${ToolChainLib} ${LDFLAGS} -Wl,--as-needed" \
	./configure ${ConfigOpt} \
	--prefix=/ \
	--enable-largefile \
	--disable-static \
	--enable-epoll \
	--with-libtool \
	--without-python \
	--with-gssapi=${GSSAPI_PATH} \
	--with-dlopen=yes \
	--with-maxminddb=no \
	--disable-geoip \
	--with-json-c=no


make ${MAKE_FLAGS}

