diff options
author | Howard Hinnant <hhinnant@apple.com> | 2010-05-24 17:49:41 +0000 |
---|---|---|
committer | Howard Hinnant <hhinnant@apple.com> | 2010-05-24 17:49:41 +0000 |
commit | 128ba7191da78d948b72b9c7adddc37002b391ef (patch) | |
tree | 777573e0e91f4127e3b389583832de434bff15fc /libcxx/lib | |
parent | 8a57aeca2abfbdd7659af285c10af9e82ba7783d (diff) | |
download | bcm5719-llvm-128ba7191da78d948b72b9c7adddc37002b391ef.tar.gz bcm5719-llvm-128ba7191da78d948b72b9c7adddc37002b391ef.zip |
patch by Jeffrey Yasskin for porting to Ubuntu Hardy. Everything was accepted except there were some bug fixes needed in <locale> for the __nolocale_* series. For the apple branch I ended up using templates instead of the var_args solution because it seemed both safer and more efficient.
llvm-svn: 104516
Diffstat (limited to 'libcxx/lib')
-rwxr-xr-x | libcxx/lib/buildit | 53 |
1 files changed, 36 insertions, 17 deletions
diff --git a/libcxx/lib/buildit b/libcxx/lib/buildit index 6cbe971ad7c..43341f97029 100755 --- a/libcxx/lib/buildit +++ b/libcxx/lib/buildit @@ -1,41 +1,60 @@ +#! /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 + if [ `basename $(pwd)` != "lib" ] then echo "current directory must be lib" exit 1 fi -if [ -z $CC ] +if [ -z $CXX ] then - CC=g++ + CXX=g++ fi -if [ -z $RC_BUILDIT ] -then - RC_CFLAGS="-arch i386 -arch ppc -arch x86_64" -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 if [ -z $RC_BUILDIT ] then - rm libc++.1.dylib + rm -f libc++.1.$SOEXT* fi set -x -for FILE in $(ls ../src/*.cpp); do - $CC -c -g -Os $RC_CFLAGS -nostdinc++ -I../include $FILE +for FILE in ../src/*.cpp; do + $CXX -c -g -Os $RC_CFLAGS -nostdinc++ -I../include $FILE done -$CC -dynamiclib -nodefaultlibs $RC_CFLAGS -current_version 1 \ - -compatibility_version 1 \ - -o libc++.1.dylib *.o \ - -install_name /usr/lib/libc++.dylib \ - -Wl,-reexport_library,/usr/lib/libc++abi.dylib \ - /usr/lib/libSystem.B.dylib +$CXX *.o $RC_CFLAGS $LDSHARED_FLAGS #libtool -static -o libc++.a *.o -set +x - if [ -z $RC_BUILDIT ] then rm *.o |