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

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

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

gnupgconfig="--disable-gpgsm \
	--disable-scdaemon \
	--disable-doc \
	--disable-bzip2 \
	--disable-exec \
	--disable-photo-viewers \
	--disable-ldap \
	--disable-ccid-driver \
	--disable-rpath \
	--disable-nls \
	"

env	CC=${CC} LD=${LD} AR=${AR} STRIP=${STRIP} RANLIB=${RANLIB} NM=${NM} \
	CFLAGS="${CFLAGS}" CPPFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" \
	./configure ${ConfigOpt} \
		--prefix=/usr \
		--sysconfdir=/etc \
		--sbindir=/usr/bin \
		--libexecdir=/usr/lib/gnupg \
		${gnupgconfig} \
		--without-libiconv-prefix \
		--with-libgpg-error-prefix=$ToolChainSysRoot/usr \
		--with-libgcrypt-prefix=$ToolChainSysRoot/usr \
		--with-libassuan-prefix=$ToolChainSysRoot/usr \
		--with-ksba-prefix=$ToolChainSysRoot/usr \
		--with-npth-prefix=$ToolChainSysRoot/usr

make ${MAKE_FLAGS}
