Diff for /wikisrc/guide/build.mdwn between versions 1.2 and 1.4

version 1.2, 2013/03/07 00:16:23 version 1.4, 2015/06/19 19:18:30
Line 1 Line 1
   **Contents**
   
   [[!toc levels=3]]
   
 # Crosscompiling NetBSD with build.sh  # Crosscompiling NetBSD with build.sh
   
 When targeting a product for an embedded platform, it's not feasible to have all  When targeting a product for an embedded platform, it's not feasible to have all
Line 36  BSDCon 2003 as well as in `/usr/src/BUIL Line 40  BSDCon 2003 as well as in `/usr/src/BUIL
 The first step to do cross-development is to get all the necessary tools  The first step to do cross-development is to get all the necessary tools
 available. In NetBSD terminology, this is called the "toolchain", and it  available. In NetBSD terminology, this is called the "toolchain", and it
 includes BSD-compatible  includes BSD-compatible
 [make(1)](http://netbsd.gw.com/cgi-bin/man-cgi?make+1+NetBSD-current),  [[!template id=man name="make" section="1"]],
 C/C++ compilers, linker, assembler,  C/C++ compilers, linker, assembler,
 [config(8)](http://netbsd.gw.com/cgi-bin/man-cgi?config+8+NetBSD-current),  [[!template id=man name="config" section="8"]],
 as well as a fair number of tools that are only required when crosscompiling a  as well as a fair number of tools that are only required when crosscompiling a
 full NetBSD release, which we won't cover here.  full NetBSD release, which we won't cover here.
   
Line 135  are specific to a certain target platfor Line 139  are specific to a certain target platfor
   
 One important tool that should be pointed out here is `nbmake-sparc64`. This is  One important tool that should be pointed out here is `nbmake-sparc64`. This is
 a shell wrapper for a BSD compatible  a shell wrapper for a BSD compatible
 [make(1)](http://netbsd.gw.com/cgi-bin/man-cgi?make+1+NetBSD-5.0.1+i386) command  [[!template id=man name="make" section="1"]] command
 that's setup to use all the right commands from the crosscompiler toolchain.  that's setup to use all the right commands from the crosscompiler toolchain.
 Using this wrapper instead of `/usr/bin/make` allows crosscompiling programs  Using this wrapper instead of `/usr/bin/make` allows crosscompiling programs
 that were written using the NetBSD Makefile infrastructure (see `src/share/mk`).  that were written using the NetBSD Makefile infrastructure (see `src/share/mk`).
 We will use this  We will use this
 [make(1)](http://netbsd.gw.com/cgi-bin/man-cgi?make+1+NetBSD-5.0.1+i386) wrapper  [[!template id=man name="make" section="1"]] wrapper
 in a second to cross compile the kernel!  in a second to cross compile the kernel!
   
 ## Configuring the kernel manually  ## Configuring the kernel manually
   
 Now that we have a working crosscompiler available, the "usual" steps for  Now that we have a working crosscompiler available, the "usual" steps for
 building a kernel are needed - create a kernel config file, run  building a kernel are needed - create a kernel config file, run
 [config(1)](http://netbsd.gw.com/cgi-bin/man-cgi?config+1+NetBSD-5.0.1+i386),  [[!template id=man name="config" section="1"]],
 then build. As the  then build. As the
 [config(1)](http://netbsd.gw.com/cgi-bin/man-cgi?config+1+NetBSD-5.0.1+i386)  [[!template id=man name="config" section="1"]]
 program used to create header files and Makefile for a kernel build is platform  program used to create header files and Makefile for a kernel build is platform
 specific, we need to use the `nbconfig` program that's part of our new  specific, we need to use the `nbconfig` program that's part of our new
 toolchain. That aside, the procedure is just as like compiling a "native" NetBSD  toolchain. That aside, the procedure is just as like compiling a "native" NetBSD
Line 412  appropriate. Line 416  appropriate.
   
 Several variables control the behaviour of NetBSD builds. Unless otherwise  Several variables control the behaviour of NetBSD builds. Unless otherwise
 specified, these variables may be set in either the process environment or in  specified, these variables may be set in either the process environment or in
 the [make(1)](http://netbsd.gw.com/cgi-bin/man-cgi?make+1+NetBSD-5.0.1+i386)  the [[!template id=man name="make" section="1"]]
 configuration file specified by `MAKECONF`. For a definitive list of these  configuration file specified by `MAKECONF`. For a definitive list of these
 options, see `BUILDING` and `share/mk/bsd.README` files in the toplevel source  options, see `BUILDING` and `share/mk/bsd.README` files in the toplevel source
 directory.  directory.
   
  * *BUILDID* -- Identifier for the build. The identifier will be appended to   * *BUILDID* -- Identifier for the build. The identifier will be appended to
    object directory names, and can be consulted in the     object directory names, and can be consulted in the
    [make(1)](http://netbsd.gw.com/cgi-bin/man-cgi?make+1+NetBSD-5.0.1+i386)     [[!template id=man name="make" section="1"]]
    configuration file in order to set additional build parameters, such as     configuration file in order to set additional build parameters, such as
    compiler flags.     compiler flags.
   
Line 459  directory. Line 463  directory.
    code will be included in a build; provided for the benefit of countries that     code will be included in a build; provided for the benefit of countries that
    do not allow strong cryptography. Will not affect the standard low-security     do not allow strong cryptography. Will not affect the standard low-security
    password encryption system,     password encryption system,
    [crypt(3)](http://netbsd.gw.com/cgi-bin/man-cgi?crypt+3+NetBSD-5.0.1+i386).     [[!template id=man name="crypt" section="3"]].
   
    Default: `yes`     Default: `yes`
   
Line 486  directory. Line 490  directory.
    Default: `yes`     Default: `yes`
   
  * *MKLINT* -- Can be set to `yes` or `no`. Indicates whether   * *MKLINT* -- Can be set to `yes` or `no`. Indicates whether
    [lint(1)](http://netbsd.gw.com/cgi-bin/man-cgi?lint+1+NetBSD-5.0.1+i386) will     [[!template id=man name="lint" section="1"]] will
    be run against portions of the NetBSD source code during the build, and     be run against portions of the NetBSD source code during the build, and
    whether lint libraries will be installed into `DESTDIR``/usr/libdata/lint`     whether lint libraries will be installed into `DESTDIR``/usr/libdata/lint`
   
Line 515  directory. Line 519  directory.
    Default: Platform dependent. As of this writing, all platforms except sh3 default to `yes`     Default: Platform dependent. As of this writing, all platforms except sh3 default to `yes`
   
  * *MKPICINSTALL* -- Can be set to `yes` or `no`. Indicates whether the   * *MKPICINSTALL* -- Can be set to `yes` or `no`. Indicates whether the
    [ar(1)](http://netbsd.gw.com/cgi-bin/man-cgi?ar+1+NetBSD-5.0.1+i386) format     [[!template id=man name="ar" section="1"]] format
    libraries (`lib*_pic.a`), used to generate shared libraries, are installed     libraries (`lib*_pic.a`), used to generate shared libraries, are installed
    during a build.     during a build.
   
Line 565  directory. Line 569  directory.
    should be unique to a given host system and NetBSD source tree. (However,     should be unique to a given host system and NetBSD source tree. (However,
    multiple targets may share the same `TOOLDIR`; the target-dependent files     multiple targets may share the same `TOOLDIR`; the target-dependent files
    have unique names). If unset, a default based on the     have unique names). If unset, a default based on the
    [uname(1)](http://netbsd.gw.com/cgi-bin/man-cgi?uname+1+NetBSD-5.0.1+i386)     [[!template id=man name="uname" section="1"]]
    information of the host platform will be created in the `.OBJDIR` of `src`.     information of the host platform will be created in the `.OBJDIR` of `src`.
   
    Default: Unset.     Default: Unset.
Line 585  directory. Line 589  directory.
    Default: `yes` if building all or part of a whole NetBSD source tree     Default: `yes` if building all or part of a whole NetBSD source tree
    (detected automatically); `no` otherwise (to preserve traditional semantics     (detected automatically); `no` otherwise (to preserve traditional semantics
    of the `bsd.*.mk`     of the `bsd.*.mk`
    [make(1)](http://netbsd.gw.com/cgi-bin/man-cgi?make+1+NetBSD-5.0.1+i386)     [[!template id=man name="make" section="1"]]
    include files).     include files).
   
  * *X11SRCDIR* -- Directory containing the X11R6 source. The main X11R6 source   * *X11SRCDIR* -- Directory containing the X11R6 source. The main X11R6 source
Line 622  manually building subtrees of the NetBSD Line 626  manually building subtrees of the NetBSD
   
  * *NODISTRIBDIRS* -- If set, avoids the `make distrib-dirs` of a full build.   * *NODISTRIBDIRS* -- If set, avoids the `make distrib-dirs` of a full build.
    This skips running     This skips running
    [mtree(8)](http://netbsd.gw.com/cgi-bin/man-cgi?mtree+8+NetBSD-5.0.1+i386) on     [[!template id=man name="mtree" section="8"]] on
    `DESTDIR`, useful on systems where building as an unprivileged user, or where     `DESTDIR`, useful on systems where building as an unprivileged user, or where
    it is known that the system wide mtree files have not changed.     it is known that the system wide mtree files have not changed.
   
Line 630  manually building subtrees of the NetBSD Line 634  manually building subtrees of the NetBSD
   
  * *NOINCLUDES* -- If set, avoids the `make includes` phase of a full build.   * *NOINCLUDES* -- If set, avoids the `make includes` phase of a full build.
    This has the effect of preventing     This has the effect of preventing
    [make(1)](http://netbsd.gw.com/cgi-bin/man-cgi?make+1+NetBSD-5.0.1+i386) from     [[!template id=man name="make" section="1"]] from
    thinking that some programs are out-of-date simply because system include     thinking that some programs are out-of-date simply because system include
    files have changed. However, this option should not be trusted when updating     files have changed. However, this option should not be trusted when updating
    the entire NetBSD source tree arbitrarily; it is suggested to use     the entire NetBSD source tree arbitrarily; it is suggested to use
Line 639  manually building subtrees of the NetBSD Line 643  manually building subtrees of the NetBSD
    Default: Unset     Default: Unset
   
  * *RELEASEDIR* -- If set, specifies the directory to which a   * *RELEASEDIR* -- If set, specifies the directory to which a
    [release(7)](http://netbsd.gw.com/cgi-bin/man-cgi?release+7+NetBSD-5.0.1+i386)     [[!template id=man name="release" section="7"]]
    layout will be written at the end of a `make release`.     layout will be written at the end of a `make release`.
   
    Default: Unset     Default: Unset

Removed from v.1.2  
changed lines
  Added in v.1.4


CVSweb for NetBSD wikisrc <wikimaster@NetBSD.org> software: FreeBSD-CVSweb