Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Multiple NetBSD targets using the same OBJDIR



For the time being, I have decided to create a custom shell script in the 
spirit of etcmanage, after looking over BUILD-NetBSD; perhaps an INSTALL-NETBSD 
custom shell script will follow. I do a large amount of cross-building (my 
NetBSD compiling box is an Ubuntu machine), and I'm not sure how easy it is to 
use use etcmanage on a Linux host, where the only access to the target NetBSD's 
/etc files would either be SSHFS, SMB, FTP, or NFS.

This is probably overkill, but this m4 script generates a number of variables 
which can be used to start a ./build.sh session where directories are separated 
based on target. It current supports rebuilding from scratch and updating after 
"cvs update/git pull". The script also supports choosing MAKECONF and the 
kernel to be compiled.  The script assumes the tools directory already exists, 
but this is okay, since the same tools directory can be used for all possible 
targets. m4 is used to reduce the chance I make a mistake on a per-architecture 
basis.

https://gist.github.com/cr1901/07b8e6810caedc31fe7c

Hopefully this is useful to somebody... and since it's a gist, it can be forked 
as well :P.



----- Original Message -----
From: "Greg Troxel" <gdt%ir.bbn.com@localhost>
To: thor0505%comcast.net@localhost
Cc: current-users%netbsd.org@localhost
Sent: Saturday, July 12, 2014 10:54:21 AM
Subject: Re: Multiple NetBSD targets using the same OBJDIR


thor0505%comcast.net@localhost writes:

> I have a need to build NetBSD for multiple architectures using the
> same source tree. While I understand that one can use the same tools

This is normal.

> directory for all possible targets, I have not found an option to
> separate objects, releasedir, and destdir according to the target or
> some chosen ID (I also have the need to build NetBSD for the same
> architecture in two different configurations).

If you set all of those, you can separate the builds.

But what "configuration" are you changing, and does that result in
changes to the tree, or are you passing a different mk.conf, or
something else?

See pkgsrc/sysutils/etcmanage for the scripts I use, which are aimed
at having a source tree per branch and organizing tool/obj/release/dest
directories in a way I like.

If you want to pass different mk.conf files and have different paths,
that should be pretty easy.   The basic hint is to not insist on passing
one argument, and accept that you will set multiple options.

My script invokes build.sh as

./build.sh -m i386 -j8 -x -u -U -O /usr/obj/gdt-current/i386 -T 
/usr/obj/gdt-current/tools -D /usr/obj/gdt-current/destdir/i386 -R 
/usr/obj/gdt-current/releasedir -X /u0/n0/gdt/NetBSD-current/xsrc release

which sets 4 output options in a way that I the human find consistent.
Arguably I should change -O to make it objdir/i386; there's no good
reason to have the per-arch objdirs not in a container.


Home | Main Index | Thread Index | Old Index