Crossbuilding DFly on old FBSD
Matthew Dillon
dillon at apollo.backplane.com
Fri Jul 30 14:21:53 PDT 2004
Ok, I think I see a better way to do this. The 'patch' binary is
generated in the bootstrap stage, but our cross-tools stage (which
builds binutils) does not have it in the path. Only our world stage
puts the bootstrap tools in its path.
Instead of hacking PATCH I think all we need to do is give the
bootstrap, build, and cross-tools stages access to the bootstrap
stage's binaries and move the build of 'patch' to the beginning of
the bootstrap stage.
Try out this patch (I am testing it now so there might be issues with
it)... see if it does a better job on your old FreeBSD system with
your other hacks removed.
It should be possible to address most if not all of the issues with
older FreeBSD boxes this way and we might even be able to make
cross-building work on other BSD platforms.
-Matt
Matthew Dillon
<dillon at xxxxxxxxxxxxx>
Index: Makefile.inc1
===================================================================
RCS file: /cvs/src/Makefile.inc1,v
retrieving revision 1.35
diff -u -r1.35 Makefile.inc1
--- Makefile.inc1 26 Jun 2004 02:56:47 -0000 1.35
+++ Makefile.inc1 30 Jul 2004 21:17:50 -0000
@@ -172,6 +172,13 @@
CTOOLSDEST= ${DESTDIRBASE}/ctools_${MACHINE_ARCH}_${TARGET_ARCH}
WORLDDEST= ${DESTDIRBASE}/world_${TARGET_ARCH}
+# The bootstrap-tools path is used by the bootstrap-tools, build-tools, and
+# cross-tools stages to augment the existing command path to access newer
+# versions of certain utilities such as 'patch' that the cross-tools stage
+# might expect.
+#
+BTOOLSPATH= ${BTOOLSDEST}/usr/sbin:${BTOOLSDEST}/usr/bin:${BTOOLSDEST}/bin:${BTOOLSDEST}/usr/games
+
# The strict temporary command path contains all binaries required
# by the buildworld system after the cross-tools stage.
#
@@ -206,6 +213,7 @@
BMAKEENV= MAKEOBJDIRPREFIX=${BTOOLSDEST} \
OBJTREE=${OBJTREE} \
DESTDIR=${BTOOLSDEST} \
+ PATH=${BTOOLSPATH}:${PATH} \
INSTALL="sh ${.CURDIR}/tools/install.sh"
BMAKE= ${BMAKEENV} ${MAKE} -f Makefile.inc1 -DBOOTSTRAPPING \
@@ -217,6 +225,7 @@
TMAKEENV= MAKEOBJDIRPREFIX=${BTOOLSDEST} \
OBJTREE=${OBJTREE} \
DESTDIR= \
+ PATH=${BTOOLSPATH}:${PATH} \
INSTALL="sh ${.CURDIR}/tools/install.sh"
TMAKE= ${TMAKEENV} ${MAKE} -f Makefile.inc1 -DBOOTSTRAPPING \
@@ -234,7 +243,8 @@
DESTDIR=${CTOOLSDEST} \
INSTALL="sh ${.CURDIR}/tools/install.sh" \
TOOLS_PREFIX=${CTOOLSDEST} \
- USRDATA_PREFIX=${WORLDDEST}
+ USRDATA_PREFIX=${WORLDDEST} \
+ PATH=${BTOOLSPATH}:${PATH}
XMAKE= ${XMAKEENV} ${MAKE} -f Makefile.inc1 -DNO_FORTRAN -DNO_GDB \
-DBOOTSTRAPPING
@@ -680,8 +690,14 @@
# to attempt to manually finish it. If in doubt, 'make world' again.
#
-# bootstrap-tools: Build all tools required to build all tools.
-#
+# bootstrap-tools: Build all tools required to build all tools. Note that
+# order is important in a number of cases and also note that the bootstrap
+# and build tools stages have access to earlier binaries they themselves
+# had generated.
+#
+# patch: older patch's do not have -i. This program must be built
+# first so other bootstrap tools that need to apply patches
+# can use it.
# [x]install: dependancies on various new install features
# rpcgen: old rpcgen used a hardwired cpp path, newer OBJFORMAT_PATH
# envs are not compatible with older objformat binaries.
@@ -692,6 +708,7 @@
bootstrap-tools:
.for _tool in ${_strfile} \
+ gnu/usr.bin/patch \
bin/chmod bin/cp bin/dd bin/mkdir bin/rm bin/echo bin/test \
bin/cat bin/date bin/ln bin/mv bin/csh bin/expr bin/sh bin/ls \
bin/hostname bin/kill \
@@ -708,7 +725,7 @@
usr.sbin/chown usr.sbin/mtree usr.sbin/config \
usr.sbin/btxld usr.sbin/pwd_mkdb usr.sbin/zic usr.sbin/makewhatis \
gnu/usr.bin/gperf gnu/usr.bin/groff gnu/usr.bin/texinfo \
- gnu/usr.bin/grep gnu/usr.bin/sort gnu/usr.bin/patch \
+ gnu/usr.bin/grep gnu/usr.bin/sort \
gnu/usr.bin/gzip
${ECHODIR} "===> ${_tool} (bootstrap-tools)"; \
cd ${.CURDIR}/${_tool}; \
More information about the Submit
mailing list