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

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

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

# workaround for enabling `config.cache'
ConfigOpt=${ConfigOpt//-C/}
ConfigOpt="$ConfigOpt --prefix=/usr"
Configure="./configure ${ConfigOpt}"

env CC="${CC} -fPIC" LD="${LD}" AR=${AR} STRIP=${STRIP} RANLIB=${RANLIB} NM=${NM} \
	CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" $Configure

make ${MAKE_FLAGS}
