When it's appropriate
You can build just a component when you don't need the entire consolidation, when you are building a self-contained utility, when you are getting started with Illumos, or when you want to do a quick build.
This approach is only for independent programs like
I'm building the
m4 command from the ONNV consolidation on a system running oi_148.
Setup of the compilation environment is detailed in How To Build illumos.
This should be installed in
/usr from the IPS package
The C compiler is the properly patched version of Sun Studio 12 (no longer publicly available) installed in
/opt/sunstudio12.1 from the file
These reside in
/opt/onbld and are installed from the IPS package
Just make sure all of the executables you need are available through the
I needed this symlink for the PATH to work correctly:
NOTE: Setup of the compilation environment, including preparation of the recommended directories in a ZFS layout, and checkout of the code, is detailed in How To Build illumos.
The steps below outline an alternative (and somewhat incompatible) approach to this procedure. Still, if you only intend to build small pieces of the project, especially if you only have an unprivileged user account on the build host, these instructions should suffice and may be less complicated to follow.
Set up the location
Obtain the source
Set up the environment file
As you can see, I modified some lines in the file to suit my build system, and added a few so that the
lint command from Sun Studio 12u1 could be found.
Preparing the workspace for component build
A few tools have to be prepared before we can build a component. To build them, you should run commands in a new shell which sets some environment variables:
Change directory to where the
m4 Makefile (the build target of our example) resides:
Clean out the object files by '
make clean'. It only deletes object files, and not the generated executables. But the executables will be regenerated once all the object files are rebuilt (and become newer than the executable target).
Do a dry-run by '
Now actually build m4 binary by '
Note that the argument list must be quoted if it contains more than one word.
Object file and
i386/m4 executable file got generated.
ldd" and "
file" commands to profile the built
- Garrett D'Amore suggests:
doing "make setup" in the top level, plus a "make install" in the
directory of interest, usually works if the utility is self contained.
- Jens Elkner recommends:
I made the src tree once nightly to "initilize" required stuff. After
that I just source the script mentioned below when I start working,
change to the dir of interest and call 'make ...'. This usually works
even if nightly doesn't run through completely ...
- Dan McDonald cites:
I haven't looked very closely at the Illumos build instructions, but
I'm going to do some things now that will help kernel module writers
(e.g. device drivers) get started without resorting to a full build
right off the bat.
Some component build examples.
libcbuild on oi_148 dual CPU with 2G RAM VMware session (also note this example uses the recommended build directory layout):