fi
}
+# check that the necessary things are available on the build system
+probeprereqs ()
+{
+
+ if [ "${PLATFORM}" = "xen" ]; then
+ # probe location of Xen headers
+ found=false
+ for loc in /usr/pkg/include/xen /usr/include/xen; do
+ if printf '#include <stdint.h>\n#include <xen.h>\n'\
+ | ${CC} -I${loc} -x c - -c -o /dev/null \
+ >/dev/null 2>&1 ; then
+ found=true
+ break
+ fi
+ done
+
+ if ${found}; then
+ echo "XEN_HEADERS=${loc}" >> ${RROBJ}/config.mk
+ echo "XEN_HEADERS=\"${loc}\"" >> ${RROBJ}/config.sh
+ else
+ echo '>> You need to provide Xen headers.'
+ echo '>> The exactly source depends on your system'
+ echo '>> (e.g. libxen-dev package on some systems)'
+ die Xen headers not found
+ fi
+ fi
+}
+
checkprevbuilds ()
{
EOF
export RUMPRUN_MKCONF="${RROBJ}/config.mk"
+ . "${RROBJ}/config.sh"
+
+ probeprereqs
+
cat >> ${RUMPTOOLS}/mk.conf << EOF
.if defined(LIB) && \${LIB} == "pthread"
.PATH: $(pwd)/lib/librumprun_base/pthread
endif
include ${RUMPRUN_MKCONF}
-# Where to find xen headers from. XXX: this can probably be done better
-ifeq ($(shell uname -s),NetBSD)
-XEN_HEADERS ?= /usr/pkg/include/xen
-else
-XEN_HEADERS ?= /usr/include/xen
-endif
-
# from Xen/Config.mk
XEN_COMPILE_ARCH ?= $(patsubst amd64,x86_64,$(patsubst i386,x86_32,${MACHINE}))
XEN_TARGET_ARCH ?= $(XEN_COMPILE_ARCH)