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

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

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

env CC="${CC}" STRIP=${STRIP} CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" \
	./configure ${ConfigOpt} --prefix=/usr \
		--libdir=/usr/lib \
		--with-sysroot=${ToolChainSysRoot} \
		--with-randomdev=/dev/urandom \
		--without-libiconv-prefix \
		--without-libintl-prefix \
		--enable-static \
		--disable-nls \
		--disable-rpath

make ${MAKE_FLAGS}
