-PKG_CONFIG=/local/scratch/Rump-kernels/rump-build-script-junk/pkg-config \
- /local/scratch/Rump-kernels/rumpuser-xen/app-tools/rumpapp-xen-configure ./configure \
- --prefix=/local/scratch/Rump-kernels/prefix --disable-stubodm --disable-docs
-/local/scratch/Rump-kernels/rumpuser-xen/app-tools/rumpapp-xen-make -j16
+#!/bin/sh
+
+set -e
+
+x () {
+ echo >&2 "x $*"
+ "$@"
+}
+
+setdir () {
+ dir=$1
+ echo "==================== $dir ===================="
+}
+
+gettar () {
+ setdir $1
+ local url=$2
+ if ! test -d $dir; then
+ local dlfile="${url##*/}"
+ rm -f "$dlfile"
+ wget "$url"
+ rm -rf d; mkdir d; cd d
+ x tar axf ../"$dlfile"
+ cd ..
+ mv d/$dir .
+ fi
+}
+
+dirx () {
+ cd $dir
+ x "$@"
+ cd ..
+}
+
+stdconfigure () {
+ dirx env PKG_CONFIG=/local/scratch/Rump-kernels/rump-build-script-junk/pkg-config \
+ /local/scratch/Rump-kernels/rumprun/app-tools/rumprun-xen-configure ./configure \
+ --prefix=/local/scratch/Rump-kernels/prefix --disable-shared
+}
+
+stdmake () {
+ dirx /local/scratch/Rump-kernels/rumprun/app-tools/rumprun-xen-make -j4
+}
+
+stdmakeinstall () {
+ dirx /local/scratch/Rump-kernels/rumprun/app-tools/rumprun-xen-make install
+}
+
+want () {
+ gettar $1 "$2"
+ stdconfigure
+ stdmake
+ stdmakeinstall
+}
+
+# build libxc and libxenstore
+# run ./configure in toplevel to workaround a bug in Xen's build system
+# that Paths.mk doesn't get generate if only ./configure in tools
+setdir /local/scratch/Rump-kernels/xen.git
+dirx env PKG_CONFIG=/local/scratch/Rump-kernels/rump-build-script-junk/pkg-config \
+ /local/scratch/Rump-kernels/rumprun/app-tools/rumprun-xen-configure ./configure \
+ --prefix=/local/scratch/Rump-kernels/prefix \
+ --with-xen-dumpdir=/local/scratch/Rump-kernels/prefix/var/lib/xen/dump
+setdir /local/scratch/Rump-kernels/xen.git/tools
+dirx env PKG_CONFIG=/local/scratch/Rump-kernels/rump-build-script-junk/pkg-config \
+ make V=1 CC=/local/scratch/Rump-kernels/rumprun/app-tools/rumprun-xen-cc -j4 CPPFLAGS="-U__SSE2__"
+stdmakeinstall
+