17
17
CXX=clang++
18
18
fi
19
19
20
+ if [ -z " $CC " ]
21
+ then
22
+ CC=clang
23
+ fi
24
+
20
25
if [ -z $MACOSX_DEPLOYMENT_TARGET ]
21
26
then
22
27
MACOSX_DEPLOYMENT_TARGET=10.6
@@ -45,16 +50,24 @@ case $TRIPLE in
45
50
-Wl,-unexported_symbols_list,libc++unexp.exp \
46
51
/usr/lib/libSystem.B.dylib"
47
52
else
48
- EXTRA_FLAGS=" -std=c++0x"
49
- LDSHARED_FLAGS=" -o libc++.1.dylib \
53
+ EXTRA_FLAGS=" -std=c++0x "
54
+ RE_EXPORT_FILE=" libc++abi.exp"
55
+ if [ -n " $SDKROOT " ]
56
+ then
57
+ EXTRA_FLAGS+=" -isysroot ${SDKROOT} "
58
+ RE_EXPORT_FILE=" libc++sjlj-abi.exp"
59
+ CXX=` xcrun -sdk " ${SDKROOT} " -find clang++`
60
+ CC=` xcrun -sdk " ${SDKROOT} " -find clang`
61
+ fi
62
+ LDSHARED_FLAGS=" -o libc++.1.dylib \
50
63
-dynamiclib -nodefaultlibs \
51
64
-current_version ${RC_ProjectSourceVersion} -compatibility_version 1 \
52
65
-install_name /usr/lib/libc++.1.dylib \
53
66
${SDKROOT} /usr/lib/libc++abi.dylib \
54
67
-lSystem \
55
68
-Wl,-unexported_symbols_list,libc++unexp.exp \
56
- -Wl,-reexported_symbols_list,libc++abi.exp \
57
- -Wl,-force_symbols_not_weak_list,notweak.exp"
69
+ -Wl,-reexported_symbols_list,${RE_EXPORT_FILE} \
70
+ -Wl,-force_symbols_not_weak_list,notweak.exp "
58
71
fi
59
72
;;
60
73
* )
@@ -78,7 +91,7 @@ for FILE in ../src/*.cpp; do
78
91
done
79
92
80
93
81
- cc * .o $RC_CFLAGS $LDSHARED_FLAGS
94
+ $CC * .o $RC_CFLAGS $LDSHARED_FLAGS $EXTRA_FLAGS
82
95
83
96
# libtool -static -o libc++.a *.o
84
97
0 commit comments