| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 | #!/usr/bin/env bashif [ "$1" == "SGX" ]; then	if [ "$SGX" != "0" ]; then	    export SGX=1	    # Sometimes, we end up with a stray SGX_RUN in the environment,	    # which makes the Makefile.Host unhappy	    unset SGX_RUN	    # The interaction of SGX and SGX_RUN is getting pretty unwieldly.	    # We should kill off SGX_RUN.  Here, we can get in trouble	    # if the make invocation below gets SGX_RUN via an MAKEFLAGS	    # from a wrapper makefile (e.g., the regression tests)	    unset MAKEFLAGS	fi	shiftfiRUNTIME_DIR=$(/usr/bin/dirname $(readlink -f ${BASH_SOURCE[0]}))PAL_HOST=$(/usr/bin/make --no-print-directory --quiet -f $RUNTIME_DIR/../Pal/src/Makefile.Host print_host 2>&1)MANIFEST=PREFIX=PAL_CMD=$RUNTIME_DIR/pal-$PAL_HOSTif [ "$GDB" == "1" ]; then	GDB=$RUNTIME_DIR/pal_gdb-$PAL_HOST	if [ ! -f $GDB ]; then		GDB="/usr/bin/gdb"	fifiif [ "$GDB" != "" ] && [ "$GDB" != "0" ]; then	PREFIX="$GDB --args"fiif [ "$PERF" == "1" ]; then	PREFIX="perf stat"fiif [ "$MEMUSG" == "1" ]; then	PREFIX="$RUNTIME_DIR/../Scripts/memusg"fiif [ "$SEC" == "1" ]; then	echo "Use reference monitor"	PAL_CMD=$RUNTIME_DIR/pal_sec-$PAL_HOSTfiwhile [ "$1" != "" ];do	if [ "$MANIFEST" == "" ]; then		MANIFEST=$1		shift		continue	fi	breakdoneif [ ! -f "$PAL_CMD" ]; then	echo "$PAL_CMD is not built, or security mode is not supported"	exit 1fiexec $PREFIX $PAL_CMD $MANIFEST "$@"
 |