#!/bin/sh set -eu eval "$(args freshen-build-uberbaum ubersrc uberbuild gccsrc gccbuild -- "$@")" cmd () { echo echo "freshen-build-uberbaum: $1" >&2 eval "$1" || { status="$?" echo "exit status: $status" return $status } } # Always start with the latest sources. cmd "freshen-and-patch '$ubersrc'" cmd "freshen-and-patch '$gccsrc'" # And empty build trees. cmd "wipe-build-tree '$uberbuild'" cmd "wipe-build-tree '$gccbuild'" # First, we build and install binutils from uberbaum. cmd "cd '$uberbuild'" cmd "CFLAGS=-g3 $(compiler $uberbuild) '$ubersrc/configure' $(config-flags $uberbuild)" cmd "$(compiler $uberbuild) make all-binutils" cmd "$(compiler $uberbuild) make install-binutils" cmd "uberbin='$(prefix $uberbuild/config.status)/bin'" setpath="with-path '$uberbin' $(compiler $gccbuild)" # Then, we build and install GCC from its own repository, which, if # it's a cross-compiler, depends on the target 'ar' we just built. cmd "cd '$gccbuild'" cmd "CFLAGS=-g3 ${setpath} '$gccsrc/configure' $(config-flags $gccbuild)" cmd "${setpath} make" cmd "${setpath} make install" # And finally, we build the entire tree from sources. cmd "cd '$uberbuild'" cmd "${setpath} make install"