tools/llvm: Do not build with symbols
[minix3.git] / minix / llvm / generate_gold_plugin.sh
blobe1b4718677f1c0affce2e4632645343ea2081dd4
1 #!/bin/sh
3 cd $(dirname $0)
5 : ${NETBSDSRCDIR=${PWD}/../..}
6 : ${LLVMSRCDIR=${NETBSDSRCDIR}/external/bsd/llvm/dist}
7 : ${ARCH=i386}
8 : ${JOBS=1}
9 : ${OBJ_LLVM=${NETBSDSRCDIR}/../obj_llvm.${ARCH}}
10 : ${OBJ=${NETBSDSRCDIR}/../obj.${ARCH}}
11 : ${CROSS_TOOLS=${OBJ}/"tooldir.`uname -s`-`uname -r`-`uname -m`"/bin}
13 echo ${NETBSDSRCDIR}
14 echo ${LLVMSRCDIR}
15 echo ${OBJ_LLVM}
16 echo ${OBJ}
17 echo ${CROSS_TOOLS}
19 # Retrieve all the GPL sources
20 cd ${NETBSDSRCDIR}
21 find . -name fetch.sh -exec '{}' \;
23 # Build LLVM manually
24 mkdir -p ${OBJ_LLVM}
25 cd ${OBJ_LLVM}
27 ${LLVMSRCDIR}/llvm/configure \
28 --enable-targets=x86 \
29 --with-c-include-dirs=/usr/include/clang-3.4:/usr/include \
30 --disable-timestamps \
31 --prefix=/usr \
32 --sysconfdir=/etc/llvm \
33 --with-clang-srcdir=${LLVMSRCDIR}/clang \
34 --host=i586-elf32-minix \
35 --with-binutils-include=${NETBSDSRCDIR}/external/gpl3/binutils/dist/include \
36 --disable-debug-symbols \
37 --enable-assertions \
38 --enable-bindings=none \
39 llvm_cv_gnu_make_command=make \
40 ac_cv_path_CIRCO="echo circo" \
41 ac_cv_path_DOT="echo dot" \
42 ac_cv_path_DOTTY="echo dotty" \
43 ac_cv_path_FDP="echo fdp" \
44 ac_cv_path_NEATO="echo neato" \
45 ac_cv_path_TWOPI="echo twopi" \
46 ac_cv_path_XDOT="echo xdot" \
47 --enable-optimized
49 make -j ${JOBS}
51 # Copy the gold plugin where the NetBSD build system expects it.
52 mkdir -p ${NETBSDSRCDIR}/minix/llvm/bin/
53 cp ${OBJ_LLVM}/./Release+Asserts/lib/libLTO.so ${NETBSDSRCDIR}/minix/llvm/bin/
54 cp ${OBJ_LLVM}/./Release+Asserts/lib/LLVMgold.so ${NETBSDSRCDIR}/minix/llvm/bin/
56 # Copy useful LLVM tools
57 mkdir -p ${CROSS_TOOLS}
58 cp ${OBJ_LLVM}/./Release+Asserts/bin/llc ${CROSS_TOOLS}
59 cp ${OBJ_LLVM}/./Release+Asserts/bin/opt ${CROSS_TOOLS}
60 cp ${OBJ_LLVM}/./Release+Asserts/bin/llvm-* ${CROSS_TOOLS}
62 # Generate and Install default MINIX passes
63 cd ${NETBSDSRCDIR}/minix/llvm/passes/WeakAliasModuleOverride
64 make install
66 cd ${NETBSDSRCDIR}/minix/llvm/passes/hello
67 make install