#!/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

source "$ScriptsDir/include/OpenSSL"

perl ./Configure \
	--prefix=/usr \
	--openssldir=/usr \
	--libdir=lib \
	--cross-compile-prefix="$ToolChainPrefix" \
	shared \
	no-ssl3-method \
	no-err \
	fips \
	$optflags \
	"$openssltarget" \
	"-Wa,--noexecstack $CFLAGS $LDFLAGS" \
	"-Wl,-rpath,\\\$\$ORIGIN"

make $MAKE_FLAGS
