[BACK]Return to UPDATING CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src

Annotation of src/UPDATING, Revision 1.7

1.7     ! ad          1: $NetBSD: UPDATING,v 1.6 2000/10/19 15:02:38 ad Exp $
1.1       abs         2:
                      3: This file is intended to be a brief introduction to the build
                      4: process and a reference on what to do if something doesn't work.
                      5:
                      6: For a more detailed description see Makefile.
                      7:
                      8: Recent changes:
                      9: ^^^^^^^^^^^^^^^
1.6       ad         10:
                     11: 20001019:
1.7     ! ad         12:        The `ca' device driver has been replaced by `ld'; although the
1.6       ad         13:        major and minor numbers haven't changed, you should update your /dev
                     14:        directory.
1.1       abs        15:
1.4       itojun     16: 20000929:
                     17:        The following make directives are obsoleted.
                     18:        MKCRYPTO_RSA NOCRYPTO_RSA NOCRYPTO_RC5 NOCRYPTO_IDEA
                     19:        By default, RSA is built into libcrypto.  IDEA and RC5 will not be
                     20:        bulit into libcrypto.  By using MKCRYPTO_{RC5,IDEA}, you can build
                     21:        additional library libcrypto_{idea,rc5}.
                     22:
1.1       abs        23: 20000623:
                     24:        MKCRYPTO and friends added to share/mk/bsd.own.mk.
                     25:        'cd share/mk ; make install' needed before make build.
                     26:
                     27:
                     28: Hints for a more successful build:
                     29: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1.2       mrg        30:     Build a new kernel first:
                     31:        This makes sure that any new system calls or features
                     32:           expected by the new userland will be present.  This
                     33:           helps to avoid critical errors when upgrading.
1.1       abs        34:     Use object directories:
                     35:        This helps to keep stale object
                     36:           files from polluting the build if a Makefile "forgets"
                     37:           about one.  It also makes it easier to clean up after
                     38:           a build.  It's also necessary if you want to use the
                     39:           same source tree for multiple machines.
                     40:           To use object directories:
                     41:            a) cd /usr/src ; make cleandir
1.2       mrg        42:            b) Add "OBJMACHINE=yes" to /etc/mk.conf
                     43:            c) Add "MKOBJDIRS=yes" to /etc/mk.conf
1.1       abs        44:            d) cd /usr/src ; make build
1.2       mrg        45:           Note that running "make obj" in a directory will create
                     46:           in obj.$MACHINE directory.
1.1       abs        47:     Build to a DESTDIR:
                     48:        This helps to keep old
                     49:           installed files (especially libraries) from interfering
                     50:           with the new build.
                     51:           To build to a DESTDIR, set the DESTDIR environment
1.2       mrg        52:           variable before running make build.  It should be set to
                     53:           the pathname of an initially empty directory.
1.1       abs        54:           Problems: you might need to update critical utilities
                     55:                without using DESTDIR since nothing is executed
                     56:                from what is installed in DESTDIR.
                     57:                (See critical utils, below)
                     58:     Build often:
                     59:        This keeps critical utilities current enough to not choke
                     60:        on any other part of the source tree that depends on up to
                     61:        date functionality.
                     62:
                     63: What to do if things don't work:
                     64: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                     65: When things don't work there is usually a few things that commonly
                     66: should be done.
                     67:     1) make includes
                     68:        This should be done automatically by make build.
                     69:     2)  cd share/mk && make install
                     70:        Again, automatically done by make build.
                     71:
                     72: Failsafe rebuild of a small part of the tree:
                     73: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                     74: To make sure you rebuild something correctly you want to do
                     75: something like the following:
                     76:     1)  Make sure the includes and .mk files are up to date.
                     77:     2)  Make sure any program used to build the particular
                     78:        utility is up to date.  (yacc, lex, etc...)
                     79:     3)  cd ...path/to/util...
                     80:        make cleandir
                     81:        rm ...all obj directories...
                     82:        make cleandir                   # yes, again
                     83:        make obj
                     84:        make depend && make
                     85:
                     86: Failsafe rebuild of the entire tree:
                     87: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                     88: If you really want to make sure the source tree is clean and
1.2       mrg        89: ready for a build try the following.  Note that sourcing /etc/mk.conf
                     90: (a make(1) Makefile) in this manner is not right, and will not work
                     91: for anyone who uses any make(1) features in /etc/mk.conf.
1.1       abs        92:
                     93: ---cut here---
                     94: #!/bin/sh
                     95: . /etc/mk.conf
                     96:
                     97: if [ -z $BSDSRCDIR ] ; then
                     98:     BSDSRCDIR=/usr/src
                     99: fi
                    100: if [ \! -d $BSDSRCDIR ] ; then
                    101:     echo Unable to find sources
                    102:     exit 1
                    103: fi
                    104: find $BSDSRCDIR -name \*.o -o -name obj.\* -o -name obj -exec rm \{\} \;
                    105:
                    106: if [ -z $BSDOBJDIR ] ; then
                    107:     BSDOBJDIR=/usr/obj
                    108: fi
                    109: if [ -d $BSDOBJDIR ] ; then
                    110:     rm -rf $BSDOBJDIR
                    111: fi
                    112:
                    113: cd $BSDSRCDIR && make cleandir
                    114:
                    115: ---cut here---
                    116:
                    117: Critical utilities:
                    118: ^^^^^^^^^^^^^^^^^^^
                    119:        gnu/usr.bin/egcs
1.3       itojun    120:        usr.bin/compile_et
1.1       abs       121:        usr.bin/make
                    122:        usr.bin/yacc
                    123:        usr.bin/lex
1.2       mrg       124:        usr.sbin/config
1.1       abs       125:
                    126: Other problems and possibly solutions:
                    127: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                    128: Symptom:Unreasonable compiler errors.
                    129: Fix:   Rebuild gnu/usr.bin/egcs
                    130:
                    131: Symptom:Complaints involving a Makefile.
                    132: Fix:   Make sure .mk files are up to date.
                    133:        cd share/mk && make install
                    134: Fix:   Rebuild usr.bin/make
1.2       mrg       135:
                    136: Symptom:Kernel `config' fails to configure any kernel, including GENERIC.
                    137: Fix:   Rebuild usr.sbin/config
1.1       abs       138:
                    139: Symptom:
                    140: Fix:   Rebuild usr.bin/yacc
                    141:
                    142: Symptom:
                    143: Fix:   Rebuild usr.bin/lex
                    144:
                    145: Symptom:
                    146: Fix:   rm /usr/lib/libbfd.a
1.4       itojun    147:
                    148: Symptom:Obsolete intermediate files are used during compilation
                    149: Fix:   Try the following sequence of commands in the directory in question.
                    150:        make cleandir; rm `make print-objdir`; make cleandir; make obj
                    151:        (If you built the tree without "make obj" in the past, obsolete files
                    152:        may remain.  The command tries to clean everything up)
1.5       wiz       153:
                    154: Symptom:.../sysinst/run.c:xx: warning: initialization from incompatible pointer type
                    155: Fix:   Rebuild and install usr.bin/menuc

CVSweb <webmaster@jp.NetBSD.org>