3
# Set the $TRIPLE environment variable to your system's triple before
4
# running this script. If you set $CXX, that will be used to compile
5
# the library. Otherwise we'll use clang++.
9
if [ `basename $(pwd)` != "lib" ]
11
echo "current directory must be lib"
25
if [ -z $RC_ProjectSourceVersion ]
27
RC_ProjectSourceVersion=1
30
EXTRA_FLAGS="-std=c++0x -stdlib=libc++ -fstrict-aliasing -Wstrict-aliasing=2 \
31
-Wsign-conversion -Wshadow -Wconversion -Wunused-variable \
32
-Wmissing-field-initializers -Wchar-subscripts -Wmismatched-tags \
33
-Wmissing-braces -Wshorten-64-to-32 -Wsign-compare \
34
-Wstrict-aliasing=2 -Wstrict-overflow=4 -Wunused-parameter \
41
RC_CFLAGS="-arch i386 -arch x86_64"
46
EXTRA_FLAGS+="-isysroot ${SDKROOT}"
47
CXX=`xcrun -sdk "${SDKROOT}" -find clang++`
48
CC=`xcrun -sdk "${SDKROOT}" -find clang`
50
LDSHARED_FLAGS="-o libc++abi.dylib \
51
-dynamiclib -nodefaultlibs \
52
-current_version ${RC_ProjectSourceVersion} \
53
-compatibility_version 1 \
54
-install_name /usr/lib/libc++abi.dylib \
56
if [ -f "${SDKROOT}/usr/local/lib/libCrashReporterClient.a" ]
58
LDSHARED_FLAGS+=" -lCrashReporterClient"
62
# FIXME: removing libgcc and libsupc++ dependencies means porting libcxxrt and LLVM/compiler-rt
64
LDSHARED_FLAGS="-o libc++abi.dll \
65
-shared -nodefaultlibs -Wl,--export-all-symbols -Wl,--allow-multiple-definition -Wl,--out-implib,libc++abi.dll.a \
66
-lsupc++ -lpthread -lmingw32 -lgcc_s -lgcc -lmoldname -lmingwex -lmsvcr100 -ladvapi32 -lshell32 -luser32 -lkernel32 -lmingw32 -lgcc_s -lgcc -lmoldname -lmingwex -lmsvcrt"
71
LDSHARED_FLAGS="-o libc++abi.so.1.0 \
72
-shared -nodefaultlibs -Wl,-soname,libc++abi.so.1 \
73
-lpthread -lrt -lc -lstdc++"
79
rm -f libc++abi.1.$SOEXT*
84
for FILE in ../src/*.cpp; do
85
$CXX -c -g -O3 $RC_CFLAGS $EXTRA_FLAGS -I../include $FILE
89
for FILE in ../src/support/win32/*.cpp; do
90
$CXX -c -g -Os $RC_CFLAGS $EXTRA_FLAGS -I../include $FILE
94
$CC *.o $RC_CFLAGS $LDSHARED_FLAGS $EXTRA_FLAGS