etc/services - sync with NetBSD-8
[minix.git] / minix / llvm / generate_gold_plugin.sh
bloba022e160bf5f4e4f02a584d6a6de9b975bb5065b
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}
12 : ${MAKE=make}
14 echo ${NETBSDSRCDIR}
15 echo ${LLVMSRCDIR}
16 echo ${OBJ_LLVM}
17 echo ${OBJ}
18 echo ${CROSS_TOOLS}
20 # Retrieve all the GPL sources
21 cd ${NETBSDSRCDIR}
22 find . -name fetch.sh -exec '{}' \;
24 # Build LLVM manually
25 mkdir -p ${OBJ_LLVM}
26 cd ${OBJ_LLVM}
28 ${LLVMSRCDIR}/llvm/configure \
29 --enable-targets=x86 \
30 --with-c-include-dirs=/usr/include/clang-3.6:/usr/include \
31 --disable-timestamps \
32 --prefix=/usr \
33 --sysconfdir=/etc/llvm \
34 --with-clang-srcdir=${LLVMSRCDIR}/clang \
35 --host=i586-elf32-minix \
36 --with-binutils-include=${NETBSDSRCDIR}/external/gpl3/binutils/dist/include \
37 --disable-debug-symbols \
38 --enable-assertions \
39 --enable-bindings=none \
40 llvm_cv_gnu_make_command=${MAKE} \
41 ac_cv_path_CIRCO="echo circo" \
42 ac_cv_path_DOT="echo dot" \
43 ac_cv_path_DOTTY="echo dotty" \
44 ac_cv_path_FDP="echo fdp" \
45 ac_cv_path_NEATO="echo neato" \
46 ac_cv_path_TWOPI="echo twopi" \
47 ac_cv_path_XDOT="echo xdot" \
48 --enable-optimized
50 ${MAKE} -j ${JOBS}
52 # Copy the gold plugin where the NetBSD build system expects it.
53 mkdir -p ${NETBSDSRCDIR}/minix/llvm/bin/
54 cp ${OBJ_LLVM}/./Release+Asserts/lib/libLTO.so ${NETBSDSRCDIR}/minix/llvm/bin/
55 cp ${OBJ_LLVM}/./Release+Asserts/lib/LLVMgold.so ${NETBSDSRCDIR}/minix/llvm/bin/
57 # Copy useful LLVM tools
58 mkdir -p ${CROSS_TOOLS}
59 cp ${OBJ_LLVM}/./Release+Asserts/bin/llc ${CROSS_TOOLS}
60 cp ${OBJ_LLVM}/./Release+Asserts/bin/opt ${CROSS_TOOLS}
61 cp ${OBJ_LLVM}/./Release+Asserts/bin/llvm-* ${CROSS_TOOLS}
63 # Generate and Install default MINIX passes
64 cd ${NETBSDSRCDIR}/minix/llvm/passes/WeakAliasModuleOverride
65 ${MAKE} install
67 cd ${NETBSDSRCDIR}/minix/llvm/passes/hello
68 ${MAKE} install
70 cd ${NETBSDSRCDIR}/minix/llvm/passes/sectionify
71 ${MAKE} install
73 cd ${NETBSDSRCDIR}/minix/llvm/passes/magic
74 ${MAKE} install
76 cd ${NETBSDSRCDIR}/minix/llvm/passes/asr
77 ${MAKE} install