llvm-project/libcxx/lib/buildit

62 lines
1.2 KiB
Plaintext
Raw Normal View History

#! /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 g++.
set -e
2010-05-12 03:42:16 +08:00
if [ `basename $(pwd)` != "lib" ]
then
echo "current directory must be lib"
exit 1
fi
if [ -z $CXX ]
2010-05-12 03:42:16 +08:00
then
CXX=g++
2010-05-12 03:42:16 +08:00
fi
case $TRIPLE in
*-apple-*)
if [ -z $RC_BUILDIT ]
then
RC_CFLAGS="-arch i386 -arch ppc -arch x86_64"
fi
SOEXT=dylib
LDSHARED_FLAGS="-o libc++.1.dylib \
-dynamiclib -nodefaultlibs -current_version 1 \
-compatibility_version 1 \
-install_name /usr/lib/libc++.dylib \
-Wl,-reexport_library,/usr/lib/libc++abi.dylib \
/usr/lib/libSystem.B.dylib"
;;
*)
RC_CFLAGS="-fPIC"
SOEXT=so
LDSHARED_FLAGS="-o libc++.so.1.0 \
-shared -nodefaultlibs -Wl,-soname,libc++.so.1 \
-lstdc++ -lc"
;;
esac
2010-05-12 03:42:16 +08:00
if [ -z $RC_BUILDIT ]
then
rm -f libc++.1.$SOEXT*
2010-05-12 03:42:16 +08:00
fi
set -x
for FILE in ../src/*.cpp; do
$CXX -c -g -Os $RC_CFLAGS -nostdinc++ -I../include $FILE
2010-05-12 03:42:16 +08:00
done
$CXX *.o $RC_CFLAGS $LDSHARED_FLAGS
2010-05-12 03:42:16 +08:00
#libtool -static -o libc++.a *.o
if [ -z $RC_BUILDIT ]
then
rm *.o
fi