123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- #!/usr/bin/env bash
- set -x
- srcdir=`dirname $0`
- [ -z "$srcdir" ] && srcdir=.
- ORIGDIR=`pwd`
- cd $srcdir
- if [ "$1" = "DEBUG" ]
- then
- COMMON_FLAGS="-ggdb -Og"
- else
- COMMON_FLAGS="-g -O2 -D_FORTIFY_SOURCE=2"
- fi
- COMMON_FLAGS="$COMMON_FLAGS -DNO_HEAP_CHECK -DTCMALLOC_SGX -DTCMALLOC_NO_ALIASES $2"
- ENCLAVE_CFLAGS="$COMMON_FLAGS -ffreestanding -nostdinc -fvisibility=hidden -fPIC"
- ENCLAVE_CXXFLAGS="$ENCLAVE_CFLAGS -nostdinc++ -std=c++11"
- CFLAGS="$CFLAGS $ENCLAVE_CFLAGS"
- CXXFLAGS="$CXXFLAGS $ENCLAVE_CXXFLAGS"
- CPPFLAGS="-I../../../common/inc -I../../../common/inc/tlibc -I../../../common/inc/internal/ -I../../../sdk/tlibcxx/include -I../../../sdk/trts/"
- if echo $CFLAGS | grep -q -- '-m32'; then
- HOST_OPT='--host=i386-linux-gnu'
- fi
- export CFLAGS
- export CXXFLAGS
- export CPPFLAGS
- $srcdir/configure $HOST_OPT --enable-shared=no \
- --disable-cpu-profiler \
- --disable-heap-profiler \
- --disable-heap-checker \
- --disable-debugalloc \
- --enable-minimal
- if [ "$1" = "DEBUG" ]
- then
- sed -i 's/#define HAVE___ATTRIBUTE__ 1/\/\/#define HAVE___ATTRIBUTE__ 1/g' src/config.h
- fi
|