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

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

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

if checkPlatformFunction SYNO_PLAT_6281_CONFIGURE; then
		cp configure.mv6281 configure
else
		cp configure.mv_all configure
fi

# workaround for enabling `config.cache'
ConfigOpt=${ConfigOpt//-C/}

cp libgphoto2_port/configure.mv_all libgphoto2_port/configure

env CC="${CC}" CXX="${CXX}" LD="${LD}" AR=${AR} STRIP=${STRIP} RANLIB=${RANLIB} NM=${NM} \
	CFLAGS="${CFLAGS}" \
	./configure ${ConfigOpt} --disable-werror \
	--prefix=/usr --disable-cache \
	--without-libexif

make ${MAKE_FLAGS}
