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

if ! checkPlatformFunction SYNO_FEA_ROUTER_COMMON; then
	SkipThisProject
	return
fi

case "$PLATFORM_FAMILY" in
	SYNOPLAT_F_PPC|SYNOPLAT_F_ARMV5)
		return
		;;
	*)
		;;
esac

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

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

env	CC=${CC} LD=${LD} AR=${AR} STRIP=${STRIP} RANLIB=${RANLIB} NM=${NM} \
	CFLAGS="${CFLAGS}" CPPFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" \
	KernelDir="$KSRC" \
	./configure ${ConfigOpt} \
		--sbindir="/usr/bin" \
		--libdir="/usr/lib" \
		--with-ksource="$KSRC" \
		--with-kbuild="$KSRC"

make ${MAKE_FLAGS}
