-
Notifications
You must be signed in to change notification settings - Fork 0
/
build
executable file
·51 lines (42 loc) · 1.21 KB
/
build
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
#!/bin/sh
# toplevel ELLCC distribution build script
# Get the staging directory.
prefix=`pwd`
# Figure out the compilers to use.
. ./build-setup $*
echo Building ecc with:
echo C compiler: $cc
echo C++ compiler: $cxx
echo In: llvm-build$builddir
# Configure for an LLVM+Clang build.
mkdir -p llvm-build$builddir
cd llvm-build$builddir
../llvm/configure CC="$cc" CXX="$cxx" --host=$host-$os --bindir=$bindir --prefix=$prefix \
--enable-optimized --enable-shared=no \
|| exit 1
# Build the LLVM tools.
make -j 6 || exit 1
cd ..
# Configure and install the GNU tools.
cd gnu
./build || exit 1
cd ..
# Now install the ELLCC tools.
make -j 6 -C llvm-build$builddir install || exit 1
if [ "$host" != "$build" ] ; then
# The host system is not the build system.
# No need to build the libraries again.
exit 0
fi
# Build libecc.
cd libecc
make clean
make || exit 1
cd ..
if [ $haslibs -eq 0 ] ; then
echo "Please run the build script again to bootstrap ecc."
echo "This may be done a few times:"
echo "1. ecc is built with gcc and host libraries."
echo "2. ecc is built with itself (compiled with gcc) and libecc."
echo "3. ecc is built with itself (compiled with itself) and libecc."
fi