#!/bin/bash EZM3_VER=1.1 cd /usr/local/src/ezm3 source ./scripts/arch || exit 1 source ./scripts/helper-funcs || exit 1 ROOT=/usr/local/src/ezm3/root/${ARCH} mkdir -p ${ARCH} cd ${ARCH} LOG=${PWD}/log ########## # Unpack/setup the appropriate sources ########## status "Unpacking ezm3-${EZM3_VER} source" rm -rf ezm3-${EZM3_VER} ${ROOT} tar -jxf /usr/portage/distfiles/ezm3-${EZM3_VER}-src.tar.bz2 status "Unpacking ezm3 bootstrap for ${HOST}" tar -jxf /usr/portage/distfiles/ezm3-${EZM3_VER}-${HOST}-boot.tar.bz2 cd ezm3-${EZM3_VER} status "Adding support for ${ARCH}" patch -p1 < ../../patches/cross.patch >& ${LOG} || die "patch failed" ########## # Fix configuration files for our linux setup ########## sed -i "s:/usr/local:${ROOT}:" m3config/src/${HOST} echo 'M3CC_MAKE = ["make", "BISON=yacc"]' >> m3config/src/${HOST} sed -i \ -e "s:/usr/local:${ROOT}:" \ -e "s:touch:ranlib:" \ -e "s:import_X11():import_X11() is\nend\nproc dont_import_X11():" \ -e "s:import_OpenGL():import_OpenGL() is\nend\nproc dont_import_OpenGL():" \ m3config/src/COMMON ########## # Build the compiler ########## status "Building cross-compile capable toolkit [boot]" make boot >& ${LOG} || die "failed to build boot" status "Building cross-compile capable toolkit [packages]" ( make packages >& ${LOG} \ && echo yes > status \ || echo no > status ) & touch ${LOG} last="" while [ ! -e status ] ; do this="`grep ^---------- ${LOG} | tail -n 1 | sed 's:----------::g'`" if [ "${this}" != "${last}" ] ; then last="${this}" status "${last}" fi sleep 1 done if [ "$(