At Tue, 14 Jul 2009 19:01:38 -0400, Taylor R Campbell <campbell%mumble.net@localhost> wrote: Subject: using build.sh in src subdirectories > > Handling destdirs and installworlddirs might pose an issue for > installing from a single source directory -- I don't know anything > about how this works, but I imagine that it might take some effort to > persuade build.sh to copy just those files from the destdir to the > installworlddir that are relevant, since simply making the install > target in the desired subdirectory will install files into the > destdir, not into the installworlddir. The key thing to remember is that build.sh and the tools it invokes are really still just a nest of wrapper scripts around "make", and all they do are set up various variables used by "make" to appropriate values so that everything is built and installed wherever the operator wishes. Normally I run build.sh (using yet another wrapper script :-)) in such a way that it always does unprivileged builds and installs into a separate release directory (for the purpose of building install and upgrade media). However it is easy to use the $TOOLDIR tools to also manually build any individual components and install them directly onto the build host (assuming the build host is a comparable NetBSD host to the target :-)). This is the comment about how I do this from the top of the mybuild.sh wrapper script I use: # NOTE: # # To build and install something direct to / -- i.e. to patch the host system: # # . ./myhelpers.ksh # nbmake-$(uname -m) dependall # su root # nbmake-$(uname -m) MKUNPRIVED=no install DESTDIR=/ # # To do this on a system where you don't normally do full builds # you'll need to do the following to create a working build # environment before you can build an individual program: # # ./mybuild.sh -L [-u] # XXX build.sh only does -t # # Also, to build a custom kernel use: # # ./mybuild.sh -f -k CONFFILE # The myhelpers.ksh script contains useful aliases and functions that help set $TOOLDIR properly and then prepend $TOOLDIR/bin to $PATH so that you can run nbmake-i386 without having to use the whole path. I show the whole comment above to hint that you'll have to make sure the $TOOLDIR, $OBJDIR and $RELEASEDIR are fully up to date with all the tools, installed header files, and installed libraries, etc. before you can build anything else. At the moment it's still impossible to build all the libraries directly with a build.sh option (i.e. in the same way one can build all the tools). My wrapper script builds the rest of the dependencies with a sequence something like: ./build.sh -m $(uname -m) tools nbmake-$(uname -m) do-distrib-dirs nbmake-$(uname -m) obj nbmake-$(uname -m) includes nbmake-$(uname -m) libs FYI, I haven't truly tested this sequence since the netbsd-1-6 branch.... I can post the current versions of my wrapper/helper scripts if anyone's interested. Ideally of course my scripts should be properly merged with build.sh so that it can provide all the necessary additional functionality, but somehow I don't believe that could happen in a way which would actually satisfy all of my own requirements. :-) -- Greg A. Woods Planix, Inc. <woods%planix.com@localhost> +1 416 218-0099 http://www.planix.com/
Attachment:
pgpZJhWa1W6dn.pgp
Description: PGP signature