On Tue, Mar 21, 2006 at 01:22:39PM -0800, Doug Barton wrote: > I'm including rwatson here since the MACHINE_ARCH stuff was his idea. > MACHINE_ARCH should be spelled TARGET_ARCH when doing cross stuff properly. > Ruslan Ermilov wrote: > > >> On Mon, Mar 20, 2006 at 03:40:06PM -0800, John-Mark Gurney wrote: > >>> Should we also document that -m is suppose to be src's etc dir instead > >>> of src? I've accidentally pointed -m at src, and then it does a make > >>> which is quite ammuzing as it's completely the wrong thing... Or now > >>> that we call outside of /etc, should we make -m really point to src, > >>> and have the proper calls add etc to the directory? > > I strongly dislike the idea of changing the semantics of the -m option. It's > been the way it is since day 1, and I really hate to make changes to > something like that. I can see a case for making the man page more clear, > but I'd rather work around the problem with -m than change the semantics. > > > Doesn't really matter, mergemaster(8) was broken because it was > > written when we didn't have correct wrappers for "distrib-dirs" > > and "distribution", upgrade and cross-arch friendly, at the top > > level. > > > > Anyway, attached is the patch I'd like to commit after a nod > > from Doug. It fixes mergemaster(8) to use src/Makefile wrappers > > for distrib-dirs and distribution targets, and makes it use > > TARGET_ARCH instead of faking up MACHINE_ARCH, now that it uses > > the correct wrappers. It also makes ${SOURCEDIR} and -m point > > at the src/ top, as documented in a manpage. > > Forgive me if I'm being dense here, but why do the changes you describe > require that we run make in src/? > You didn't read this thread from beginning, did you? OK, I will explain it in a bit more detail. The time you're running "mergemaster -p", you run src/etc/Makefile which may be incompatible with installed make(1) binary and/or /usr/share/mk files (like is the case for this thread). By using the top level wrappers, all these problems are solved. Wrappers execute src/etc/Makefile targets in upgrade- and cross-friendly environment, with bootstrapped make(1) binary and src/share/mk files. > Or, alternatively, if it is _absolutely_ > necessary to do so, why do we have to redefine SOURCEDIR to be src, and why > can't we just strip /etc from SOURCEDIR where needed? > My original diff didn't change that, I think someone else asked to change it, and it was pretty logical (see below). > In short, I have no objections to fixing mergemaster to work with the new > world order, but it needs to be done in a way that does not change semantics > of an existing option. I'd also like confirmation from Robert that we're not > breaking any of the behavior that he added by doing it the way you propose. > OK, you have my patches, do what you want with them. I don't care which directory the -m option uses, but there's not much sense keeping it pointing to src/etc/ if we're going to use the top-level Makefile and its targets. Absolutely what needs to be done: 1) Fix mergemaster(8) to use top-level targets for distrib-dirs, distribute, and obj/all in "etc". The latter should be more obvious -- my changes fixes it so it runs obj/all in etc in the same environment as buildworld does, i.e., using adequate tools. 2) s/MACHINE_ARCH/TARGET_ARCH/, i.e., don't pretend we're a TARGET_ARCH. When needed top-level makefiles will substitute MACHINE_ARCH=${TARGET_ARCH}. 3) Grow support for TARGET for pc98, better through the "arch[:machine]" format of the -A option's argument. Some reference commits from src/Makefile: : revision 1.320 : date: 2005/07/15 14:38:54; author: ru; state: Exp; lines: +1 -1 : Make the `distrib-dirs' target official and working properly : when cross-building (installing). (This is useful for NFS : installing world/kernel to another architecture machine.) : : revision 1.317 : date: 2005/02/27 12:11:34; author: ru; state: Exp; lines: +2 -1 : Added the convenience "distribution" target which calls the : target of the same name from src/etc/Makefile with a proper : environment, suitable to be used during upgrades and cross- : builds. Cheers, -- Ruslan Ermilov ru_at_FreeBSD.org FreeBSD committer
This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:53 UTC