Browse files

Sync with HEAD.

  • Loading branch information...
1 parent 7e4c46a commit 4d361e9505df41fd332857324c8671c44da313d5 jruoho committed Jun 6, 2011
Showing with 0 additions and 19,507 deletions.
  1. +0 −923 BUILDING
  2. +0 −544 Makefile
  3. +0 −16 Makefile.inc
  4. +0 −536 UPDATING
  5. +0 −8 bin/Makefile
  6. +0 −11 bin/Makefile.inc
  7. +0 −6 bin/cat/Makefile
  8. +0 −209 bin/cat/cat.1
  9. +0 −316 bin/cat/cat.c
  10. +0 −5 bin/chio/Makefile
  11. +0 −256 bin/chio/chio.1
  12. +0 −858 bin/chio/chio.c
  13. +0 −62 bin/chio/defs.h
  14. +0 −38 bin/chio/pathnames.h
  15. +0 −6 bin/chmod/Makefile
  16. +0 −294 bin/chmod/chmod.1
  17. +0 −214 bin/chmod/chmod.c
  18. +0 −7 bin/cp/Makefile
  19. +0 −230 bin/cp/cp.1
  20. +0 −535 bin/cp/cp.c
  21. +0 −60 bin/cp/extern.h
  22. +0 −376 bin/cp/utils.c
  23. +0 −56 bin/csh/Makefile
  24. +0 −12 bin/csh/USD.doc/Makefile
  25. +0 −1,010 bin/csh/USD.doc/csh.1
  26. +0 −1,303 bin/csh/USD.doc/csh.2
  27. +0 −648 bin/csh/USD.doc/csh.3
  28. +0 −176 bin/csh/USD.doc/csh.4
  29. +0 −93 bin/csh/USD.doc/csh.ap
  30. +0 −1,719 bin/csh/USD.doc/csh.g
  31. +0 −32 bin/csh/USD.doc/tabs
  32. +0 −117 bin/csh/alloc.c
  33. +0 −314 bin/csh/char.c
  34. +0 −99 bin/csh/char.h
  35. +0 −163 bin/csh/const.c
  36. +0 −2,302 bin/csh/csh.1
  37. +0 −1,360 bin/csh/csh.c
  38. +0 −552 bin/csh/csh.h
  39. +0 −900 bin/csh/dir.c
  40. +0 −48 bin/csh/dir.h
  41. +0 −965 bin/csh/dol.c
  42. +0 −388 bin/csh/err.c
  43. +0 −746 bin/csh/exec.c
  44. +0 −661 bin/csh/exp.c
  45. +0 −333 bin/csh/extern.h
Sorry, we could not display the entire diff because too many files (83,710) changed.
View
923 BUILDING
@@ -1,923 +0,0 @@
-BUILDING(8) NetBSD System Manager's Manual BUILDING(8)
-
-NAME
- BUILDING -- Procedure for building NetBSD from source code.
-
-REQUIREMENTS
- NetBSD is designed to be buildable on most POSIX-compliant host systems.
- The basic build procedure is the same whether compiling natively (on the
- same NetBSD architecture) or cross compiling (on another architecture or
- OS).
-
- This source tree contains a special subtree, ``tools'', which uses the
- host system to create a build toolchain for the target architecture. The
- host system must have at least C and C++ compilers in order to create the
- toolchain (make is not required); all other tools are created as part of
- the NetBSD build process. (See the environment variables section below
- if you need to override or manually select your compilers.)
-
-FILES
- Source tree layout
- doc/BUILDING.mdoc
- This document (in -mdoc troff format; the original copy).
-
- BUILDING This document (in plaintext).
-
- tools/compat/README
- Special notes for cross-hosting a NetBSD build on non-
- NetBSD platforms.
-
- Makefile The main Makefile for NetBSD; should only be run for
- native builds with an appropriately up-to-date version of
- NetBSD make(1). (For building from out-of-date systems or
- on a non-native host, see the build.sh shell script.)
-
- UPDATING Special notes for updating from an earlier revision of
- NetBSD. It is important to read this file before every
- build of an updated source tree.
-
- build.sh Bourne-compatible shell script used for building the host
- build tools and the NetBSD system from scratch. Can be
- used for both native and cross builds, and should be used
- instead of make(1) for any source tree that is updated and
- recompiled regularly.
-
- crypto/dist/, dist/, gnu/dist/
- Sources imported verbatim from third parties, without man-
- gling the existing build structure. Other source trees in
- bin through usr.sbin use the NetBSD make(1) ``reachover''
- Makefile semantics when building these programs for a
- native host.
-
- distrib/, etc/
- Sources for items used when making a full release snap-
- shot, such as files installed in DESTDIR/etc on the desti-
- nation system, boot media, and release notes.
-
- tests/, regress/
- Regression test harness. Can be cross-compiled, but only
- run natively. tests/ uses the atf(7) test framework;
- regress/ contains older tests that have not yet been
- migrated to atf(7).
-
- sys/ NetBSD kernel sources.
-
- tools/ ``Reachover'' build structure for the host build tools.
- This has a special method of determining out-of-date sta-
- tus.
-
- bin/ ... usr.sbin/
- Sources to the NetBSD userland (non-kernel) programs. If
- any of these directories are missing, they will be skipped
- during the build.
-
- x11/ ``Reachover'' build structure for X11R6; the source is in
- X11SRCDIR.
-
- Build tree layout
- The NetBSD build tree is described in hier(7), and the release layout is
- described in release(7).
-
-CONFIGURATION
- Environment variables
- Several environment variables control the behaviour of NetBSD builds.
-
- HOST_SH Path name to a POSIX-compliant shell. If this is not
- set explicitly, then the default is set using heuris-
- tics dependent on the host platform, or from the shell
- under which build.sh is executed (if that can be deter-
- mined), or using the first copy of sh found in PATH.
- If the host system's /bin/sh is not POSIX-compliant, we
- suggest that you build using commands like
-
- HOST_SH=/path/to/working/shell
- export HOST_SH
- ${HOST_SH} build.sh [options]
-
- HOST_CC Path name to C compiler used to create the toolchain.
-
- HOST_CXX Path name to C++ compiler used to create the toolchain.
-
- MACHINE Machine type, e.g., ``macppc''.
-
- MACHINE_ARCH Machine architecture, e.g., ``powerpc''.
-
- MAKE Path name to invoke make(1) as.
-
- MAKEFLAGS Flags to invoke make(1) with.
-
- MAKEOBJDIR Directory to use as the .OBJDIR for the current direc-
- tory. The value is subjected to variable expansion by
- make(1). Typical usage is to set this variable to a
- value involving the use of `${.CURDIR:S...}' or
- `${.CURDIR:C...}', to derive the value of .OBJDIR from
- the value of .CURDIR. Used only if MAKEOBJDIRPREFIX is
- not defined. MAKEOBJDIR can be provided only in the
- environment or via the -O flag of build.sh; it cannot
- usefully be set inside a Makefile, including mk.conf or
- ${MAKECONF}.
-
- MAKEOBJDIRPREFIX Top level directory of the object directory tree. The
- value is subjected to variable expansion by make(1).
- build.sh will create the ${MAKEOBJDIRPREFIX} directory
- if necessary, but if make(1) is used without build.sh,
- then rules in <bsd.obj.mk> will abort the build if the
- ${MAKEOBJDIRPREFIX} directory does not exist. If the
- value is defined and valid, then ${MAKEOBJDIRPRE-
- FIX}/${.CURDIR} is used as the .OBJDIR for the current
- directory. The current directory may be read only.
- MAKEOBJDIRPREFIX can be provided only in the environ-
- ment or via the -M flag of build.sh; it cannot usefully
- be set inside a Makefile, including mk.conf or
- ${MAKECONF}.
-
- "make" variables
- Several variables control the behavior of NetBSD builds. Unless other-
- wise specified, these variables may be set in either the process environ-
- ment or the make(1) configuration file specified by MAKECONF.
-
- BUILDID Identifier for the build. The identifier will be appended to
- object directory names, and can be consulted in the make(1)
- configuration file in order to set additional build parame-
- ters, such as compiler flags.
-
- BUILDSEED GCC uses random numbers when compiling C++ code. This vari-
- able seeds the gcc random number generator using the -fran-
- dom-seed flag with this value. By default, it is set to
- NetBSD-(majorversion). Using a fixed value causes C++ bina-
- ries to be the same when built from the same sources, result-
- ing in identical (reproducible) builds. Additional informa-
- tion is available in the GCC documentation of -frandom-seed.
-
- DESTDIR Directory to contain the built NetBSD system. If set, spe-
- cial options are passed to the compilation tools to prevent
- their default use of the host system's /usr/include,
- /usr/lib, and so forth. This pathname must be an absolute
- path, and should not end with a slash (/) character. (For
- installation into the system's root directory, set DESTDIR to
- an empty string, not to ``/''). The directory must reside on
- a file system which supports long file names and hard links.
-
- Default: Empty string if USETOOLS is ``yes''; unset other-
- wise.
-
- Note: build.sh will provide a default of destdir.MACHINE (in
- the top-level .OBJDIR) unless run in `expert' mode.
-
- MAKECONF The name of the make(1) configuration file. Only settable in
- the process environment.
-
- Default: ``/etc/mk.conf''
-
- MAKEVERBOSE
- Level of verbosity of status messages. Supported values:
-
- 0 No descriptive messages or commands executed by make(1)
- are shown.
-
- 1 Brief messages are shown describing what is being done,
- but the actual commands executed by make(1) are not dis-
- played.
-
- 2 Descriptive messages are shown as above (prefixed with a
- `#'), and ordinary commands performed by make(1) are
- displayed.
-
- 3 In addition to the above, all commands performed by
- make(1) are displayed, even if they would ordinarily
- have been hidden through use of the ``@'' prefix in the
- relevant makefile.
-
- 4 In addition to the above, commands executed by make(1)
- are traced through use of the sh(1) ``-x'' flag.
-
- Default: 2
-
- MKCATPAGES Can be set to ``yes'' or ``no''. Indicates whether prefor-
- matted plaintext manual pages will be created during a build.
-
- Default: ``yes''
-
- MKCRYPTO Can be set to ``yes'' or ``no''. Indicates whether crypto-
- graphic code will be included in a build; provided for the
- benefit of countries that do not allow strong cryptography.
- Will not affect use of the standard low-security password
- encryption system, crypt(3).
-
- Default: ``yes''
-
- MKDOC Can be set to ``yes'' or ``no''. Indicates whether system
- documentation destined for DESTDIR/usr/share/doc will be
- installed during a build.
-
- Default: ``yes''
-
- MKHTML Can be set to ``yes'' or ``no''. Indicates whether prefor-
- matted HTML manual pages will be built and installed
-
- Default: ``yes''
-
- MKHOSTOBJ Can be set to ``yes'' or ``no''. If set to ``yes'', then for
- programs intended to be run on the compile host, the name,
- release, and architecture of the host operating system will
- be suffixed to the name of the object directory created by
- ``make obj''. (This allows multiple host systems to compile
- NetBSD for a single target.) If set to ``no'', then programs
- built to be run on the compile host will use the same object
- directory names as programs built to be run on the target.
-
- Default: ``no''
-
- MKINFO Can be set to ``yes'' or ``no''. Indicates whether GNU Info
- files, used for the documentation for most of the compilation
- tools, will be created and installed during a build.
-
- Default: ``yes''
-
- MKLINT Can be set to ``yes'' or ``no''. Indicates whether lint(1)
- will be run against portions of the NetBSD source code during
- the build, and whether lint libraries will be installed into
- DESTDIR/usr/libdata/lint.
-
- Default: ``yes''
-
- MKMAN Can be set to ``yes'' or ``no''. Indicates whether manual
- pages will be installed during a build.
-
- Default: ``yes''
-
- MKNLS Can be set to ``yes'' or ``no''. Indicates whether Native
- Language System locale zone files will be compiled and
- installed during a build.
-
- Default: ``yes''
-
- MKOBJ Can be set to ``yes'' or ``no''. Indicates whether object
- directories will be created when running ``make obj''. If
- set to ``no'', then all built files will be located inside
- the regular source tree.
-
- Default: ``yes''
-
- Note that setting MKOBJ to ``no'' is not recommended and may
- cause problems when updating the tree with cvs(1).
-
- MKPIC Can be set to ``yes'' or ``no''. Indicates whether shared
- objects and libraries will be created and installed during a
- build. If set to ``no'', the entire built system will be
- statically linked.
-
- Default: Platform dependent. As of this writing, all plat-
- forms except sh3 default to ``yes''.
-
- MKPICINSTALL
- Can be set to ``yes'' or ``no''. Indicates whether the ar(1)
- format libraries (lib*_pic.a), used to generate shared
- libraries, are installed during a build.
-
- Default: ``yes''
-
- MKPROFILE Can be set to ``yes'' or ``no''. Indicates whether profiled
- libraries (lib*_p.a) will be built and installed during a
- build.
-
- Default: ``yes''; however, some platforms turn off MKPROFILE
- by default at times due to toolchain problems with profiled
- code.
-
- MKSHARE Can be set to ``yes'' or ``no''. Indicates whether files
- destined to reside in DESTDIR/usr/share will be built and
- installed during a build. If set to ``no'', then all of
- MKCATPAGES, MKDOC, MKINFO, MKMAN, and MKNLS will be set to
- ``no'' unconditionally.
-
- Default: ``yes''
-
- MKSTRIPIDENT
- Can be set to ``yes'' or ``no''. Indicates whether program
- binaries and shared libraries should be built to include RCS
- IDs for use with ident(1).
-
- Default: ``no''
-
- MKUNPRIVED Can be set to ``yes'' or ``no''. Indicates whether an
- unprivileged install will occur. The user, group, permis-
- sions, and file flags, will not be set on the installed
- items; instead the information will be appended to a file
- called METALOG in DESTDIR. The contents of METALOG are used
- during the generation of the distribution tar files to ensure
- that the appropriate file ownership is stored.
-
- Default: ``no''
-
- MKUPDATE Can be set to ``yes'' or ``no''. Indicates whether all
- install operations intended to write to DESTDIR will compare
- file timestamps before installing, and skip the install phase
- if the destination files are up-to-date. This also has
- implications on full builds (see next subsection).
-
- Default: ``no''
-
- MKX11 Can be set to ``yes'' or ``no''. Indicates whether X11 is
- built from X11SRCDIR.
-
- Default: ``no''
-
- TOOLDIR Directory to hold the host tools, once built. If specified,
- must be an absolute path. This directory should be unique to
- a given host system and NetBSD source tree. (However, multi-
- ple targets may share the same TOOLDIR; the target-dependent
- files have unique names.) If unset, a default based on the
- uname(1) information of the host platform will be created in
- the .OBJDIR of src.
-
- Default: Unset.
-
- USETOOLS Indicates whether the tools specified by TOOLDIR should be
- used as part of a build in progress. Must be set to ``yes''
- if cross-compiling.
-
- yes Use the tools from TOOLDIR.
-
- no Do not use the tools from TOOLDIR, but refuse to build
- native compilation tool components that are version-
- specific for that tool.
-
- never Do not use the tools from TOOLDIR, even when building
- native tool components. This is similar to the tradi-
- tional NetBSD build method, but does not verify that
- the compilation tools in use are up-to-date enough in
- order to build the tree successfully. This may cause
- build or runtime problems when building the whole
- NetBSD source tree.
-
- Default: ``yes'', unless TOOLCHAIN_MISSING is set to ``yes''.
-
- USETOOLS is also set to ``no'' when using <bsd.*.mk> outside
- the NetBSD source tree.
-
- X11SRCDIR Directory containing the X11R6 source. If specified, must be
- an absolute path. The main X11R6 source is found in
- X11SRCDIR/xfree/xc.
-
- Default: NETBSDRCDIR/../xsrc, if that exists; otherwise
- /usr/xsrc.
-
- X11FLAVOUR The style of X11 cross-built, set to either ``Xorg'' or
- ``XFree86''.
-
- Default: ``Xorg'' on amd64, i386, macppc, shark and sparc64
- platforms, ``XFree86'' on everything else.
-
- "make" variables for full builds
- These variables only affect the top level ``Makefile'' and do not affect
- manually building subtrees of the NetBSD source code.
-
- INSTALLWORLDDIR Location for the ``make installworld'' target to install
- to. If specified, must be an absolute path.
-
- Default: ``/''
-
- MKOBJDIRS Can be set to ``yes'' or ``no''. Indicates whether
- object directories will be created automatically (via a
- ``make obj'' pass) at the start of a build.
-
- Default: ``no''
-
- If using build.sh, the default is ``yes''. This may be
- set back to ``no'' by giving build.sh the -o option.
-
- MKUPDATE Can be set to ``yes'' or ``no''. If set, then in addi-
- tion to the effects described for MKUPDATE=yes above,
- this implies the effects of NOCLEANDIR (i.e., ``make
- cleandir'' is avoided).
-
- Default: ``no''
-
- If using build.sh, this may be set by giving the -u
- option.
-
- NBUILDJOBS Now obsolete. Use the make(1) option -j, instead. See
- below.
-
- Default: Unset.
-
- NOCLEANDIR If set, avoids the ``make cleandir'' phase of a full
- build. This has the effect of allowing only changed
- files in a source tree to be recompiled. This can speed
- up builds when updating only a few files in the tree.
-
- Default: Unset.
-
- See also MKUPDATE.
-
- NODISTRIBDIRS If set, avoids the ``make distrib-dirs'' phase of a full
- build. This skips running mtree(8) on DESTDIR, useful
- on systems where building as an unprivileged user, or
- where it is known that the system-wide mtree files have
- not changed.
-
- Default: Unset.
-
- NOINCLUDES If set, avoids the ``make includes'' phase of a full
- build. This has the effect of preventing make(1) from
- thinking that some programs are out-of-date simply
- because the system include files have changed. However,
- this option should not be used when updating the entire
- NetBSD source tree arbitrarily; it is suggested to use
- MKUPDATE=yes instead in that case.
-
- Default: Unset.
-
- RELEASEDIR If set, specifies the directory to which a release(7)
- layout will be written at the end of a ``make release''.
- If specified, must be an absolute path.
-
- Default: Unset.
-
- Note: build.sh will provide a default of releasedir (in
- the top-level .OBJDIR) unless run in `expert' mode.
-
-BUILDING
- "make" command line options
- This is not a summary of all the options available to make(1); only the
- options used most frequently with NetBSD builds are listed here.
-
- -j njob Run up to njob make(1) subjobs in parallel. Makefiles should
- use .WAIT or have explicit dependencies as necessary to
- enforce build ordering.
-
- -m dir Specify the default directory for searching for system Make-
- file segments, mainly the <bsd.*.mk> files. When building any
- full NetBSD source tree, this should be set to the
- ``share/mk'' directory in the source tree. This is set auto-
- matically when building from the top level, or when using
- build.sh.
-
- -n Display the commands that would have been executed, but do not
- actually execute them. This will still cause recursion to
- take place.
-
- -V var Print make(1)'s idea of the value of var. Does not build any
- targets.
-
- var=value Set the variable var to value, overriding any setting speci-
- fied by the process environment, the MAKECONF configuration
- file, or the system Makefile segments.
-
- "make" targets
- These default targets may be built by running make(1) in any subtree of
- the NetBSD source code. It is recommended that none of these be used
- from the top level Makefile; as a specific exception, ``make obj'' and
- ``make cleandir'' are useful in that context.
-
- all Build programs, libraries, and preformatted documentation.
-
- clean Remove program and library object code files.
-
- cleandir Same as clean, but also remove preformatted documentation,
- dependency files generated by ``make depend'', and any other
- files known to be created at build time.
-
- depend Create dependency files (.depend) containing more detailed
- information about the dependencies of source code on header
- files. Allows programs to be recompiled automatically when a
- dependency changes.
-
- dependall Does a ``make depend'' immediately followed by a ``make all''.
- This improves cache locality of the build since both passes
- read the source files in their entirety.
-
- distclean Synonym for cleandir.
-
- includes Build and install system header files. Typically needed
- before any system libraries or programs can be built.
-
- install Install programs, libraries, and documentation into DESTDIR.
- Few files will be installed to DESTDIR/dev, DESTDIR/etc,
- DESTDIR/root or DESTDIR/var in order to prevent user supplied
- configuration data from being overwritten.
-
- lint Run lint(1) against the C source code, where appropriate, and
- generate system-installed lint libraries.
-
- obj Create object directories to be used for built files, instead
- of building directly in the source tree.
-
- tags Create ctags(1) searchable function lists usable by the ex(1)
- and vi(1) text editors.
-
- "make" targets for the top level
- Additional make(1) targets are usable specifically from the top source
- level to facilitate building the entire NetBSD source tree.
-
- build Build the entire NetBSD system (except the kernel). This
- orders portions of the source tree such that prerequisites
- will be built in the proper order.
-
- distribution Do a ``make build'', and then install a full distribution
- (which does not include a kernel) into DESTDIR, including
- files in DESTDIR/dev, DESTDIR/etc, DESTDIR/root and
- DESTDIR/var.
-
- buildworld As per ``make distribution'', except that it ensures that
- DESTDIR is not the root directory.
-
- installworld Install the distribution from DESTDIR to INSTALLWORLDDIR,
- which defaults to the root directory. Ensures that
- INSTALLWORLDDIR is not the root directory if cross compil-
- ing.
-
- The INSTALLSETS environment variable may be set to a list
- of distribution sets to be installed. By default, all sets
- except ``etc'' and ``xetc'' are installed, so most files in
- INSTALLWORLDDIR/etc will not be installed or modified.
-
- Note: Before performing this operation with
- INSTALLWORLDDIR=/, it is highly recommended that you
- upgrade your kernel and reboot. After performing this
- operation, it is recommended that you use etcupdate(8) to
- update files in INSTALLWORLDDIR/etc and that you use
- postinstall(8) to check for inconsistencies (and possibly
- to fix them).
-
- sets Create distribution sets from DESTDIR into
- RELEASEDIR/RELEASEMACHINEDIR/binary/sets. Should be run
- after ``make distribution'', as ``make build'' alone does
- not install all of the required files.
-
- sourcesets Create source sets of the source tree into
- RELEASEDIR/source/sets.
-
- syspkgs Create syspkgs from DESTDIR into
- RELEASEDIR/RELEASEMACHINEDIR/binary/syspkgs. Should be run
- after ``make distribution'', as ``make build'' alone does
- not install all of the required files.
-
- release Do a ``make distribution'', build kernels, distribution
- media, and install sets (this as per ``make sets''), and
- then package the system into a standard release layout as
- described by release(7). This requires that RELEASEDIR be
- set (see above).
-
- iso-image Create a NetBSD installation CD-ROM image in the
- RELEASEDIR/iso directory. The CD-ROM file system will have
- a layout as described in release(7).
-
- For most machine types, the CD-ROM will be bootable, and
- will automatically run the sysinst(8) menu-based installa-
- tion program, which can be used to install or upgrade a
- NetBSD system. Bootable CD-ROMs also contain tools that
- may be useful in repairing a damaged NetBSD installation.
-
- Before ``make iso-image'' is attempted, RELEASEDIR must be
- populated by ``make release'' or equivalent.
-
- Note that other, smaller, CD-ROM images may be created in
- the RELEASEDIR/RELEASEMACHINEDIR/installation/cdrom direc-
- tory by ``make release''. These smaller images usually
- contain the same tools as the larger images in
- RELEASEDIR/iso, but do not contain additional content such
- as the distribution sets.
-
- Note that the mac68k port still uses an older method of
- creating CD-ROM images. This requires the mkisofs(1) util-
- ity, which is not part of NetBSD, but which can be
- installed from pkgsrc/sysutils/cdrtools.
-
- iso-image-source
- Create a NetBSD installation CD-ROM image in the
- RELEASEDIR/iso directory. The CD-ROM file system will have
- a layout as described in release(7). It will have top
- level directories for the machine type and source.
-
- For most machine types, the CD-ROM will be bootable, and
- will automatically run the sysinst(8) menu-based installa-
- tion program, which can be used to install or upgrade a
- NetBSD system. Bootable CD-ROMs also contain tools that
- may be useful in repairing a damaged NetBSD installation.
-
- Before ``make iso-image-source'' is attempted, RELEASEDIR
- must be populated by ``make sourcesets release'' or equiva-
- lent.
-
- Note that other, smaller, CD-ROM images may be created in
- the RELEASEDIR/RELEASEMACHINEDIR/installation/cdrom direc-
- tory by ``make release''. These smaller images usually
- contain the same tools as the larger images in
- RELEASEDIR/iso, but do not contain additional content such
- as the distribution sets.
-
- Note that the mac68k port still uses an older method of
- creating CD-ROM images. This requires the mkisofs(1) util-
- ity, which is not part of NetBSD, but which can be
- installed from pkgsrc/sysutils/cdrtools.
-
- regression-tests
- Can only be run after building the regression tests in the
- directory ``regress''. Runs those compiled regression
- tests on the local host. Note that most tests are now man-
- aged instead using atf(7); this target should probably run
- those as well but currently does not.
-
- The "build.sh" script
- This script file is a Bourne shell script designed to build the entire
- NetBSD system on any host with a Bourne shell in /bin/sh, including many
- that are not POSIX compliant. Note that if a host system's /bin/sh is
- unusually old and broken, the Korn Shell (/bin/ksh), if available, may be
- a usable alternative.
-
- All cross-compile builds, and most native builds, of the entire system
- should make use of build.sh rather than just running ``make''. This way,
- the make(1) program will be bootstrapped properly, in case the host sys-
- tem has an older or incompatible ``make'' program.
-
- When compiling the entire system via build.sh, many make(1) variables are
- set for you in order to help encapsulate the build process. In the list
- of options below, variables that are automatically set by build.sh are
- noted where applicable.
-
- The following operations are supported by build.sh:
-
- build Build the system as per ``make build''. Before the main
- part of the build commences, this command runs the obj
- operation (unless the -o option is given), ``make
- cleandir'' (unless the -u option is given), and the tools
- operation.
-
- distribution Build a full distribution as per ``make distribution''.
- This command first runs the build operation.
-
- release Build a full release as per ``make release''. This command
- first runs the distribution operation.
-
- makewrapper Create the nbmake-MACHINE wrapper. This operation is auto-
- matically performed for any of the other operations.
-
- cleandir Perform ``make cleandir''.
-
- obj Perform ``make obj''.
-
- tools Build and install the host tools from src/tools. This com-
- mand will first run ``make obj'' and ``make cleandir'' in
- the tools subdirectory unless the -o or -u options (respec-
- tively) are given.
-
- install=idir Install the contents of DESTDIR to idir, using ``make
- installworld''. Note that files that are part of the
- ``etc'' or ``xetc'' sets will not be installed.
-
- kernel=kconf Build a new kernel. The kconf argument is the name of a
- configuration file suitable for use by config(1). If kconf
- does not contain any `/' characters, the configuration file
- is expected to be found in the KERNCONFDIR directory, which
- is typically sys/arch/MACHINE/conf. The new kernel will be
- built in a subdirectory of KERNOBJDIR, which is typically
- sys/arch/MACHINE/compile or an associated object directory.
-
- This command does not imply the tools command; run the
- tools command first unless it is certain that the tools
- already exist and are up to date.
-
- This command will run ``make cleandir'' on the kernel in
- question first unless the -u option is given.
-
- modules This command will build kernel modules and install them
- into DESTDIR.
-
- releasekernel=kconf
- Install a gzip(1)ed copy of the kernel previously built by
- kernel=kconf into
- RELEASEDIR/RELEASEMACHINEDIR/binary/kernel, usually as
- netbsd-kconf.gz, although the ``netbsd'' prefix is deter-
- mined from the ``config'' directives in kconf.
-
- sets Perform ``make sets''.
-
- sourcesets Perform ``make sourcesets''.
-
- syspkgs Perform ``make syspkgs''.
-
- iso-image Perform ``make iso-image''.
-
- iso-image-source
- Perform ``make iso-image-source''.
-
- The following command line options alter the behaviour of the build.sh
- operations described above:
-
- -a arch Set the value of MACHINE_ARCH to arch.
-
- -B buildid
- Set the value of BUILDID to buildid. This will also append the
- build identifier to the name of the ``make'' wrapper script so
- that the resulting name is of the form
- ``nbmake-MACHINE-BUILDID''.
-
- -C cdextras
- Append cdextras to the CDEXTRA variable, which is a space-sepa-
- rated list of files or directories that will be added to the
- CD-ROM image that may be create by the ``iso-image'' or
- ``iso-image-source'' operations. Files will be added to the
- root of the CD-ROM image, whereas directories will be copied
- recursively. If relative paths are specified, they will be
- converted to absolute paths before being used. Multiple paths
- may be specified via multiple -C options, or via a single
- option whose argument contains multiple space-separated paths.
-
- -D dest Set the value of DESTDIR to dest. If a relative path is speci-
- fied, it will be converted to an absolute path before being
- used.
-
- -E Set `expert' mode. This overrides various sanity checks, and
- allows: DESTDIR does not have to be set to a non-root path for
- builds, and MKUNPRIVED=yes does not have to be set when build-
- ing as a non-root user.
-
- Note: It is highly recommended that you know what you are doing
- when you use this option.
-
- -h Print a help message.
-
- -j njob Run up to njob make(1) subjobs in parallel; passed through to
- make(1). If you see failures for reasons other than running
- out of memory while using build.sh with -j, please save com-
- plete build logs so the failures can be analyzed.
-
- To achieve the fastest builds, -j values between (1 + the num-
- ber of CPUs) and (2 * the number of CPUs) are recommended. Use
- lower values on machines with limited memory or I/O bandwidth.
-
- -M obj Set MAKEOBJDIRPREFIX to obj. Unsets MAKEOBJDIR. See ``-O
- -obj'' for more information.
-
- For instance, if the source directory is /usr/src, a setting of
- ``-M /usr/obj'' will place build-time files under
- /usr/obj/usr/src/bin, /usr/obj/usr/src/lib,
- /usr/obj/usr/src/usr.bin, and so forth.
-
- If a relative path is specified, it will be converted to an
- absolute path before being used. build.sh imposes the restric-
- tion that the argument to the -M option must not begin with a
- ``$'' (dollar sign) character; otherwise it would be too diffi-
- cult to determine whether the value is an absolute or a rela-
- tive path. If the directory does not already exist, build.sh
- will create it.
-
- -m mach Set the value of MACHINE to mach, except in some special cases
- listed below. This will also override any value of
- MACHINE_ARCH in the process environment with a value deduced
- from mach, unless -a is specified. All cross builds require
- -m, but if unset on a NetBSD host, the host's value of MACHINE
- will be detected and used automatically.
-
- Some machines support multiple values for MACHINE_ARCH. The
- following special cases for the mach argument are defined to
- set the listed values of MACHINE and MACHINE_ARCH:
-
- mach MACHINE MACHINE_ARCH
- evbarm evbarm (not set)
- evbarm-eb evbarm armeb
- evbarm-el evbarm arm
- evbmips evbmips (not set)
- evbmips-eb evbmips mipseb
- evbmips-el evbmips mipsel
- evbsh3 evbsh3 (not set)
- evbsh3-eb evbsh3 sh3eb
- evbsh3-el evbsh3 sh3el
- sbmips sbmips (not set)
- sbmips-eb sbmips mipseb
- sbmips-el sbmips mipsel
-
- -N noiselevel
- Set the ``noisyness'' level of the build, by setting
- MAKEVERBOSE to noiselevel.
-
- -n Show the commands that would be executed by build.sh, but do
- not make any changes. This is similar in concept to ``make
- -n''.
-
- -O obj Create an appropriate transform macro for MAKEOBJDIR that will
- place the built object files under obj. Unsets
- MAKEOBJDIRPREFIX.
-
- For instance, a setting of ``-O /usr/obj'' will place build-
- time files under /usr/obj/bin, /usr/obj/lib, /usr/obj/usr.bin,
- and so forth.
-
- If a relative path is specified, it will be converted to an
- absolute path before being used. build.sh imposes the restric-
- tion that the argument to the -O option must not contain a
- ``$'' (dollar sign) character. If the directory does not
- already exist, build.sh will create it.
-
- In normal use, exactly one of the -M or -O options should be
- specified. If neither -M nor -O is specified, then a default
- object directory will be chosen according to rules in
- <bsd.obj.mk>. Relying on this default is not recommended
- because it is determined by complex rules that are influenced
- by the values of several variables and by the location of the
- source directory.
-
- -o Set the value of MKOBJDIRS to ``no''. Otherwise, it will be
- automatically set to ``yes''. This default is opposite to the
- behaviour when not using build.sh.
-
- -R rel Set the value of RELEASEDIR to rel. If a relative path is
- specified, it will be converted to an absolute path before
- being used.
-
- -r Remove the contents of DESTDIR and TOOLDIR before building
- (provides a clean starting point). This will skip deleting
- DESTDIR if building on a native system to the root directory.
-
- -S seed Change the value of BUILDSEED to seed. This should rarely be
- necessary.
-
- -T tools Set the value of TOOLDIR to tools. If a relative path is spec-
- ified, it will be converted to an absolute path before being
- used. If set, the bootstrap ``make'' will only be rebuilt if
- the source files for make(1) have changed.
-
- -U Set MKUNPRIVED=yes.
-
- -u Set MKUPDATE=yes.
-
- -V var=[value]
- Set the environment variable var to an optional value. This is
- propagated to the nbmake wrapper.
-
- -w wrapper
- Create the nbmake wrapper script (see below) in a custom loca-
- tion, specified by wrapper. This allows, for instance, to
- place the wrapper in PATH automatically. Note that wrapper is
- the full name of the file, not just a directory name. If a
- relative path is specified, it will be converted to an absolute
- path before being used.
-
- -X x11src
- Set the value of X11SRCDIR to x11src. If a relative path is
- specified, it will be converted to an absolute path before
- being used.
-
- -x Set MKX11=yes.
-
- -Z var Unset ("zap") the environment variable var. This is propagated
- to the nbmake wrapper.
-
- The "nbmake-MACHINE" wrapper script
- If using the build.sh script to build NetBSD, a nbmake-MACHINE script
- will be created in TOOLDIR/bin upon the first build to assist in building
- subtrees on a cross-compile host.
-
- nbmake-MACHINE can be invoked in lieu of make(1), and will instead call
- the up-to-date version of ``nbmake'' installed into TOOLDIR/bin with sev-
- eral key variables pre-set, including MACHINE, MACHINE_ARCH, and TOOLDIR.
- nbmake-MACHINE will also set variables specified with -V, and unset vari-
- ables specified with -Z.
-
- This script can be symlinked into a directory listed in PATH, or called
- with an absolute path.
-
-EXAMPLES
- 1. % ./build.sh [options] tools kernel=GENERIC
-
- Build a new toolchain, and use the new toolchain to configure and
- build a new GENERIC kernel.
-
- 2. % ./build.sh [options] -U distribution
-
- Using unprivileged mode, build a complete distribution to a DESTDIR
- directory that build.sh selects (and will display).
-
- 3. # ./build.sh [options] -U install=/
-
- As root, install to / the distribution that was built by example 2.
- Even though this is run as root, -U is required so that the permis-
- sions stored in DESTDIR/METALOG are correctly applied to the files
- as they're copied to /.
-
- 4. % ./build.sh [options] -U -u release
-
- Using unprivileged mode, build a complete release to DESTDIR and
- RELEASEDIR directories that build.sh selects (and will display).
- MKUPDATE=yes (-u) is set to prevent the ``make cleandir'', so that
- if this is run after example 2, it doesn't need to redo that portion
- of the release build.
-
-OBSOLETE VARIABLES
- NBUILDJOBS Use the make(1) option -j instead.
-
- USE_NEW_TOOLCHAIN
- The new toolchain is now the default. To disable, use
- TOOLCHAIN_MISSING=yes.
-
-SEE ALSO
- make(1), hier(7), release(7), etcupdate(8), postinstall(8), sysinst(8),
- pkgsrc/sysutils/cdrtools
-
-HISTORY
- The build.sh based build scheme was introduced for NetBSD 1.6 as
- USE_NEW_TOOLCHAIN, and re-worked to TOOLCHAIN_MISSING after that.
-
-NetBSD May 1, 2009 NetBSD
View
544 Makefile
@@ -1,544 +0,0 @@
-# $NetBSD: Makefile,v 1.281 2010/12/03 21:38:46 plunky Exp $
-
-#
-# This is the top-level makefile for building NetBSD. For an outline of
-# how to build a snapshot or release, as well as other release engineering
-# information, see http://www.NetBSD.org/developers/releng/index.html
-#
-# Not everything you can set or do is documented in this makefile. In
-# particular, you should review the files in /usr/share/mk (especially
-# bsd.README) for general information on building programs and writing
-# Makefiles within this structure, and see the comments in src/etc/Makefile
-# for further information on installation and release set options.
-#
-# Variables listed below can be set on the make command line (highest
-# priority), in /etc/mk.conf (middle priority), or in the environment
-# (lowest priority).
-#
-# Variables:
-# DESTDIR is the target directory for installation of the compiled
-# software. It defaults to /. Note that programs are built against
-# libraries installed in DESTDIR.
-# MKMAN, if `no', will prevent building of manual pages.
-# MKOBJDIRS, if not `no', will build object directories at
-# an appropriate point in a build.
-# MKSHARE, if `no', will prevent building and installing
-# anything in /usr/share.
-# MKUPDATE, if not `no', will avoid a `make cleandir' at the start of
-# `make build', as well as having the effects listed in
-# /usr/share/mk/bsd.README.
-# NOCLEANDIR, if defined, will avoid a `make cleandir' at the start
-# of the `make build'.
-# NOINCLUDES will avoid the `make includes' usually done by `make build'.
-#
-# See mk.conf(5) for more details.
-#
-#
-# Targets:
-# build:
-# Builds a full release of NetBSD in DESTDIR, except for the
-# /etc configuration files.
-# If BUILD_DONE is set, this is an empty target.
-# distribution:
-# Builds a full release of NetBSD in DESTDIR, including the /etc
-# configuration files.
-# buildworld:
-# As per `make distribution', except that it ensures that DESTDIR
-# is not the root directory.
-# installworld:
-# Install the distribution from DESTDIR to INSTALLWORLDDIR (which
-# defaults to the root directory). Ensures that INSTALLWORLDDIR
-# is the not root directory if cross compiling.
-# release:
-# Does a `make distribution', and then tars up the DESTDIR files
-# into ${RELEASEDIR}/${RELEASEMACHINEDIR}, in release(7) format.
-# (See etc/Makefile for more information on this.)
-# regression-tests:
-# Runs the regression tests in "regress" on this host.
-# sets:
-# Populate ${RELEASEDIR}/${RELEASEMACHINEDIR}/binary/sets
-# from ${DESTDIR}
-# sourcesets:
-# Populate ${RELEASEDIR}/source/sets from ${NETBSDSRCDIR}
-# syspkgs:
-# Populate ${RELEASEDIR}/${RELEASEMACHINEDIR}/binary/syspkgs
-# from ${DESTDIR}
-# iso-image:
-# Create CD-ROM image in RELEASEDIR/iso.
-# RELEASEDIR must already have been populated by `make release'
-# or equivalent.
-# iso-image-source:
-# Create CD-ROM image with source in RELEASEDIR/iso.
-# RELEASEDIR must already have been populated by
-# `make release sourcesets' or equivalent.
-#
-# Targets invoked by `make build,' in order:
-# cleandir: cleans the tree.
-# do-top-obj: creates the top level object directory.
-# do-tools-obj: creates object directories for the host toolchain.
-# do-tools: builds host toolchain.
-# obj: creates object directories.
-# do-distrib-dirs: creates the distribution directories.
-# includes: installs include files.
-# do-tools-compat: builds the "libnbcompat" library; needed for some
-# random host tool programs in the source tree.
-# do-lib-csu: builds and installs prerequisites from lib/csu.
-# do-libgcc: builds and installs prerequisites from
-# gnu/lib/crtstuff${LIBGCC_EXT} (if necessary) and
-# gnu/lib/libgcc${LIBGCC_EXT}.
-# do-libpcc: builds and install prerequisites from
-# external/bsd/pcc/crtstuff (if necessary) and
-# external/bsd/pcc/libpcc.
-# do-lib-libc: builds and installs prerequisites from lib/libc.
-# do-lib: builds and installs prerequisites from lib.
-# do-sys-rump-dev-lib: builds and installs prerequisites from sys/rump/dev/lib
-# do-sys-rump-fs-lib: builds and installs prerequisites from sys/rump/fs/lib
-# do-sys-rump-kern-lib: builds and installs prereq. from sys/rump/kern/lib
-# do-sys-rump-net-lib: builds and installs prerequisites from sys/rump/net/lib
-# do-sys-modules: builds and installs kernel modules (used by rump binaries)
-# do-ld.so: builds and installs prerequisites from libexec/ld.*_so.
-# do-compat-lib-csu: builds and installs prerequisites from compat/lib/csu
-# if ${MKCOMPAT} != "no".
-# do-compat-libgcc: builds and installs prerequisites from
-# compat/gnu/lib/crtstuff${LIBGCC_EXT} (if necessary) and
-# compat/gnu/lib/libgcc${LIBGCC_EXT} if ${MKCOMPAT} != "no".
-# do-compat-lib-libc: builds and installs prerequisites from compat/lib/libc
-# if ${MKCOMPAT} != "no".
-# do-build: builds and installs the entire system.
-# do-x11: builds and installs X11 if ${MKX11} != "no"; either
-# X11R7 from src/external/mit/xorg if ${X11FLAVOUR} == "Xorg"
-# or X11R6 from src/x11
-# do-extsrc: builds and installs extsrc if ${MKEXTSRC} != "no".
-# do-obsolete: installs the obsolete sets (for the postinstall-* targets).
-#
-
-.if ${.MAKEFLAGS:M${.CURDIR}/share/mk} == ""
-.MAKEFLAGS: -m ${.CURDIR}/share/mk
-.endif
-
-#
-# If _SRC_TOP_OBJ_ gets set here, we will end up with a directory that may
-# not be the top level objdir, because "make obj" can happen in the *middle*
-# of "make build" (long after <bsd.own.mk> is calculated it). So, pre-set
-# _SRC_TOP_OBJ_ here so it will not be added to ${.MAKEOVERRIDES}.
-#
-_SRC_TOP_OBJ_=
-
-.include <bsd.own.mk>
-
-#
-# Sanity check: make sure that "make build" is not invoked simultaneously
-# with a standard recursive target.
-#
-
-.if make(build) || make(release) || make(snapshot)
-.for targ in ${TARGETS:Nobj:Ncleandir}
-.if make(${targ}) && !target(.BEGIN)
-.BEGIN:
- @echo 'BUILD ABORTED: "make build" and "make ${targ}" are mutually exclusive.'
- @false
-.endif
-.endfor
-.endif
-
-#
-# _SUBDIR is used to set SUBDIR, after removing directories that have
-# BUILD_${dir}=no, or that have no ${dir}/Makefile.
-#
-_SUBDIR= tools lib include gnu external crypto/external bin games
-_SUBDIR+= libexec sbin usr.bin
-_SUBDIR+= usr.sbin share rescue sys etc tests compat .WAIT distrib regress
-
-.for dir in ${_SUBDIR}
-.if "${dir}" == ".WAIT" \
- || (${BUILD_${dir}:Uyes} != "no" && exists(${dir}/Makefile))
-SUBDIR+= ${dir}
-.endif
-.endfor
-
-.if exists(regress)
-regression-tests: .PHONY .MAKE
- @echo Running regression tests...
- ${MAKEDIRTARGET} regress regress
-.endif
-
-.if ${MKUNPRIVED} != "no"
-NOPOSTINSTALL= # defined
-.endif
-
-afterinstall: .PHONY .MAKE
-.if ${MKMAN} != "no"
- ${MAKEDIRTARGET} share/man makedb
-.endif
-.if (${MKUNPRIVED} != "no" && ${MKINFO} != "no")
- ${MAKEDIRTARGET} gnu/usr.bin/texinfo/install-info infodir-meta
-.endif
-.if !defined(NOPOSTINSTALL)
- ${MAKEDIRTARGET} . postinstall-check
-.endif
-
-_POSTINSTALL= ${.CURDIR}/usr.sbin/postinstall/postinstall
-
-postinstall-check: .PHONY
- @echo " === Post installation checks ==="
- AWK=${TOOL_AWK:Q} MAKE=${MAKE:Q} ${HOST_SH} ${_POSTINSTALL} -s ${.CURDIR} -d ${DESTDIR}/ check; if [ $$? -gt 1 ]; then exit 1; fi
- @echo " ================================"
-
-postinstall-fix: .NOTMAIN .PHONY
- @echo " === Post installation fixes ==="
- AWK=${TOOL_AWK:Q} MAKE=${MAKE:Q} ${HOST_SH} ${_POSTINSTALL} -s ${.CURDIR} -d ${DESTDIR}/ fix
- @echo " ==============================="
-
-postinstall-fix-obsolete: .NOTMAIN .PHONY
- @echo " === Removing obsolete files ==="
- AWK=${TOOL_AWK:Q} MAKE=${MAKE:Q} ${HOST_SH} ${_POSTINSTALL} -s ${.CURDIR} -d ${DESTDIR}/ fix obsolete
- @echo " ==============================="
-
-
-#
-# Targets (in order!) called by "make build".
-#
-.if defined(HAVE_GCC)
-.if ${HAVE_GCC} == "3"
-LIBGCC_EXT=3
-.else
-LIBGCC_EXT=4
-.endif
-.endif
-
-BUILDTARGETS+= check-tools
-.if ${MKUPDATE} == "no" && !defined(NOCLEANDIR)
-BUILDTARGETS+= cleandir
-.endif
-.if ${MKOBJDIRS} != "no"
-BUILDTARGETS+= do-top-obj
-.endif
-.if ${USETOOLS} == "yes" # {
-.if ${MKOBJDIRS} != "no"
-BUILDTARGETS+= do-tools-obj
-.endif
-BUILDTARGETS+= do-tools
-.endif # USETOOLS # }
-.if ${MKOBJDIRS} != "no"
-BUILDTARGETS+= obj
-.endif
-BUILDTARGETS+= clean_METALOG
-.if !defined(NODISTRIBDIRS)
-BUILDTARGETS+= do-distrib-dirs
-.endif
-.if !defined(NOINCLUDES)
-BUILDTARGETS+= includes
-.endif
-BUILDTARGETS+= do-tools-compat
-BUILDTARGETS+= do-lib-csu
-.if ${MKGCC} != "no"
-BUILDTARGETS+= do-libgcc
-.endif
-.if ${MKPCC} != "no"
-BUILDTARGET+= do-libpcc
-.endif
-BUILDTARGETS+= do-lib-libc
-BUILDTARGETS+= do-lib
-.if (${MACHINE} != "evbppc") && ${MKKMOD} != "no"
-BUILDTARGETS+= do-sys-modules
-.endif
-BUILDTARGETS+= do-sys-rump-dev-lib do-sys-rump-fs-lib
-BUILDTARGETS+= do-sys-rump-kern-lib do-sys-rump-net-lib
-.if ${MKCOMPAT} != "no"
-BUILDTARGETS+= do-compat-lib-csu
-BUILDTARGETS+= do-compat-libgcc
-BUILDTARGETS+= do-compat-lib-libc
-.endif
-BUILDTARGETS+= do-ld.so
-BUILDTARGETS+= do-build
-.if ${MKX11} != "no"
-BUILDTARGETS+= do-x11
-.endif
-.if ${MKEXTSRC} != "no"
-BUILDTARGETS+= do-extsrc
-.endif
-BUILDTARGETS+= do-obsolete
-
-#
-# Enforce proper ordering of some rules.
-#
-
-.ORDER: ${BUILDTARGETS}
-includes-lib: .PHONY includes-include includes-sys
-includes-gnu: .PHONY includes-lib
-
-#
-# Build the system and install into DESTDIR.
-#
-
-START_TIME!= date
-
-build: .PHONY .MAKE
-.if defined(BUILD_DONE)
- @echo "Build already installed into ${DESTDIR}"
-.else
- @echo "Build started at: ${START_TIME}"
-.for tgt in ${BUILDTARGETS}
- ${MAKEDIRTARGET} . ${tgt}
-.endfor
- ${MAKEDIRTARGET} etc install-etc-release
- @echo "Build started at: ${START_TIME}"
- @printf "Build finished at: " && date
-.endif
-
-#
-# Build a full distribution, but not a release (i.e. no sets into
-# ${RELEASEDIR}). "buildworld" enforces a build to ${DESTDIR} != /
-#
-
-distribution buildworld: .PHONY .MAKE
-.if make(buildworld) && \
- (!defined(DESTDIR) || ${DESTDIR} == "" || ${DESTDIR} == "/")
- @echo "Won't make ${.TARGET} with DESTDIR=/"
- @false
-.endif
- ${MAKEDIRTARGET} . build NOPOSTINSTALL=1
- ${MAKEDIRTARGET} etc distribution INSTALL_DONE=1
-.if defined(DESTDIR) && ${DESTDIR} != "" && ${DESTDIR} != "/"
- ${MAKEDIRTARGET} . postinstall-fix-obsolete
- ${MAKEDIRTARGET} distrib/sets checkflist
-.endif
- @echo "make ${.TARGET} started at: ${START_TIME}"
- @printf "make ${.TARGET} finished at: " && date
-
-#
-# Install the distribution from $DESTDIR to $INSTALLWORLDDIR (defaults to `/')
-# If installing to /, ensures that the host's operating system is NetBSD and
-# the host's `uname -m` == ${MACHINE}.
-#
-
-HOST_UNAME_S!= uname -s
-HOST_UNAME_M!= uname -m
-
-installworld: .PHONY .MAKE
-.if (!defined(DESTDIR) || ${DESTDIR} == "" || ${DESTDIR} == "/")
- @echo "Can't make ${.TARGET} to DESTDIR=/"
- @false
-.endif
-.if !defined(INSTALLWORLDDIR) || \
- ${INSTALLWORLDDIR} == "" || ${INSTALLWORLDDIR} == "/"
-.if (${HOST_UNAME_S} != "NetBSD")
- @echo "Won't cross-make ${.TARGET} from ${HOST_UNAME_S} to NetBSD with INSTALLWORLDDIR=/"
- @false
-.endif
-.if (${HOST_UNAME_M} != ${MACHINE})
- @echo "Won't cross-make ${.TARGET} from ${HOST_UNAME_M} to ${MACHINE} with INSTALLWORLDDIR=/"
- @false
-.endif
-.endif
- ${MAKEDIRTARGET} distrib/sets installsets \
- INSTALLDIR=${INSTALLWORLDDIR:U/} INSTALLSETS=
- ${MAKEDIRTARGET} . postinstall-check DESTDIR=${INSTALLWORLDDIR}
- @echo "make ${.TARGET} started at: ${START_TIME}"
- @printf "make ${.TARGET} finished at: " && date
-
-#
-# Create sets from $DESTDIR or $NETBSDSRCDIR into $RELEASEDIR
-#
-
-.for tgt in sets sourcesets syspkgs
-${tgt}: .PHONY .MAKE
- ${MAKEDIRTARGET} distrib/sets ${tgt}
-.endfor
-
-#
-# Build a release or snapshot (implies "make distribution"). Note that
-# in this case, the set lists will be checked before the tar files
-# are made.
-#
-
-release snapshot: .PHONY .MAKE
- ${MAKEDIRTARGET} . distribution
- ${MAKEDIRTARGET} etc release DISTRIBUTION_DONE=1
- @echo "make ${.TARGET} started at: ${START_TIME}"
- @printf "make ${.TARGET} finished at: " && date
-
-#
-# Create a CD-ROM image.
-#
-
-iso-image: .PHONY
- ${MAKEDIRTARGET} distrib iso_image
- ${MAKEDIRTARGET} etc iso-image
- @echo "make ${.TARGET} started at: ${START_TIME}"
- @printf "make ${.TARGET} finished at: " && date
-
-iso-image-source: .PHONY
- ${MAKEDIRTARGET} distrib iso_image CDSOURCE=true
- ${MAKEDIRTARGET} etc iso-image
- @echo "make ${.TARGET} started at: ${START_TIME}"
- @printf "make ${.TARGET} finished at: " && date
-
-#
-# Special components of the "make build" process.
-#
-
-check-tools: .PHONY
-.if ${TOOLCHAIN_MISSING} != "no" && !defined(EXTERNAL_TOOLCHAIN)
- @echo '*** WARNING: Building on MACHINE=${MACHINE} with missing toolchain.'
- @echo '*** May result in a failed build or corrupt binaries!'
-.elif defined(EXTERNAL_TOOLCHAIN)
- @echo '*** Using external toolchain rooted at ${EXTERNAL_TOOLCHAIN}.'
-.endif
-.if defined(NBUILDJOBS)
- @echo '*** WARNING: NBUILDJOBS is obsolete; use -j directly instead!'
-.endif
-
-# Delete or sanitise a leftover METALOG from a previous build.
-clean_METALOG: .PHONY .MAKE
-.if ${MKUPDATE} != "no"
- ${MAKEDIRTARGET} distrib/sets clean_METALOG
-.endif
-
-do-distrib-dirs: .PHONY .MAKE
-.if !defined(DESTDIR) || ${DESTDIR} == ""
- ${MAKEDIRTARGET} etc distrib-dirs DESTDIR=/
-.else
- ${MAKEDIRTARGET} etc distrib-dirs DESTDIR=${DESTDIR}
-.endif
-
-.for targ in cleandir obj includes
-do-${targ}: .PHONY ${targ}
- @true
-.endfor
-
-.if defined(HAVE_GCC)
-.if ${USE_COMPILERCRTSTUFF} == "yes"
-BUILD_CC_LIB= gnu/lib/crtstuff${LIBGCC_EXT}
-.endif
-BUILD_CC_LIB+= gnu/lib/libgcc${LIBGCC_EXT}
-.elif defined(HAVE_PCC)
-BUILD_CC_LIB+= external/bsd/pcc/crtstuff
-BUILD_CC_LIB+= external/bsd/pcc/libpcc
-.endif
-
-.for dir in tools tools/compat lib/csu ${BUILD_CC_LIB} lib/libc lib sys/rump/dev/lib sys/rump/fs/lib sys/rump/kern/lib sys/rump/net/lib sys/modules
-do-${dir:S/\//-/g}: .PHONY .MAKE
-.for targ in dependall install
- ${MAKEDIRTARGET} ${dir} ${targ}
-.endfor
-.endfor
-
-.if ${MKCOMPAT} != "no"
-COMPAT_SUBDIR_LIST=lib/csu ${BUILD_CC_LIB} lib/libc
-.for dir in ${COMPAT_SUBDIR_LIST}
-do-compat-${dir:S/\//-/g}: .PHONY .MAKE
-.for targ in dependall install
- ${MAKEDIRTARGET} compat ${targ} BOOTSTRAP_SUBDIRS="../../../${dir}"
-.endfor
-.endfor
-.endif
-
-do-top-obj: .PHONY .MAKE
- ${MAKEDIRTARGET} . obj NOSUBDIR=
-
-do-tools-obj: .PHONY .MAKE
- ${MAKEDIRTARGET} tools obj
-
-do-libgcc: .PHONY .MAKE
-.if defined(HAVE_GCC)
-.if ${MKGCC} != "no"
-.if ${USE_COMPILERCRTSTUFF} == "yes"
-.if (${HAVE_GCC} == "3" || ${HAVE_GCC} == "4")
- ${MAKEDIRTARGET} . do-gnu-lib-crtstuff${LIBGCC_EXT}
-.endif
-.endif
- ${MAKEDIRTARGET} . do-gnu-lib-libgcc${LIBGCC_EXT}
-.endif
-.endif
-
-do-compat-libgcc: .PHONY .MAKE
-.if defined(HAVE_GCC)
-.if ${MKGCC} != "no"
-.if ${USE_COMPILERCRTSTUFF} == "yes"
- ${MAKEDIRTARGET} . do-compat-gnu-lib-crtstuff${LIBGCC_EXT}
-.endif
- ${MAKEDIRTARGET} . do-compat-gnu-lib-libgcc${LIBGCC_EXT}
-.endif
-.endif
-
-do-libpcc: .PHONY .MAKE
-.if defined(HAVE_PCC)
-.if ${MKPCC} != "no"
-.if ${USE_COMPILERCRTSTUFF} == "yes"
- ${MAKEDIRTARGET} . do-pcc-lib-crtstuff
-.endif
- ${MAKEDIRTARGET} . do-pcc-lib-libpcc
-.endif
-.endif
-
-do-ld.so: .PHONY .MAKE
-.for targ in dependall install
- ${MAKEDIRTARGET} libexec/ld.elf_so ${targ}
-.endfor
-
-do-build: .PHONY .MAKE
-.for targ in dependall install
- ${MAKEDIRTARGET} . ${targ} BUILD_tools=no BUILD_lib=no
-.endfor
-
-do-x11: .PHONY .MAKE
-.if ${MKX11} != "no"
-.if ${X11FLAVOUR} == "Xorg"
- ${MAKEDIRTARGET} external/mit/xorg build
-.else
- ${MAKEDIRTARGET} x11 build
-.endif
-.else
- @echo "MKX11 is not enabled"
- @false
-.endif
-
-do-extsrc: .PHONY .MAKE
-.if ${MKEXTSRC} != "no"
- ${MAKEDIRTARGET} extsrc build
-.else
- @echo "MKEXTSRC is not enabled"
- @false
-.endif
-
-do-obsolete: .PHONY .MAKE
- ${MAKEDIRTARGET} etc install-obsolete-lists
-
-#
-# Speedup stubs for some subtrees that don't need to run these rules.
-# (Tells <bsd.subdir.mk> not to recurse for them.)
-#
-
-.for dir in bin etc distrib games libexec regress sbin usr.sbin tools
-includes-${dir}: .PHONY
- @true
-.endfor
-.for dir in etc distrib regress
-install-${dir}: .PHONY
- @true
-.endfor
-
-#
-# XXX this needs to change when distrib Makefiles are recursion compliant
-# XXX many distrib subdirs need "cd etc && make snap_pre snap_kern" first...
-#
-dependall-distrib depend-distrib all-distrib: .PHONY
- @true
-
-.include <bsd.sys.mk>
-.include <bsd.obj.mk>
-.include <bsd.kernobj.mk>
-.include <bsd.subdir.mk>
-
-build-docs: .PHONY ${.CURDIR}/BUILDING
-${.CURDIR}/BUILDING: doc/BUILDING.mdoc
- ${_MKMSG_CREATE} ${.TARGET}
- ${TOOL_GROFF} -mdoc -Tascii -P-bou $> >$@
-
-
-#
-# Display current make(1) parameters
-#
-params: .PHONY .MAKE
- ${MAKEDIRTARGET} etc params
View
16 Makefile.inc
@@ -1,16 +0,0 @@
-# $NetBSD: Makefile.inc,v 1.4 2002/04/10 14:53:43 lukem Exp $
-
-.ifndef ABSTOP
-ABSTOP!= cd ${.PARSEDIR}; pwd
-
-.if (${.PARSEDIR} == ${.CURDIR})
-RELTOP:= .
-.else
-RELTOP:= ${.PARSEDIR:S,^${.CURDIR},,}
-.endif
-
-# you can set BSD{SRC,OBJ}DIR in Makefile.local.inc
-.if exists(${ABSTOP}/Makefile.local.inc)
-.include "${ABSTOP}/Makefile.local.inc"
-.endif
-.endif
View
536 UPDATING
@@ -1,536 +0,0 @@
-$NetBSD: UPDATING,v 1.218 2011/01/15 16:13:59 joerg Exp $
-
-This file (UPDATING) is intended to be a brief reference to recent
-changes that might cause problems in the build process, and a guide for
-what to do if something doesn't work.
-
-For a more detailed description of the recommended way to build NetBSD
-using build.sh, see the BUILDING file.
-
-Note that much of the advice in this UPDATING file was written before
-build.sh existed. Nevertheless, the advice here may be useful for
-working around specific problems with build.sh.
-
-See also: BUILDING, build.sh, Makefile.
-
-Recent changes:
-^^^^^^^^^^^^^^^
-20110112:
- Assembler files on amd64 and i386 no longer use -traditional-cpp.
- This can break the build of individual parts of the tree. This is
- handled correctly by build.sh. Manual builds have to update
- /usr/share/mk and re-run config(1) for any kernel configurations as
- needed.
-
-20101217:
- The tcpdump(8) program was changed to drop privileges and chroot(2)
- by default. It may be necessary to manually update passwd(5) and
- group(5) in order to make the program work with existing setups.
-
-20101125:
- The latest changes to setenv(3) dissallow setting environment
- variables with names that contain '='. Revision 1.18 of env.c
- assumed that this was allowed. Installing a new libc with an
- old copy of /usr/bin/env causes env x=1 printenv | grep x= to
- break which affects the autoconf tests for dependency finding,
- so building gcc will end up printing:
- checking dependency style of gcc... none
- configure: error: no usable dependency style found
- Fix it by rebuilding and re-installing env.
-
-20101119:
- Recent Xorg updates in xsrc/external/mit/ may cause various build
- or run-time problems. Delete your entire DESTDIR and OBJDIR if you
- have any build problems with xsrc, or problems with mismatched
- versions between xorg-server and drivers.
-
-20100604:
- The update of ATF to 0.9 causes old tests written in shell to fail
- unless they are rebuilt. If you are building with MKUPDATE=yes,
- you need to clean the src/external/bsd/atf/tests/ and the src/tests/
- trees by hand.
-
-20100522:
- Recent Xorg updates in xsrc/external/mit/ will cause various build
- problems. Delete your entire DESTDIR and OBJDIR if you have any
- build problems with xsrc.
-
-20100522:
- private section of <ctype.h> was splitted, and now mklocale(1)
- include ctype_local.h, so you have to make cleandir in tools/mklocale.
-
-20100520:
- The location of the xkb compiled descriptions has changed. Please
- remove usr/X11R7/lib/X11/xkb/compiled from your $DESTDIR.
-
-20100222:
- The shared objects file extension has been changed from .so to
- .pico, in order to avoid conflicts with shared libraries names
- libXX.so. All now stale regular .so files can be removed from
- your object directories.
-
-20100204:
- The termcap database has been removed from the sources,
- but has not been marked obsolete so it is not removed
- from the system when upgrading.
- As such, you will need to remove them from your object
- and destination directories.
-
-20091101:
- After updating, it may be necessary to make the 'cleandir'
- target in src/tools/yacc/ and in src/usr.bin/yacc/ before a
- 'build.sh -u tools' or 'build.sh -u distribution'. Ditto
- src/tools/lex/ and src/usr.bin/lex/.
-
-20091001:
- On amd64 you must rebuild tools (to get the new binutils)
- before building a kernel, or the build fails on cpufunc.S.
-
-20091001:
- An error will create a ./usr/X11R7/lib/X11/xkb/compiled/xkb
- symlink, failing the build. Delete the link, and the subdir
- it is in, and retry your build.
-
-20090718:
- libc build changed so that strchr() provides the extra entry
- point for index(). Update build of libc.a (and libc_pic.a)
- may fail because the archive contains the unwanted index.o.
- (Similarly for strrchr() and rindex().)
-
-20090709:
- Native Xorg was upgraded again. Builds will probably fail again
- without a clean objdir, at least for src/external/mit/xorg.
-
-20090616:
- Native Xorg was upgraded. Builds will need a clean objdir for
- src/external/mit/xorg. Upgrading a system from sets will not
- work properly yet as the /usr/X11R7/lib/X11/xkb/symbols/pc
- subdirectory has been changed into a file, and this needs to
- be manually "rm -r"'ed before installing xbase.tgz.
-
-20090501:
- Several new functions were added to string.h/libc, and this
- can cause autoconf problems during the tool build for people
- who fail to clean out their tools objects properly. If you
- note messages about stpcpy, stpncpy or strnlen accompanying a
- failure during the tool build, clean out all your tools
- objects and start again.
-
-20090325:
- The i386 port was switched to i486 default toolchain. This requires
- cleaning your src/tools directory and $TOOLDIR and rebuilding them.
-
-20090126:
- The __posix_fadvise50 system call changed assembly stub type. You
- need to 'rm -f __posix_fadvise50.*' in the libc build directory
- to avoid using the old assembly stub.
-
-20090202:
- pkg_install now depends on the pkgdb cache for automatic conflict
- detection. It is recommented to rebuild the cache with
- ``pkg_admin rebuild''.
-
-20090110:
- time_t and dev_t have been bumped to 64 bit quantities. To upgrade:
- 1. Make sure your kernel has COMPAT_50 in it. Build and install.
- This is needed even in the MODULAR kernel because there is
- conditionally compiled code in rtsock.c.
- 2. make sure build.sh completes and the binaries in a chroot work
- before installing.
- 3. If you don't use build.sh and you build directly to root, and
- your build breaks in the middle, don't despair. Make sure headers
- are installed properly, and start building libraries first libc
- and libutil, install them and then continue building all the
- libraries in src/lib and src/gnu/lib and install them. Once
- the new libraries are installed, you can restart the build.
- 4. If you compile packages and you notice link time warnings,
- rebuild the required packages to update their shared libraries.
- Any package you rebuild will require rebuilding all the packages
- that depend on it.
- 5. Next time you run pwd_mkdb with the new binary, the file
- will be upgraded and it will not be backwards compatible.
- 6. The utmpx/wtmpx files (/var/run/utmpx and /var/log/wtmpx, see
- lastlogx(5)) have been versioned, and there is a heuristic
- for utmp. You are better off removing the old files after
- upgrading. The automated clearing of /var/run during
- boot, and the automated rotating of files in /var/log by
- newsyslog(8), may mean that you do not have to remove the
- files manually.
- 7. The optional accounting file (/var/account/acct, see
- accton(8)) has not been versioned, and will need to be
- removed. The automatic rotation of the accounting file by
- /etc/daily limits the bad consequences of failure to remove
- the file.
- 8. Application software that writes time_t to binary files on
- disk will break or need attention. Most notably: if you are
- using PostgreSQL < 8.4, you need to dump your databases,
- rebuild PostgreSQL with the new time_t, then restore.
-
-20081219:
- config(1) has been updated, and one of the files it creates -
- swapnetbsd.o - has changed format. You need to rebuild config
- (done automatically by build.sh) and then you need to rerun
- config on all kernel configuration files before rebuilding those
- kernels.
-
-20081205:
- If you build with MKX11=no, you should remove /etc/rc.d/xdm and
- /etc/rc.d/xfs from DESTDIR because those files were moved to the xetc
- set and will appear as extra files for MKX11=no update builds.
-
-20081122:
- On i386, various kernel options(4) in GENERIC including
- file systems have been disabled and moved into kernel modules.
- Before trying a new GENERIC kernel, you have to prepare the
- following files as well as a new GENERIC kernel:
-
- - build and install kernel modules from src/sys/modules
-
- - install the latest bootloader, which will load a module
- for the file system from which the kernel is loaded automatically
-
- If you have to load your kernel from a file system which is not of
- the same type as the root file system, you have to load the necessary
- file system module manually on the boot prompt or in the boot.cfg file.
-
-20080827:
- If you built and installed a libc from sources between
- 2008/08/20 and 2008/08/26 you got a broken strtouq(3)
- which results in false errors reported by lint(1).
- Since this breaks the libc build itself, manual help is
- needed -- lint must be disabled temporarily, e.g.:
- $ (cd lib/libc && make MKLINT=no dependall install)
-
-20080813:
- MKDEBUG build was broken because the .depend files did not know
- about .go files. You need to remove all .depend files and rebuild.
-
-20080802:
- A regression in binary compatibility for pthread_mutex_t has
- been fixed. Unfortunately, the price is breaking compatibility
- for -current.
-
- Threaded programs (using libpthread) and C++ programs (using
- libstdc++) compiled after 20070907 and before 20080802 need to
- be recompiled.
-
- One way to find affected pkgsrc packages:
-
- $ grep REQUIRES=/usr/lib/libpthread /var/db/pkg/*/+BUILD_INFO
- $ grep REQUIRES=/usr/lib/libstdc++ /var/db/pkg/*/+BUILD_INFO
-
-20080731:
- WAPBL (metadata journaling support) has been added, but at this
- time isn't backwards compatible with pre-WAPBL aware kernels
- and userland (fsck_ffs in particular). Please make sure you
- don't use a journaled filesystem with an older kernel/userland,
- especially an uncleanly mounted journaled filesystem. WAPBL
- also requires the super block to be in the UFS2 format. You
- can use fsck_ffs -c 4 to update the superblock format.
-
-20080721:
- Assembler warnings are now fatal if $WARNS>0 and $NOGCCERROR
- isn't defined.
-
-20080531:
- The ioctl number of DRVSUSPENDDEV command on /dev/drvctl changed
- from 125 (conflicted with DRVCTLCOMMAND) to 129. The drvctl(8)
- utility needs to be rebuilt and reinstalled as older binaries
- won't work correctly. The following sequence of commands:
-
- $ (cd sys/sys/ && nbmake-$arch includes)
- $ (cd sbin/drvctl/ && nbmake-$arch clean)
- $ (cd sbin/drvctl/ && nbmake-$arch all)
-
- leaves new drvctl utility in sbin/drvctl build directory.
-
-20080503:
- The <bsd.lib.mk> variable MKPRIVATELIB was renamed to LIBISPRIVATE.
-
-20080521:
- For a while, unprivileged UPDATE builds would fail to
- succeed at the checkflist stage, complaining that
- ${DESTDIR}/stand/<arch>/ did not exist. A fix for this
- problem was committed to share/mk/bsd.kmodule.mk, revision 1.9.
- If you already hit this problem, update the .mk file,
- remove ${DESTDIR}/stand/<arch>, and re-run the build.
-
-20080303:
- Linker warnings are now fatal if $WARNS>0.
-
-20080126:
- The posix_fadvise system call has been changed from an assembly
- stub, to a c file that calls an assembly stub. You need to
- 'rm -f posix_fadvise.* .depend' in the libc build directory to
- avoid using the old assembly stub.
-
-20071209:
- The acpiec(4) driver has been split into two attachments. If you
- get ACPI errors before the attachment, please update your kernel
- configuration file appropriately or see GENERIC for more details.
-
-20071115:
- The it(4) driver has been renamed to itesio(4) and the old port
- argument specified in the kernel configuration file is not valid
- anymore. The itesio(4) driver now uses the Super I/O address port
- rather than the EC address port. Please update your kernel
- configuration file appropriately or see GENERIC for more details.
-
-20071028:
- The pccons(4) driver has been removed from the NetBSD/shark port.
- You need to update any custom kernel configuration file you have
- to remove any references to pccons (which includes removing the
- now useless XSERVER option) and replace them with the correct
- entries for the wscons driver. See the GENERIC configuration file
- for more details.
-
-20070913:
- A latent bug in dhclient/dhcpd that caused it to be unable to
- enumerate interfaces was fixed. The bug began to cause
- problems after 20070911 when the kernel's SIOCGIFCONF
- implementation was repaired. From 20070529 to 20070911 racoon
- could not enumerate interfaces. (These are noted because
- normal kernel/userspace version matching hygiene is not
- sufficient to avoid this problem.) Ensure that both kernel
- and userland are from after 20070913.
-
-20070703:
- nbinstall has been renamed ${MACHINE_GNU_ARCH}-install. It
- calls the target-specific strip program, and the logic to pass
- down STRIP from make has been removed. This requires a
- re-installation of tools.
-
-20070422:
- The way OS emulations lookup filenames inside the emulation root
- has been changed. Rather than modify the pathname (and copy back
- to userspace) namei() and lookup() directly check the emulation
- root. One side effect is that absolute symlinks inside the emulated
- root file system will be relative to that file system - unless they
- start /../ this is useful when the emulated root is a real install
- that has such links.
- This might affect symlinks that have been added to reference outside
- the emulated root.
-
-20070412:
- The pckbc driver on sgimips IP32 has been removed. Use macekbc
- instead. See the GENERIC32_IP3x kernel configuration for an
- example.
-
-20070319:
- src/lib/libc/Makefile revision 1.129 broke libc and ld.elf_so
- on many platforms due to incorrect flags settings. If you
- updated and built after about 20070315, do "nbmake-$arch
- cleandir" in src/lib/libc and src/libexec/ld.elf_so to force a
- rebuild of object files that might have been built
- incorrectly, and ensure that you have at least
- src/lib/libc/Makefile 1.130.
-
-20070210:
- src/sys/sys/{sa.h,savar.h} were removed.
- find ${OBJDIR} \( -name .depend -o -name '*.d' \) -print \
- | xargs egrep -l '/sa.h|/savar.h' | xargs rm
- will allow dependencies on those files to get get rebuilt
-
-20070209:
- The threading model was changed when the newlock2 branch
- was merged to NetBSD-current. If you boot with a new
- kernel (version 4.99.10), then you also need a new pthread
- library (/usr/lib/libpthread.so.0.7). If you boot with
- an old kernel, then you need the old pthread library
- (/usr/lib/libpthread.so.0.6). Provided you keep the kernel and
- the pthread library in sync, old threaded applications should
- continue to work with an old or new kernel. Note that named(8)
- is the only threaded application in the base system.
-
-20061214:
- Following the move of string_to_flags() and flags_to_string()
- from the bin/ls/ sources to libutil, users doing UPDATE builds
- will need to do a "make cleandir" in
- tools/mtree/, tools/makefs/, tools/binstall/, tools/pax/,
- bin/pax/, bin/ls/, usr.sbin/mtree/, usr.sbin/makefs/,
- usr.bin/xinstall/, libexec/ftpd/, rescue/, as well
- as the installation images in distrib/
- in order to excise stale references to the old stat_flags.h header
- file in the ls sources -- stat_flags.h has been removed.
-
-20061108:
- The configure script used in the src/tools/gcc compiler has been
- changed to indicate that our libc has ssp support built-in and
- does not depend on -lssp and -lssp-nonshared. You'll need to
- make clean in src/tools/gcc first to rebuild the compiler.
-
-20061009:
- The sysctl variables net.inet{,6}.tcp{,6}.newreno are no longer
- available. Use net.inet{,6}.tcp{,6}.congctl.selected instead.
-
-20060814:
- The vt, vidcconsole, kbd, and rpckbd drivers on acorn32 have been
- withdrawn. Use vidcvideo and pckbd instead. See the GENERIC
- kernel configuration for an example. X servers from the last
- few years should cope.
-
-20060703:
- MPACPI is no more. We always configure PCI interrupts using ACPI
- if we have an ACPI kernel. The option MPACPI_SCANPCI has been renamed
- to ACPI_SCANPCI. Thanks to work from fvdl.
-
-20060627:
- socket(2) has changed, and its system call has been versioned.
- For userlands with the old version of socket(2), make sure that
- your kernel has 'options COMPAT_30' set, or else 'bad system call'
- errors will result.
-
-Hints for a more successful build:
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- Use build.sh, but do not use its "expert mode":
- This will automatically build the tools in the
- correct order, and it will keep the tools and the
- new build products from interfering with the running
- system. This will allow you to ignore most of the
- other advice in this file.
- Build a new kernel first:
- This makes sure that any new system calls or features
- expected by the new userland will be present. This
- helps to avoid critical errors when upgrading.
- Use object directories:
- This helps to keep stale object
- files from polluting the build if a Makefile "forgets"
- about one. It also makes it easier to clean up after
- a build. It's also necessary if you want to use the
- same source tree for multiple machines.
- To use object directories with build.sh:
- a) invoke build.sh with the "-M" or "-O" options.
- To use object directories without using build.sh:
- a) cd /usr/src ; make cleandir
- b) Add "OBJMACHINE=yes" to /etc/mk.conf
- c) Add "MKOBJDIRS=yes" to /etc/mk.conf
- d) cd /usr/src ; make build
- Note that running "make obj" in a directory will create
- in obj.$MACHINE directory.
- Build to a DESTDIR:
- This helps to keep old installed files (especially libraries)
- from interfering with the new build.
- To build to a DESTDIR with build.sh, use the "-D" option.
- To build to a DESTDIR without using build.sh, set the DESTDIR
- environment variable before running make build. It should be
- set to the pathname of an initially empty directory.
- Problems: if you do not use build.sh, you might need to
- update critical utilities without using DESTDIR since
- nothing is executed from what is installed in DESTDIR.
- (See critical utils, below.)
- Build often:
- This keeps critical utilities current enough to not choke
- on any other part of the source tree that depends on up to
- date functionality. If you use build.sh, you should not have
- this problem.
-
-What to do if things don't work:
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-When things don't work there is usually a few things that commonly
-should be done.
- 1) make includes
- This should be done automatically by make build.
- 2) cd share/mk && make install
- Again, automatically done by make build.
-
-Failsafe rebuild of a small part of the tree:
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-To make sure you rebuild something correctly you want to do
-something like the following:
- 1) Make sure the includes and .mk files are up to date.
- 2) Make sure any program used to build the particular
- utility is up to date. (yacc, lex, etc...)
- 3) cd ...path/to/util...
- make cleandir
- rm ...all obj directories...
- make cleandir # yes, again
- make obj
- make depend && make
-
-Failsafe rebuild of the entire tree:
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-If you really want to make sure the source tree is clean and
-ready for a build try the following. Note that sourcing /etc/mk.conf
-(a make(1) Makefile) in this manner is not right, and will not work
-for anyone who uses any make(1) features in /etc/mk.conf.
-
----cut here---
-#!/bin/sh
-. /etc/mk.conf
-
-if [ -z $NETBSDSRCDIR ] ; then
- NETBSDSRCDIR=/usr/src
-fi
-if [ \! -d $NETBSDSRCDIR ] ; then
- echo Unable to find sources
- exit 1
-fi
-find $NETBSDSRCDIR -name \*.o -o -name obj.\* -o -name obj -exec rm \{\} \;
-
-if [ -z $BSDOBJDIR ] ; then
- BSDOBJDIR=/usr/obj
-fi
-if [ -d $BSDOBJDIR ] ; then
- rm -rf $BSDOBJDIR
-fi
-
-cd $NETBSDSRCDIR && make cleandir
-
----cut here---
-
-Critical utilities:
-^^^^^^^^^^^^^^^^^^^
- usr.bin/compile_et
- usr.bin/make
- usr.bin/yacc
- usr.bin/lex
- usr.bin/xlint
- usr.bin/config
-
-Other problems and possible solutions:
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-Symptom:Complaints involving a Makefile.
-Fix: Rebuild usr.bin/make:
- cd usr.bin/make && make && make install
- Or, a failsafe method if that doesn't work:
- cd usr.bin/make && cc *.c */*.c -I . -o make && mv make /usr/bin
-
-Fix: Make sure .mk files are up to date.
- cd share/mk && make install
-
-Symptom:Kernel `config' fails to configure any kernel, including GENERIC.
-Fix: Rebuild usr.bin/config
-
-Symptom:
-Fix: Rebuild usr.bin/yacc
-
-Symptom:
-Fix: Rebuild usr.bin/lex
-
-Symptom:
-Fix: rm /usr/lib/libbfd.a
-
-Symptom:Obsolete intermediate files are used during compilation
-Fix: Try the following sequence of commands in the directory in question.
- make cleandir; rm `make print-objdir`; make cleandir; make obj
- (If you built the tree without "make obj" in the past, obsolete files
- may remain. The command tries to clean everything up)
-
-Symptom:.../sysinst/run.c:xx: warning: initialization from incompatible
- pointer type
-Fix: Rebuild and install usr.bin/menuc
-
-Symptom:mklocale not found during build in share/locale/ctype
-Fix: Build and install usr.bin/mklocale
-
-Symptom:undefined reference to `__assert13' or `__unsetenv13'
-Fix: Rebuild and install lib/libc
-
-Symptom:usr.bin/config fails to build.
-Fix: Try building with -DMAKE_BOOTSTRAP added to CFLAGS in Makefile.
-
-Symptom:undefined reference to `getprogname' or `setprogname'
-Fix: Rebuild and install lib/libc
-
-Symptom:lint does not understand the '-X' option
-Fix: May need to build & install libs with NOLINT=1 before rebuilding lint
View
8 bin/Makefile
@@ -1,8 +0,0 @@
-# $NetBSD: Makefile,v 1.22 2007/12/31 15:31:24 ad Exp $
-# @(#)Makefile 8.1 (Berkeley) 5/31/93
-
-SUBDIR= cat chio chmod cp csh date dd df domainname echo ed expr hostname \
- kill ksh ln ls mkdir mt mv pax ps pwd rcp rcmd rm rmdir sh \
- sleep stty sync test
-
-.include <bsd.subdir.mk>
View
11 bin/Makefile.inc
@@ -1,11 +0,0 @@
-# $NetBSD: Makefile.inc,v 1.16 2009/02/14 08:31:13 lukem Exp $
-# @(#)Makefile.inc 8.1 (Berkeley) 5/31/93
-
-.include <bsd.own.mk> # for MKDYNAMICROOT definition
-
-WARNS?= 4
-BINDIR?= /bin
-
-.if (${MKDYNAMICROOT} == "no")
-LDSTATIC?= -static
-.endif
View
6 bin/cat/Makefile
@@ -1,6 +0,0 @@
-# $NetBSD: Makefile,v 1.12 2003/05/18 07:57:31 lukem Exp $
-# @(#)Makefile 8.1 (Berkeley) 5/31/93
-
-PROG= cat
-
-.include <bsd.prog.mk>
View
209 bin/cat/cat.1
@@ -1,209 +0,0 @@
-.\" $NetBSD: cat.1,v 1.32 2006/09/23 11:24:44 wiz Exp $
-.\"
-.\" Copyright (c) 1989, 1990, 1993
-.\" The Regents of the University of California. All rights reserved.
-.\"
-.\" This code is derived from software contributed to Berkeley by
-.\" the Institute of Electrical and Electronics Engineers, Inc.
-.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\" 1. Redistributions of source code must retain the above copyright
-.\" notice, this list of conditions and the following disclaimer.
-.\" 2. Redistributions in binary form must reproduce the above copyright
-.\" notice, this list of conditions and the following disclaimer in the
-.\" documentation and/or other materials provided with the distribution.
-.\" 3. Neither the name of the University nor the names of its contributors
-.\" may be used to endorse or promote products derived from this software
-.\" without specific prior written permission.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-.\" SUCH DAMAGE.
-.\"
-.\" @(#)cat.1 8.3 (Berkeley) 5/2/95
-.\"
-.Dd September 23, 2006
-.Dt CAT 1
-.Os
-.Sh NAME
-.Nm cat
-.Nd concatenate and print files
-.Sh SYNOPSIS
-.Nm
-.Op Fl beflnstuv
-.Op Fl
-.Op Ar
-.Sh DESCRIPTION
-The
-.Nm
-utility reads files sequentially, writing them to the standard output.
-The
-.Ar file
-operands are processed in command line order.
-A single dash represents the standard input,
-and may appear multiple times in the
-.Ar file
-list.
-.Pp
-The word
-.Dq concatenate
-is just a verbose synonym for
-.Dq catenate .
-.Pp
-The options are as follows:
-.Bl -tag -width Ds
-.It Fl b
-Implies the
-.Fl n
-option but doesn't number blank lines.
-.It Fl e
-Implies the
-.Fl v
-option, and displays a dollar sign
-.Pq Ql \&$
-at the end of each line
-as well.
-.It Fl f
-Only attempt to display regular files.
-.It Fl l
-Set an exclusive advisory lock on the standard output file descriptor.
-This lock is set using
-.Xr fcntl 2
-with the
-.Dv F_SETLKW
-command.
-If the output file is already locked,
-.Nm
-will block until the lock is acquired.
-.It Fl n
-Number the output lines, starting at 1.
-.It Fl s
-Squeeze multiple adjacent empty lines, causing the output to be
-single spaced.
-.It Fl t
-Implies the
-.Fl v
-option, and displays tab characters as
-.Ql ^I
-as well.
-.It Fl u
-The
-.Fl u
-option guarantees that the output is unbuffered.
-.It Fl v
-Displays non-printing characters so they are visible.
-Control characters print as
-.Ql ^X
-for control-X; the delete
-character (octal 0177) prints as
-.Ql ^? .
-Non-ascii characters (with the high bit set) are printed as
-.Ql M-
-(for meta) followed by the character for the low 7 bits.
-.El
-.Sh EXIT STATUS
-The
-.Nm
-utility exits 0 on success, and \*[Gt]0 if an error occurs.
-.Sh EXAMPLES
-The command:
-.Bd -literal -offset indent
-.Ic cat file1
-.Ed
-.Pp
-will print the contents of
-.Ar file1
-to the standard output.
-.Pp
-The command:
-.Bd -literal -offset indent
-.Ic cat file1 file2 \*[Gt] file3
-.Ed
-.Pp
-will sequentially print the contents of
-.Ar file1
-and
-.Ar file2
-to the file
-.Ar file3 ,
-truncating
-.Ar file3
-if it already exists.
-See the manual page for your shell (i.e.,
-.Xr sh 1 )
-for more information on redirection.
-.Pp
-The command:
-.Bd -literal -offset indent
-.Ic cat file1 - file2 - file3
-.Ed
-.Pp
-will print the contents of
-.Ar file1 ,
-print data it receives from the standard input until it receives an
-.Dv EOF
-.Pq Sq ^D
-character, print the contents of
-.Ar file2 ,
-read and output contents of the standard input again, then finally output
-the contents of
-.Ar file3 .
-Note that if the standard input referred to a file, the second dash
-on the command-line would have no effect, since the entire contents of the file
-would have already been read and printed by
-.Nm
-when it encountered the first
-.Ql \&-
-operand.
-.Sh SEE ALSO
-.Xr head 1 ,
-.Xr hexdump 1 ,
-.Xr lpr 1 ,
-.Xr more 1 ,
-.Xr pr 1 ,
-.Xr tail 1 ,
-.Xr view 1 ,
-.Xr vis 1 ,
-.Xr fcntl 2
-.Rs
-.%A Rob Pike
-.%T "UNIX Style, or cat -v Considered Harmful"
-.%J "USENIX Summer Conference Proceedings"
-.%D 1983
-.Re
-.Sh STANDARDS
-The
-.Nm
-utility is expected to conform to the
-.St -p1003.2-92
-specification.
-.Pp
-The flags
-.Op Fl belnstv
-are extensions to the specification.
-.Sh HISTORY
-A
-.Nm
-utility appeared in
-.At v1 .
-Dennis Ritchie designed and wrote the first man page.
-It appears to have been
-.Xr cat 1 .
-.Sh BUGS
-Because of the shell language mechanism used to perform output
-redirection, the command
-.Dq Li cat file1 file2 \*[Gt] file1
-will cause the original data in file1 to be destroyed!
-This is performed by the shell before
-.Nm
-is run.
View
316 bin/cat/cat.c
@@ -1,316 +0,0 @@
-/* $NetBSD: cat.c,v 1.47 2008/07/20 00:52:39 lukem Exp $ */
-
-/*
- * Copyright (c) 1989, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Kevin Fall.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if HAVE_NBTOOL_CONFIG_H
-#include "nbtool_config.h"
-#endif
-
-#include <sys/cdefs.h>
-#if !defined(lint)
-__COPYRIGHT(
-"@(#) Copyright (c) 1989, 1993\
- The Regents of the University of California. All rights reserved.");
-#if 0
-static char sccsid[] = "@(#)cat.c 8.2 (Berkeley) 4/27/95";
-#else
-__RCSID("$NetBSD: cat.c,v 1.47 2008/07/20 00:52:39 lukem Exp $");
-#endif
-#endif /* not lint */
-
-#include <sys/param.h>
-#include <sys/stat.h>
-
-#include <ctype.h>
-#include <err.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <locale.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-int bflag, eflag, fflag, lflag, nflag, sflag, tflag, vflag;
-int rval;
-const char *filename;
-
-int main(int, char *[]);
-void cook_args(char *argv[]);
-void cook_buf(FILE *);
-void raw_args(char *argv[]);
-void raw_cat(int);
-
-int
-main(int argc, char *argv[])
-{
- int ch;
- struct flock stdout_lock;
-
- setprogname(argv[0]);
- (void)setlocale(LC_ALL, "");
-
- while ((ch = getopt(argc, argv, "beflnstuv")) != -1)
- switch (ch) {
- case 'b':
- bflag = nflag = 1; /* -b implies -n */
- break;
- case 'e':
- eflag = vflag = 1; /* -e implies -v */
- break;
- case 'f':
- fflag = 1;
- break;
- case 'l':
- lflag = 1;
- break;
- case 'n':
- nflag = 1;
- break;
- case 's':
- sflag = 1;
- break;
- case 't':
- tflag = vflag = 1; /* -t implies -v */
- break;
- case 'u':
- setbuf(stdout, NULL);
- break;
- case 'v':
- vflag = 1;
- break;
- default:
- case '?':
- (void)fprintf(stderr,
- "usage: cat [-beflnstuv] [-] [file ...]\n");
- exit(EXIT_FAILURE);
- /* NOTREACHED */
- }
- argv += optind;
-
- if (lflag) {
- stdout_lock.l_len = 0;
- stdout_lock.l_start = 0;
- stdout_lock.l_type = F_WRLCK;
- stdout_lock.l_whence = SEEK_SET;
- if (fcntl(STDOUT_FILENO, F_SETLKW, &stdout_lock) == -1)
- err(EXIT_FAILURE, "stdout");
- }
-
- if (bflag || eflag || nflag || sflag || tflag || vflag)
- cook_args(argv);
- else
- raw_args(argv);
- if (fclose(stdout))
- err(EXIT_FAILURE, "stdout");
- return (rval);
-}
-
-void
-cook_args(char **argv)
-{
- FILE *fp;
-
- fp = stdin;
- filename = "stdin";
- do {
- if (*argv) {
- if (!strcmp(*argv, "-"))
- fp = stdin;
- else if ((fp = fopen(*argv,
- fflag ? "rf" : "r")) == NULL) {
- warn("%s", *argv);
- rval = EXIT_FAILURE;
- ++argv;
- continue;
- }
- filename = *argv++;
- }
- cook_buf(fp);
- if (fp != stdin)
- (void)fclose(fp);
- else
- clearerr(fp);
- } while (*argv);
-}
-
-void
-cook_buf(FILE *fp)
-{
- int ch, gobble, line, prev;
-
- line = gobble = 0;
- for (prev = '\n'; (ch = getc(fp)) != EOF; prev = ch) {
- if (prev == '\n') {
- if (ch == '\n') {
- if (sflag) {
- if (!gobble && nflag && !bflag)
- (void)fprintf(stdout,
- "%6d\t\n", ++line);
- else if (!gobble && putchar(ch) == EOF)
- break;
- gobble = 1;
- continue;
- }
- if (nflag) {
- if (!bflag) {
- (void)fprintf(stdout,
- "%6d\t", ++line);
- if (ferror(stdout))
- break;
- } else if (eflag) {
- (void)fprintf(stdout,
- "%6s\t", "");
- if (ferror(stdout))
- break;
- }
- }
- } else if (nflag) {
- (void)fprintf(stdout, "%6d\t", ++line);
- if (ferror(stdout))
- break;
- }
- }
- gobble = 0;
- if (ch == '\n') {
- if (eflag)
- if (putchar('$') == EOF)
- break;
- } else if (ch == '\t') {
- if (tflag) {
- if (putchar('^') == EOF || putchar('I') == EOF)
- break;
- continue;
- }
- } else if (vflag) {
- if (!isascii(ch)) {
- if (putchar('M') == EOF || putchar('-') == EOF)
- break;
- ch = toascii(ch);
- }
- if (iscntrl(ch)) {
- if (putchar('^') == EOF ||
- putchar(ch == '\177' ? '?' :
- ch | 0100) == EOF)
- break;
- continue;
- }
- }
- if (putchar(ch) == EOF)
- break;
- }
- if (ferror(fp)) {
- warn("%s", filename);
- rval = EXIT_FAILURE;
- clearerr(fp);
- }
- if (ferror(stdout))
- err(EXIT_FAILURE, "stdout");
-}
-
-void
-raw_args(char **argv)
-{
- int fd;
-
- fd = fileno(stdin);
- filename = "stdin";
- do {
- if (*argv) {
- if (!strcmp(*argv, "-"))
- fd = fileno(stdin);
- else if (fflag) {
- struct stat st;
- fd = open(*argv, O_RDONLY|O_NONBLOCK, 0);
- if (fd < 0)
- goto skip;
-
- if (fstat(fd, &st) == -1) {
- close(fd);
- goto skip;
- }
- if (!S_ISREG(st.st_mode)) {
- close(fd);
- warnx("%s: not a regular file", *argv);
- goto skipnomsg;
- }
- }
- else if ((fd = open(*argv, O_RDONLY, 0)) < 0) {
-skip:
- warn("%s", *argv);
-skipnomsg:
- rval = EXIT_FAILURE;
- ++argv;
- continue;
- }
- filename = *argv++;
- }
- raw_cat(fd);
- if (fd != fileno(stdin))
- (void)close(fd);
- } while (*argv);
-}
-
-void
-raw_cat(int rfd)
-{
- static char *buf;
- static char fb_buf[BUFSIZ];
- static size_t bsize;
-
- ssize_t nr, nw, off;
- int wfd;
-
- wfd = fileno(stdout);
- if (buf == NULL) {
- struct stat sbuf;
-
- if (fstat(wfd, &sbuf) == 0 &&
- sbuf.st_blksize > sizeof(fb_buf)) {
- bsize = sbuf.st_blksize;
- buf = malloc(bsize);
- }
- if (buf == NULL) {
- bsize = sizeof(fb_buf);
- buf = fb_buf;
- }
- }
- while ((nr = read(rfd, buf, bsize)) > 0)
- for (off = 0; nr; nr -= nw, off += nw)
- if ((nw = write(wfd, buf + off, (size_t)nr)) < 0)
- err(EXIT_FAILURE, "stdout");
- if (nr < 0) {
- warn("%s", filename);
- rval = EXIT_FAILURE;
- }
-}
View
5 bin/chio/Makefile
@@ -1,5 +0,0 @@