Skip to content

Commit de214e2

Browse files
author
Nick Kledzik
committed
<rdar://problem/9014045> more support for Apple internal build environments
llvm-svn: 130872
1 parent 0de8d45 commit de214e2

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed

libcxx/lib/buildit

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ then
1717
CXX=clang++
1818
fi
1919

20+
if [ -z "$CC" ]
21+
then
22+
CC=clang
23+
fi
24+
2025
if [ -z $MACOSX_DEPLOYMENT_TARGET ]
2126
then
2227
MACOSX_DEPLOYMENT_TARGET=10.6
@@ -45,16 +50,24 @@ case $TRIPLE in
4550
-Wl,-unexported_symbols_list,libc++unexp.exp \
4651
/usr/lib/libSystem.B.dylib"
4752
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 \
5063
-dynamiclib -nodefaultlibs \
5164
-current_version ${RC_ProjectSourceVersion} -compatibility_version 1 \
5265
-install_name /usr/lib/libc++.1.dylib \
5366
${SDKROOT}/usr/lib/libc++abi.dylib \
5467
-lSystem \
5568
-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 "
5871
fi
5972
;;
6073
*)
@@ -78,7 +91,7 @@ for FILE in ../src/*.cpp; do
7891
done
7992

8093

81-
cc *.o $RC_CFLAGS $LDSHARED_FLAGS
94+
$CC *.o $RC_CFLAGS $LDSHARED_FLAGS $EXTRA_FLAGS
8295

8396
#libtool -static -o libc++.a *.o
8497

0 commit comments

Comments
 (0)