Major kernel build infrastructure changes, part 2/2 (user).
authorMatthew Dillon <dillon@dragonflybsd.org>
Tue, 7 Nov 2006 06:57:02 +0000 (06:57 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Tue, 7 Nov 2006 06:57:02 +0000 (06:57 +0000)
commite2ea661939e207855b22208faef828fd71134afc
treefeff8084f4f63cec1369d7ccf042c50bc0d80e11
parenta92953496ab9da27b410a3b3d5a28405decc38d3
Major kernel build infrastructure changes, part 2/2 (user).

These changes are primarily designed to create a 2-layer machine and cpu
build hierarchy in order to support virtual kernel builds in the near term
and future porting efforts in the long term.

* The make program now pulls MACHINE, MACHINE_ARCH, and MACHINE_CPU from
  the kernel hw.machine, hw.machine_arch, and hw.machine_cpu sysctl
  variables, unless overridden by environment variables.

* The config program now generates additional softlinks in the kernel build
  directory:

  machine points to the platform architecture header files
  machine_base points to the baes of the platform architecture directory.
  cpu points to the cpu architecture header files
  cpu_base points to the base of the cpu architecture directory

  Additionally, the config program generates forwarding header files as
  includes/machine/*.h.  Any cpu architecture header files that are not
  overridden by the platform architecture are generated in this directory.

  The kernel build's Makefile adjusts the -I paths to effectively merge
  machine/ and includes/machine/, presenting a uniform <machine/*.h>
  include file architecture to the kernel build.

  The kernel build's Makefile now automatically exports MACHINE and
  MACHINE_ARCH as environment variables.

  The kernel build's Makefile now makes opt_*, use_*, and IF header files
  directly available to the module build subsystem so the module build
  subsystem does not have to generate them in each module subdirectory.

* Kernel configuration files now require both a 'machine' and a 'machine_arch'
  directive.  Typically:

  machine pc32 (subject to change)
  machine_arch i386

* /usr/include/cpu has been added to augment /usr/include/machine.  The
  buildworld infrastructure also automatically merges any <cpu/*.h> header
  files that were not overridden by the <machine/*.h> header files into
  /usr/include/machine.

  Note that direct access to /usr/include/cpu is not recommended.

* A number of weird cases that generate extranious 'machine' softlinks
  (for <machine/*.h> header access) have been removed.

* The MACHINE_ARCH default to i386 has been removed.  If the make program
  does not define the MACHINE_ environment and sys.mk is included, sys.mk
  will now fail with an error.

* cpdup has been added to the bootstrap tools.
14 files changed:
Makefile.inc1
etc/mtree/BSD.include.dist
include/Makefile
share/mk/sys.mk
test/sysperf/syscall1.c
usr.bin/doscmd/register.h
usr.bin/make/main.c
usr.sbin/config/config.h
usr.sbin/config/config.y
usr.sbin/config/configvers.h
usr.sbin/config/lang.l
usr.sbin/config/main.c
usr.sbin/config/mkmakefile.c
usr.sbin/config/mkoptions.c