Annotation of src/UPDATING, Revision 1.18
1.18 ! jmc 1: $NetBSD: UPDATING,v 1.17 2001/02/18 19:13:58 erh 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.18 ! jmc 10:
! 11: 20010219:
! 12: get/setprogname() added. Any hostprog's that may use this will need
! 13: to be bootstraped manually until the host system is current.
! 14:
! 15: Known problems: sys/arch/macppc/stand/fixcoff
1.15 christos 16:
17: 20010204:
18: prepare the code to compile with stricter gcc flags. in
19: particular start eliminating redundant declarations. Yacc
20: needs to be installed before make build.
1.10 christos 21:
22: 20010114:
23: introduce .if commands(target) in make(1). You need to
24: bring everything up-to-date first, then without installing
25: anything make and install in /usr/bin/make, then proceed
26: with make build.
1.9 sommerfe 27:
28: 20010101:
29: bsd.subdir.mk committed 20001230 had a bug which caused
30: afterinstall targets to run too soon; update again.
1.8 sommerfe 31:
32: 20001230:
33: New share/mk files needed to support .WAIT in SUBDIR variables.
34: If you get make errors,
35: (cd share/mk; make install)
36: Also, PRINTOBJDIR has changed and is now used more heavily.
1.6 ad 37:
38: 20001019:
1.7 ad 39: The `ca' device driver has been replaced by `ld'; although the
1.6 ad 40: major and minor numbers haven't changed, you should update your /dev
41: directory.
1.1 abs 42:
1.4 itojun 43: 20000929:
44: The following make directives are obsoleted.
45: MKCRYPTO_RSA NOCRYPTO_RSA NOCRYPTO_RC5 NOCRYPTO_IDEA
46: By default, RSA is built into libcrypto. IDEA and RC5 will not be
1.16 wiz 47: built into libcrypto. By using MKCRYPTO_{RC5,IDEA}, you can build
1.4 itojun 48: additional library libcrypto_{idea,rc5}.
49:
1.1 abs 50: 20000623:
51: MKCRYPTO and friends added to share/mk/bsd.own.mk.
52: 'cd share/mk ; make install' needed before make build.
53:
54:
55: Hints for a more successful build:
56: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1.2 mrg 57: Build a new kernel first:
58: This makes sure that any new system calls or features
59: expected by the new userland will be present. This
60: helps to avoid critical errors when upgrading.
1.1 abs 61: Use object directories:
62: This helps to keep stale object
63: files from polluting the build if a Makefile "forgets"
64: about one. It also makes it easier to clean up after
65: a build. It's also necessary if you want to use the
66: same source tree for multiple machines.
67: To use object directories:
68: a) cd /usr/src ; make cleandir
1.2 mrg 69: b) Add "OBJMACHINE=yes" to /etc/mk.conf
70: c) Add "MKOBJDIRS=yes" to /etc/mk.conf
1.1 abs 71: d) cd /usr/src ; make build
1.2 mrg 72: Note that running "make obj" in a directory will create
73: in obj.$MACHINE directory.
1.1 abs 74: Build to a DESTDIR:
75: This helps to keep old
76: installed files (especially libraries) from interfering
77: with the new build.
78: To build to a DESTDIR, set the DESTDIR environment
1.2 mrg 79: variable before running make build. It should be set to
80: the pathname of an initially empty directory.
1.1 abs 81: Problems: you might need to update critical utilities
82: without using DESTDIR since nothing is executed
83: from what is installed in DESTDIR.
84: (See critical utils, below)
85: Build often:
86: This keeps critical utilities current enough to not choke
87: on any other part of the source tree that depends on up to
88: date functionality.
89:
90: What to do if things don't work:
91: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
92: When things don't work there is usually a few things that commonly
93: should be done.
94: 1) make includes
95: This should be done automatically by make build.
96: 2) cd share/mk && make install
97: Again, automatically done by make build.
98:
99: Failsafe rebuild of a small part of the tree:
100: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
101: To make sure you rebuild something correctly you want to do
102: something like the following:
103: 1) Make sure the includes and .mk files are up to date.
104: 2) Make sure any program used to build the particular
105: utility is up to date. (yacc, lex, etc...)
106: 3) cd ...path/to/util...
107: make cleandir
108: rm ...all obj directories...
109: make cleandir # yes, again
110: make obj
111: make depend && make
112:
113: Failsafe rebuild of the entire tree:
114: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
115: If you really want to make sure the source tree is clean and
1.2 mrg 116: ready for a build try the following. Note that sourcing /etc/mk.conf
117: (a make(1) Makefile) in this manner is not right, and will not work
118: for anyone who uses any make(1) features in /etc/mk.conf.
1.1 abs 119:
120: ---cut here---
121: #!/bin/sh
122: . /etc/mk.conf
123:
124: if [ -z $BSDSRCDIR ] ; then
125: BSDSRCDIR=/usr/src
126: fi
127: if [ \! -d $BSDSRCDIR ] ; then
128: echo Unable to find sources
129: exit 1
130: fi
131: find $BSDSRCDIR -name \*.o -o -name obj.\* -o -name obj -exec rm \{\} \;
132:
133: if [ -z $BSDOBJDIR ] ; then
134: BSDOBJDIR=/usr/obj
135: fi
136: if [ -d $BSDOBJDIR ] ; then
137: rm -rf $BSDOBJDIR
138: fi
139:
140: cd $BSDSRCDIR && make cleandir
141:
142: ---cut here---
143:
144: Critical utilities:
145: ^^^^^^^^^^^^^^^^^^^
146: gnu/usr.bin/egcs
1.3 itojun 147: usr.bin/compile_et
1.1 abs 148: usr.bin/make
149: usr.bin/yacc
150: usr.bin/lex
1.11 lukem 151: usr.bin/xlint
1.2 mrg 152: usr.sbin/config
1.1 abs 153:
154: Other problems and possibly solutions:
155: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
156: Symptom:Unreasonable compiler errors.
157: Fix: Rebuild gnu/usr.bin/egcs
158:
159: Symptom:Complaints involving a Makefile.
1.17 erh 160: Fix: Rebuild usr.bin/make:
161: cd usr.bin/make && make && make install
162: Or, a failsafe method if that doesn't work:
163: cd usr.bin/make && cc *.c */*.c -I . -o make && mv make /usr/bin
164:
1.1 abs 165: Fix: Make sure .mk files are up to date.
166: cd share/mk && make install
1.2 mrg 167:
168: Symptom:Kernel `config' fails to configure any kernel, including GENERIC.
169: Fix: Rebuild usr.sbin/config
1.1 abs 170:
171: Symptom:
172: Fix: Rebuild usr.bin/yacc
173:
174: Symptom:
175: Fix: Rebuild usr.bin/lex
176:
177: Symptom:
178: Fix: rm /usr/lib/libbfd.a
1.4 itojun 179:
180: Symptom:Obsolete intermediate files are used during compilation
181: Fix: Try the following sequence of commands in the directory in question.
182: make cleandir; rm `make print-objdir`; make cleandir; make obj
183: (If you built the tree without "make obj" in the past, obsolete files
184: may remain. The command tries to clean everything up)
1.5 wiz 185:
186: Symptom:.../sysinst/run.c:xx: warning: initialization from incompatible pointer type
187: Fix: Rebuild and install usr.bin/menuc
1.12 itojun 188:
189: Symptom:mklocale not found during build in share/locale/ctype
190: Fix: Build and install usr.bin/mklocale
1.13 dogcow 191:
192: Symptom:undefined reference to `__assert13'
193: Fix: Rebuild and install lib/libc
194:
195:
CVSweb <webmaster@jp.NetBSD.org>