Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 1 | if [ `basename $(pwd)` != "lib" ] |
| 2 | then |
| 3 | echo "current directory must be lib" |
| 4 | exit 1 |
| 5 | fi |
| 6 | |
| 7 | if [ -z $CC ] |
| 8 | then |
| 9 | CC=g++ |
| 10 | fi |
| 11 | |
| 12 | if [ -z $RC_BUILDIT ] |
| 13 | then |
| 14 | RC_CFLAGS="-arch i386 -arch ppc -arch x86_64" |
| 15 | fi |
| 16 | |
| 17 | if [ -z $RC_BUILDIT ] |
| 18 | then |
| 19 | rm libc++.1.dylib |
| 20 | fi |
| 21 | |
| 22 | set -x |
| 23 | |
| 24 | for FILE in $(ls ../src/*.cpp); do |
| 25 | $CC -c -g -Os $RC_CFLAGS -nostdinc++ -I../include $FILE |
| 26 | done |
| 27 | |
| 28 | $CC -dynamiclib -nodefaultlibs $RC_CFLAGS -current_version 1 \ |
| 29 | -compatibility_version 1 \ |
| 30 | -o libc++.1.dylib *.o \ |
| 31 | -install_name /usr/lib/libc++.dylib \ |
| 32 | -Wl,-reexport_library,/usr/lib/libc++abi.dylib \ |
| 33 | /usr/lib/libSystem.B.dylib |
| 34 | |
| 35 | #libtool -static -o libc++.a *.o |
| 36 | |
| 37 | set +x |
| 38 | |
| 39 | if [ -z $RC_BUILDIT ] |
| 40 | then |
| 41 | rm *.o |
| 42 | fi |