This rebase skips the following patches in upstream: +37025e1b32Make the helper routines in string really be constexpr. This required a bit of refacoring in algorithm as well. Give them better names while we're at it. All of these are internal rotines; no visible functionality change. +164b297099Implement string_view from the library fundamentals TS (n4023). Also works in C++11 and 03, with reduced functionality (mostly in the area of constexpr) +e4694b4129Formatting improvements in the <string_view> synopsis suggested by RSmith. No functionality change. +3a61b30f3aMinor cleanup for string_view; mostly from suggestions by Richard Smith. Also, make the tests pass under c++03 +484728789estring_view enhancements. Move to the correct namespace. Better constexpr support (thanks to Richard for the suggestions). Update the tests to match this. Add <experimental/__config for experimental macros/etc to live. +b1a40264dc[libcxx] Add <experimental/utility> header for LFTS. +3ee7233c80[libcxx] expose experimental::erased_type for all standard versions. +67740670f9NFC. Remove trailing whitespace and tabs. +b9536101dcNFC. Move definition of _LIBCPP_ASSERT into __debug header and remove external include guards. +98c4e404ca. Revert "Turn off extern templates for most uses." Bug: 17255369 Change-Id: I629ff16275d50e4cc8767b253a2c0542468348d8
180 lines
4.9 KiB
Bash
Executable File
180 lines
4.9 KiB
Bash
Executable File
#! /bin/sh
|
|
#
|
|
# Set the $TRIPLE environment variable to your system's triple before
|
|
# running this script. If you set $CXX, that will be used to compile
|
|
# the library. Otherwise we'll use clang++.
|
|
|
|
set -e
|
|
|
|
if [ `basename $(pwd)` != "lib" ]
|
|
then
|
|
echo "current directory must be lib"
|
|
exit 1
|
|
fi
|
|
|
|
if [ -z "$CXX" ]
|
|
then
|
|
CXX=clang++
|
|
fi
|
|
|
|
if [ -z "$CXX_LANG" ]
|
|
then
|
|
CXX_LANG=c++11
|
|
fi
|
|
|
|
if [ -z "$CC" ]
|
|
then
|
|
CC=clang
|
|
fi
|
|
|
|
if [ -z "$MACOSX_DEPLOYMENT_TARGET" ]
|
|
then
|
|
if [ -z "$IPHONEOS_DEPLOYMENT_TARGET" ]
|
|
then
|
|
MACOSX_DEPLOYMENT_TARGET=10.7
|
|
fi
|
|
fi
|
|
|
|
if [ -z "$RC_ProjectSourceVersion" ]
|
|
then
|
|
RC_ProjectSourceVersion=1
|
|
fi
|
|
|
|
EXTRA_FLAGS="-nostdinc++ -std=${CXX_LANG} -fstrict-aliasing -Wall -Wextra -Wshadow -Wconversion \
|
|
-Wpadded -Wstrict-aliasing=2 -Wstrict-overflow=4 "
|
|
|
|
case $TRIPLE in
|
|
*-apple-*)
|
|
if [ -z $RC_XBS ]
|
|
then
|
|
RC_CFLAGS="-arch i386 -arch x86_64"
|
|
fi
|
|
SOEXT=dylib
|
|
if [ "$MACOSX_DEPLOYMENT_TARGET" = "10.6" ]
|
|
then
|
|
EXTRA_FLAGS="-nostdinc++ -std=c++11 -U__STRICT_ANSI__"
|
|
LDSHARED_FLAGS="-o libc++.1.dylib \
|
|
-dynamiclib -nodefaultlibs -current_version 1 \
|
|
-compatibility_version 1 \
|
|
-install_name /usr/lib/libc++.1.dylib \
|
|
-Wl,-reexport_library,/usr/lib/libc++abi.dylib \
|
|
-Wl,-unexported_symbols_list,libc++unexp.exp \
|
|
/usr/lib/libSystem.B.dylib"
|
|
else
|
|
if [ -n "$SDKROOT" ]
|
|
then
|
|
EXTRA_FLAGS+="-isysroot ${SDKROOT} "
|
|
if echo "${RC_ARCHS}" | grep -q "armv7"
|
|
then
|
|
RE_EXPORT_LINE="${SDKROOT}/usr/lib/libc++abi.dylib -Wl,-reexported_symbols_list,libc++sjlj-abi.exp"
|
|
else
|
|
RE_EXPORT_LINE="-Wl,-reexport_library,${SDKROOT}/usr/lib/libc++abi.dylib"
|
|
fi
|
|
CXX=`xcrun -sdk "${SDKROOT}" -find clang++`
|
|
CC=`xcrun -sdk "${SDKROOT}" -find clang`
|
|
else
|
|
# Check if we have _LIBCPPABI_VERSION, to determine the reexport list to use.
|
|
if (echo "#include <cxxabi.h>" | $CXX -E -dM -x c++ - | \
|
|
grep _LIBCPPABI_VERSION > /dev/null)
|
|
then
|
|
RE_EXPORT_LINE="/usr/lib/libc++abi.dylib -Wl,-reexported_symbols_list,libc++abi2.exp"
|
|
else
|
|
RE_EXPORT_LINE="/usr/lib/libc++abi.dylib -Wl,-reexported_symbols_list,libc++abi.exp"
|
|
fi
|
|
fi
|
|
LDSHARED_FLAGS="-o libc++.1.dylib \
|
|
-dynamiclib -nodefaultlibs \
|
|
-current_version ${RC_ProjectSourceVersion} \
|
|
-compatibility_version 1 \
|
|
-install_name /usr/lib/libc++.1.dylib \
|
|
-lSystem \
|
|
-Wl,-unexported_symbols_list,libc++unexp.exp \
|
|
${RE_EXPORT_LINE} \
|
|
-Wl,-force_symbols_not_weak_list,notweak.exp \
|
|
-Wl,-force_symbols_weak_list,weak.exp"
|
|
fi
|
|
;;
|
|
*-*-mingw*)
|
|
# FIXME: removing libgcc and libsupc++ dependencies means porting libcxxrt and LLVM/compiler-rt
|
|
SOEXT=dll
|
|
LDSHARED_FLAGS="-o libc++.dll \
|
|
-shared -nodefaultlibs -Wl,--export-all-symbols -Wl,--allow-multiple-definition -Wl,--out-implib,libc++.dll.a \
|
|
-lsupc++ -lpthread -lmingw32 -lgcc_s -lgcc -lmoldname -lmingwex -lmsvcr100 -ladvapi32 -lshell32 -luser32 -lkernel32 -lmingw32 -lgcc_s -lgcc -lmoldname -lmingwex -lmsvcrt"
|
|
;;
|
|
*-ibm-*)
|
|
hostOS=`uname`
|
|
hostOS=`echo $hostOS | sed -e "s/\s+$//"`
|
|
hostOS=`echo $hostOS | tr '[A-Z]' '[a-z]'`
|
|
|
|
if [ $hostOS = "linux" ]
|
|
then
|
|
LDSHARED_FLAGS="-o libc++.so.1 \
|
|
-qmkshrobj -Wl,-soname,libc++.so.1 \
|
|
-lpthread -lrt -lc -lstdc++"
|
|
EXTRA_FLAGS="-qlanglvl=extended0x -D__GLIBCXX__=1"
|
|
else
|
|
LDSHARED_FLAGS="-o shr.o -qmkshrobj -lpthread -bnoquiet"
|
|
EXTRA_FLAGS="-qlanglvl=extended0x"
|
|
fi
|
|
RC_CFLAGS="-qpic=large"
|
|
;;
|
|
*)
|
|
RC_CFLAGS="-fPIC"
|
|
SOEXT=so
|
|
LDSHARED_FLAGS="-o libc++.so.1.0 \
|
|
-shared -nodefaultlibs -Wl,-soname,libc++.so.1 \
|
|
-lpthread -lrt -lc -lstdc++"
|
|
;;
|
|
esac
|
|
|
|
if [ -z "$RC_XBS" ]
|
|
then
|
|
rm -f libc++.1.$SOEXT*
|
|
fi
|
|
|
|
set -x
|
|
|
|
for FILE in ../src/*.cpp; do
|
|
$CXX -c -g -Os $RC_CFLAGS $EXTRA_FLAGS -I../include $FILE
|
|
done
|
|
case $TRIPLE in
|
|
*-*-mingw*)
|
|
for FILE in ../src/support/win32/*.cpp; do
|
|
$CXX -c -g -Os $RC_CFLAGS $EXTRA_FLAGS -I../include $FILE
|
|
done
|
|
;;
|
|
esac
|
|
$CC *.o $RC_CFLAGS $LDSHARED_FLAGS $EXTRA_FLAGS
|
|
|
|
#libtool -static -o libc++.a *.o
|
|
|
|
# Create the link for the final library name, so that we can use this directory
|
|
# as a link target for the tests.
|
|
case $TRIPLE in
|
|
*-apple-*)
|
|
rm -f libc++.dylib
|
|
ln -s libc++.1.dylib libc++.dylib
|
|
;;
|
|
*-*-mingw*)
|
|
;;
|
|
*-ibm-*)
|
|
if [ $hostOS = "linux" ]
|
|
then
|
|
rm -f libc++.so
|
|
ln -s libc++.so.1 libc++.so
|
|
else #AIX
|
|
rm -f libc++.a
|
|
ar r libc++.a shr.o
|
|
fi
|
|
;;
|
|
*)
|
|
rm -f libc++.so
|
|
ln -s libc++.so.1 libc++.so
|
|
;;
|
|
esac
|
|
|
|
if [ -z "$RC_XBS" ]
|
|
then
|
|
rm *.o
|
|
fi
|