From f09a3cc462299cb519eea0dfc9210bed449a4643 Mon Sep 17 00:00:00 2001 From: Ruslan Ermilov Date: Wed, 2 Mar 2005 16:40:51 +0000 Subject: [PATCH] Add hacks that I use to test cross-builds (by building on native and foreign architectures and comparing products). They eliminate most of the differences caused by different object directory paths, timestamping, and identification. (Note WORLDTMP was renamed to ${OBJTREE}${.CURDIR}/tmp.) --- Makefile.inc1 | 4 ++-- tools/build/Makefile | 4 ++++ tools/build/cross-build/Makefile | 7 +++++++ tools/build/cross-build/date.sh | 6 ++++++ tools/build/cross-build/hostname.sh | 6 ++++++ 5 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 tools/build/cross-build/Makefile create mode 100644 tools/build/cross-build/date.sh create mode 100644 tools/build/cross-build/hostname.sh diff --git a/Makefile.inc1 b/Makefile.inc1 index 1eb8835a2d7..77985fca5af 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -127,12 +127,12 @@ BUILD_ARCH!= sysctl -n hw.machine_arch .error To cross-build, set TARGET_ARCH. .endif .endif -.if ${MACHINE} == ${TARGET} +.if ${MACHINE} == ${TARGET} && !defined(CROSS_BUILD_TESTING) OBJTREE= ${MAKEOBJDIRPREFIX} .else OBJTREE= ${MAKEOBJDIRPREFIX}/${TARGET} .endif -WORLDTMP= ${OBJTREE}${.CURDIR}/${MACHINE_ARCH} +WORLDTMP= ${OBJTREE}${.CURDIR}/tmp # /usr/games added for fortune which depend on strfile BPATH= ${WORLDTMP}/legacy/usr/sbin:${WORLDTMP}/legacy/usr/bin:${WORLDTMP}/legacy/usr/games XPATH= ${WORLDTMP}/usr/sbin:${WORLDTMP}/usr/bin:${WORLDTMP}/usr/games diff --git a/tools/build/Makefile b/tools/build/Makefile index be1de32d75c..b523f139536 100644 --- a/tools/build/Makefile +++ b/tools/build/Makefile @@ -23,4 +23,8 @@ INCS+= nl_types.h SRCS= dummy.c .endif +.if defined(CROSS_BUILD_TESTING) +SUBDIR= cross-build +.endif + .include diff --git a/tools/build/cross-build/Makefile b/tools/build/cross-build/Makefile new file mode 100644 index 00000000000..69c1e9c4984 --- /dev/null +++ b/tools/build/cross-build/Makefile @@ -0,0 +1,7 @@ +# $FreeBSD$ + +NO_OBJ= +SCRIPTS= date.sh hostname.sh +BINDIR= /usr/bin + +.include diff --git a/tools/build/cross-build/date.sh b/tools/build/cross-build/date.sh new file mode 100644 index 00000000000..f697a7f0cd5 --- /dev/null +++ b/tools/build/cross-build/date.sh @@ -0,0 +1,6 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +exec /bin/date -r0 "$@" diff --git a/tools/build/cross-build/hostname.sh b/tools/build/cross-build/hostname.sh new file mode 100644 index 00000000000..855741beca8 --- /dev/null +++ b/tools/build/cross-build/hostname.sh @@ -0,0 +1,6 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +echo dummy