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

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

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

env CC="${CC}" CXX="${CXX}" LD="${LD}" AR=${AR} STRIP=${STRIP_ORI} RANLIB=${RANLIB} NM=${NM} \
	CFLAGS="${CFLAGS}" CPPFLAGS="${CFLAGS} -DSYNO_LFTP" CXXFLAGS="${CFLAGS}" \
	LDFLAGS="${LDFLAGS}" \
	./configure ${ConfigOpt} \
	--prefix=/usr \
	--sysconfdir=/etc \
	--disable-nls \
	--without-libiconv-prefix \
	--without-libintl-prefix \
	--without-included-regex \
	--disable-static \
	--with-openssl \
	--with-expat="${SysRootPrefix}" \
	--with-readline="${SysRootPrefix}" \
	--with-zlib="${SysRootPrefix}"

make ${MAKE_FLAGS}
