15ba302fdSKoustubha Bhat#!/bin/sh 25ba302fdSKoustubha Bhat 35ba302fdSKoustubha Bhatcd $(dirname $0) 45ba302fdSKoustubha Bhat 55ba302fdSKoustubha Bhat: ${NETBSDSRCDIR=${PWD}/../..} 65ba302fdSKoustubha Bhat: ${LLVMSRCDIR=${NETBSDSRCDIR}/external/bsd/llvm/dist} 75ba302fdSKoustubha Bhat: ${ARCH=i386} 85ba302fdSKoustubha Bhat: ${JOBS=1} 95ba302fdSKoustubha Bhat: ${OBJ_LLVM=${NETBSDSRCDIR}/../obj_llvm.${ARCH}} 105ba302fdSKoustubha Bhat: ${OBJ=${NETBSDSRCDIR}/../obj.${ARCH}} 115ba302fdSKoustubha Bhat: ${CROSS_TOOLS=${OBJ}/"tooldir.`uname -s`-`uname -r`-`uname -m`"/bin} 12*eba14763SDavid van Moolenbroek: ${MAKE=make} 135ba302fdSKoustubha Bhat 145ba302fdSKoustubha Bhatecho ${NETBSDSRCDIR} 155ba302fdSKoustubha Bhatecho ${LLVMSRCDIR} 165ba302fdSKoustubha Bhatecho ${OBJ_LLVM} 175ba302fdSKoustubha Bhatecho ${OBJ} 185ba302fdSKoustubha Bhatecho ${CROSS_TOOLS} 195ba302fdSKoustubha Bhat 205ba302fdSKoustubha Bhat# Retrieve all the GPL sources 215ba302fdSKoustubha Bhatcd ${NETBSDSRCDIR} 225ba302fdSKoustubha Bhatfind . -name fetch.sh -exec '{}' \; 235ba302fdSKoustubha Bhat 245ba302fdSKoustubha Bhat# Build LLVM manually 255ba302fdSKoustubha Bhatmkdir -p ${OBJ_LLVM} 265ba302fdSKoustubha Bhatcd ${OBJ_LLVM} 275ba302fdSKoustubha Bhat 285ba302fdSKoustubha Bhat${LLVMSRCDIR}/llvm/configure \ 295ba302fdSKoustubha Bhat --enable-targets=x86 \ 300a6a1f1dSLionel Sambuc --with-c-include-dirs=/usr/include/clang-3.6:/usr/include \ 315ba302fdSKoustubha Bhat --disable-timestamps \ 325ba302fdSKoustubha Bhat --prefix=/usr \ 335ba302fdSKoustubha Bhat --sysconfdir=/etc/llvm \ 345ba302fdSKoustubha Bhat --with-clang-srcdir=${LLVMSRCDIR}/clang \ 355ba302fdSKoustubha Bhat --host=i586-elf32-minix \ 365ba302fdSKoustubha Bhat --with-binutils-include=${NETBSDSRCDIR}/external/gpl3/binutils/dist/include \ 375ba302fdSKoustubha Bhat --disable-debug-symbols \ 385ba302fdSKoustubha Bhat --enable-assertions \ 395ba302fdSKoustubha Bhat --enable-bindings=none \ 40*eba14763SDavid van Moolenbroek llvm_cv_gnu_make_command=${MAKE} \ 415ba302fdSKoustubha Bhat ac_cv_path_CIRCO="echo circo" \ 425ba302fdSKoustubha Bhat ac_cv_path_DOT="echo dot" \ 435ba302fdSKoustubha Bhat ac_cv_path_DOTTY="echo dotty" \ 445ba302fdSKoustubha Bhat ac_cv_path_FDP="echo fdp" \ 455ba302fdSKoustubha Bhat ac_cv_path_NEATO="echo neato" \ 465ba302fdSKoustubha Bhat ac_cv_path_TWOPI="echo twopi" \ 475ba302fdSKoustubha Bhat ac_cv_path_XDOT="echo xdot" \ 485ba302fdSKoustubha Bhat --enable-optimized 495ba302fdSKoustubha Bhat 50*eba14763SDavid van Moolenbroek${MAKE} -j ${JOBS} 515ba302fdSKoustubha Bhat 525ba302fdSKoustubha Bhat# Copy the gold plugin where the NetBSD build system expects it. 535ba302fdSKoustubha Bhatmkdir -p ${NETBSDSRCDIR}/minix/llvm/bin/ 545ba302fdSKoustubha Bhatcp ${OBJ_LLVM}/./Release+Asserts/lib/libLTO.so ${NETBSDSRCDIR}/minix/llvm/bin/ 555ba302fdSKoustubha Bhatcp ${OBJ_LLVM}/./Release+Asserts/lib/LLVMgold.so ${NETBSDSRCDIR}/minix/llvm/bin/ 565ba302fdSKoustubha Bhat 575ba302fdSKoustubha Bhat# Copy useful LLVM tools 585ba302fdSKoustubha Bhatmkdir -p ${CROSS_TOOLS} 595ba302fdSKoustubha Bhatcp ${OBJ_LLVM}/./Release+Asserts/bin/llc ${CROSS_TOOLS} 605ba302fdSKoustubha Bhatcp ${OBJ_LLVM}/./Release+Asserts/bin/opt ${CROSS_TOOLS} 615ba302fdSKoustubha Bhatcp ${OBJ_LLVM}/./Release+Asserts/bin/llvm-* ${CROSS_TOOLS} 625ba302fdSKoustubha Bhat 635ba302fdSKoustubha Bhat# Generate and Install default MINIX passes 645ba302fdSKoustubha Bhatcd ${NETBSDSRCDIR}/minix/llvm/passes/WeakAliasModuleOverride 65*eba14763SDavid van Moolenbroek${MAKE} install 665ba302fdSKoustubha Bhat 67dd859593SKoustubha Bhatcd ${NETBSDSRCDIR}/minix/llvm/passes/hello 68*eba14763SDavid van Moolenbroek${MAKE} install 69949a3e52SDavid van Moolenbroek 70949a3e52SDavid van Moolenbroekcd ${NETBSDSRCDIR}/minix/llvm/passes/sectionify 71*eba14763SDavid van Moolenbroek${MAKE} install 72949a3e52SDavid van Moolenbroek 73949a3e52SDavid van Moolenbroekcd ${NETBSDSRCDIR}/minix/llvm/passes/magic 74*eba14763SDavid van Moolenbroek${MAKE} install 750b98e8aaSDavid van Moolenbroek 760b98e8aaSDavid van Moolenbroekcd ${NETBSDSRCDIR}/minix/llvm/passes/asr 77*eba14763SDavid van Moolenbroek${MAKE} install 78