Date: Thu, 01 Jan 2009 23:42:12 -0800 From: Doug Barton <dougb@dougbarton.us> To: freebsd-hackers@freebsd.org Subject: bsd.obj.mk does not set CANONICALOBJDIR correctly when TARGET_ARCH and MAKEOBJDIRPREFIX are set Message-ID: <495DC554.9030408@dougbarton.us>
next in thread | raw e-mail | index | archive | help
In working on cross-platform support for mergemaster I came across the
following problem. I set MAKEOBJDIRPREFIX to be that of the temproot
environment, which works fine when you do not specify a TARGET_ARCH.
When you do specify TARGET_ARCH there is a conflict between
src/Makefile.inc1 and share/mk/bsd.obj.mk. The former does this:
.if ${MACHINE} == ${TARGET} && !defined(CROSS_BUILD_TESTING)
OBJTREE= ${MAKEOBJDIRPREFIX}
.else
OBJTREE= ${MAKEOBJDIRPREFIX}/${TARGET}
.endif
however the latter does this:
.if defined(MAKEOBJDIRPREFIX)
CANONICALOBJDIR:=${MAKEOBJDIRPREFIX}${.CURDIR}
.else
CANONICALOBJDIR:=/usr/obj${.CURDIR}
.endif
When trying to install the stuff in src/etc/sendmail install(1) cannot
find the file because it is built in <foo>/obj but it's looking for it
in <foo>/obj/$target
The simplest fix I found was to do the following in bsd.obj.mk:
Index: bsd.obj.mk
===================================================================
--- bsd.obj.mk (revision 186676)
+++ bsd.obj.mk (working copy)
@@ -43,7 +43,7 @@
.include <bsd.own.mk>
.if defined(MAKEOBJDIRPREFIX)
-CANONICALOBJDIR:=${MAKEOBJDIRPREFIX}${.CURDIR}
+CANONICALOBJDIR:=${OBJTREE}${.CURDIR}
.else
CANONICALOBJDIR:=/usr/obj${.CURDIR}
.endif
However I would be happy with any solution that makes it work. It's
trivial to test with 'mergemaster -i -D</temp/dir/for/root> -A arm'
Doug
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?495DC554.9030408>
