summaryrefslogtreecommitdiffstats
path: root/libcxx/lib/buildit
blob: 19d195988a2c2a362c45968df3a2e3253d656b83 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#! /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 "$CXX" ]
then
	CXX=g++
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 -f libc++.1.$SOEXT*
fi

set -x

for FILE in ../src/*.cpp; do
	$CXX -c -g -Os $RC_CFLAGS -nostdinc++ -I../include $FILE
done

$CXX *.o $RC_CFLAGS $LDSHARED_FLAGS

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

if [ -z $RC_BUILDIT ]
then
    rm *.o
fi
OpenPOWER on IntegriCloud