UPDATING revision 1.142
1$NetBSD: UPDATING,v 1.142 2005/08/25 16:01:14 drochner Exp $
2
3This file (UPDATING) is intended to be a brief reference to recent
4changes that might cause problems in the build process, and a guide for
5what to do if something doesn't work.
6
7For a more detailed description of the recommended way to build NetBSD
8using build.sh, see the BUILDING file.
9
10Note that much of the advice in this UPDATING file was written before
11build.sh existed.  Nevertheless, the advice here may be useful for
12working around specific problems with build.sh.
13
14See also: BUILDING, build.sh, Makefile.
15
16Recent changes:
17^^^^^^^^^^^^^^^
18
1920050825:
20	Some data structures in sys/device.h, related to interface
21	attributes and locator names, were changed. config(1) was
22	modified to emit the new data structures.
23	Thus usr.bin/config must be updated (and run on the kernel
24	configuration file) before a new kernel can be built.
25
2620050531:
27	genassym.sh(8) was moved to genassym(1). You need to either build
28	tools first or install the version of genassym from /usr/bin before
29	you can build a kernel again.
30
3120050520:
32	Because a kernfs bug which xentools relies on was fixed,
33	xentools up to xentools20-2.0.3nb4 won't work with new kernel.
34
3520050417:
36	postinstall(8) was moved from /etc to /usr/sbin and made part
37	of the "base" set, to make it easier to invoke after an
38	upgrade.
39
4020050325:
41	pcppi(4) was separated in two devices, adding attimer(4).  Be sure
42	to add a config line for an attimer(4) device in your kernel
43	configuration, or you won't be able to set the pitch of the beep
44	with wsconsctl.  Depending on the default value for the pitch, you
45	might even not hear any more beep.  Also, it is advised to attach both
46	devices the same way (i.e., both on isa or both on acpi) or the
47	pcppi(4) device may fail to find the attimer(4) one.
48
4920050211:
50	Fixes to tools/Makefile.gnuhost may cause UPDATE=1 builds in
51	some of the cross tools to fail if they use configure. Some configure's
52	cache the environment passed in and notice the new environment is
53	different and abort. Doing a clean in tools/ should be enough to
54	make a build continue.
55
5620050109:
57	Since su is using pam by default now, make sure that you have
58	/etc/pam.d populated (postinstall will do that automatically
59	for you). Otherwise su will fail open (i.e. will not require
60	a password).
61
6220041229:
63	Make had a path resolution bug that manifested itself as not
64	being able to install openpam.3. This bug has been fixed, but
65	you might need to rebuild make manually first to get through
66	the build.
67
6820041201:
69	Userland programs have been changed to use /dev/bpf instead of
70	/dev/bpfX. You need to create that device by installing a new
71	MAKEDEV and running it, or mv /dev/bpf0 /dev/bpf && rm /dev/bpf[0-9]*
72
7320041006:
74
75	A bug was introduced into /bin/sh (var.c rev 1.35) which causes
76	variables to not export correctly to subshells in all cases. This
77	will cause builds to break if that version of /bin/sh is installed
78	on the system. The proper version of /bin/sh can be verified with:
79
80        ident /bin/sh | grep var
81
82	Any /bin/sh w. version 1.35 will not work and needs to be updated
83	before attempting a build.
84	
8520041001:
86	The ipfilter kernel sources moved from sys/netinet to
87	dist/sys/ipf/netinet. Due to the move some Makefile
88	dependencies are now dangling requiring a make cleandir
89	before they work again (kdump, ktruss, rescue, ipf, and
90	ftp-proxy are the victims).
91
9220040715:
93	The rc.d/sendmail script now uses a heuristic to determine
94	if sendmail should be started at boot time.  It checks the
95	contents of /etc/mailer.conf, /etc/mail/submit.cf, and the
96	owner and mode of the sendmail binary to see if any changes
97	to the mail infrastructure have been made.  If no changes
98	are detected, it will start an SMTP listener.
99
100	Setting sendmail=NO in /etc/rc.conf will override this.
101
102	If you are only using sendmail by default and only for
103	local delivery, it is important that you also update your
104	sendmail.cf so that the SMTP listener only listens on the
105	loopback interface.
106
10720040715:
108	The method by which athhal-elf.o gets pulled into i386
109	kernel builds has been changed again.  The latest version
110	of bsd.files.mk is no longer required.
111
11220040621:
113	Due to the recent rototill of tools/compat it's crucial one starts
114	from a clean objdir under tools/*.
115
116	This is mostly due to generated files (yacc and lex sources) needing
117	to be generated with new rules from bsd.hostprog.mk.
118
119	The safest course is to rm -rf all objects under tools before building.
120
12120040516:
122	The end-user modifiable X11 configuration has been moved
123	from /usr/X11R6/lib/X11/<dir> to /etc/X11/<dir>.
124	Ensure that src and xsrc is up to date, and run
125	"make cleandir" in src/x11 before your next build.
126
127	postinstall currently doesn't migrate the files from
128	/usr/X11R6/lib/X11/* to /etc/X11/* although it does
129	detect that this needs to occur, so you'll have to
130	manually move these files yourself.
131
13220040426:
133	Support for the original dynamic sysctl node structure has
134	been removed in favor of the newer layout.  This affects
135	consumers of the create and delete interface, as well as
136	the dynamic discovery mechanism.  This is believed only to
137	be the sysctl(8) binary itself, at this point in time, so
138	the only effect of this should be that a sysctl binary
139	built from sources dated between 2003/12/04 and 2004/03/24
140	will not work on a kernel built from sources dated after
141	2004/04/25.  If you need a new sysctl binary but build.sh
142	does not work, make sure that your revision of
143	src/sys/sys/sysctl.h is 1.112 (or later), and then the
144	do the following:
145
146	cd /usr/src (or wherever your source tree is)
147	make USETOOLS=no includes
148	cd lib/libc
149	make USETOOLS=no dependall install
150	cd ../../sbin/sysctl
151	make USETOOLS=no dependall install
152
153	If you are using older sysctl binary, GNU autoconf would fail to
154	identify your machine architecture, and tries to build binary for
155	"unknown-unknown-netbsd20F" or something like that.  if that happens,
156	make sure to follow the above steps.
157
15820040425:
159	The ffs superblock issues listed below under 20040109 and 20030402
160	are now automatically addressed by the /etc/rc.d/fixsb script or by
161	sysinst when it checks a a filesystem. The manual fsck_ffs -b16 -c4
162	invocation mentioned below will continue to work and is now
163	automated by those scripts.  Note that under certain circumstances,
164	affected filesystems upgraded to a -current kernel first before
165	upgrading their userland with the fixsb and fsck_ffs fixes may
166	encounter a 'freeing free inode' panic when writing to the affected
167	filesystem, so it is a good idea to repair the filesystem as soon as
168	possible.  For more details on the fixsb script, see pr install/25138.
169
17020040418:
171	statfs(2) and friends have been replaced with statvfs(2). Before
172	installing a newly build userland make sure that you are running
173	a newly built kernel with COMPAT_20 set. In addition your libc
174	build might not work (undefined SYS_statfs symbol) because make
175	clean does not know how to remove files it does not know about
176	anymore. Manually remove all generated .S sources and objects
177	from the libc build directory.
178
17920040326:
180	The method by which athhal-elf.o gets pulled into i386 kernel builds
181	has been changed. The file is now stored as a uuencoded file in CVS
182	and the generated Makefile will use the new .uue rules from bsd.file.mk
183	to build it.
184
185	This means you must have the latest bsd.files.mk installed when
186	building a kernel without USETOOLS=yes.
187
18820040318:
189	A bug in the cgd(4) blowfish code was corrected, without
190	provision of backwards compatibility, after several public
191	notices over several months. Users of cgd with blowfish cipher
192	ONLY must dump their data before updating their kernels, and
193	recreate cgd's and restore data using the new kernel. See
194	(recent message to current-users, URL when mail-index has updated)
195
19620040313:
197	On acorn32, the opms and qms drivers have been withdrawn, and
198	the old wsqms driver is now called qms.  Kernel config files
199	will need updating.  See the ones in sys/arch/acorn32/conf
200	for examples.
201
20220040125:
203	On acorn32, the beep and sysbeep devices are no longer
204	needed, and will need to be deleted from kernel configuration
205	files.
206
20720040109:
208	Compatibility for old ffs superblock layouts has been
209	added, and the restrictive fsck checks have been reenabled
210	when using those layouts.  If you have been using -current
211	since 20030402, you may find that fsck again signals fatal
212	superblock mismatches.  To repair, make sure you have
213	an updated fsck_ffs and then you can use fsck_ffs -b 16 -c 4
214	to complete the filesystem upgrade.  A message has
215	been added to the kernel which should detect this problem.
216	See the following discussion for more information:
217	http://mail-index.NetBSD.org/current-users/2004/01/11/0022.html
218
21920031203:
220	New binutils builds may fail due to old dependencies.
221	It's necessary to "make cleandir" to ensure that
222	the dependencies will be rebuilt correctly.
223
22420031111:
225	A newer mkdep is needed.  Error noting that is
226		cc: Ambiguous abbreviation --
227
22820031008:
229	/usr/include/sys/disklabel_mbr.h was removed.
230	It's necessary to "make cleandir" to ensure that
231	the dependencies will be rebuilt correctly.
232
23320031007:
234	A sign exension bug was fixed which set all the high bits
235	of our newly expanded ffs fs_flags.  This should only
236	affect users who installed or upgraded in September of 2003.
237	A small utility program was posted to tech-kern which
238	should fix this problem, and a warning message was added
239	to the kernel which should discover and warn about it.  See
240	http://mail-index.NetBSD.org/tech-kern/2003/10/07/0005.html
241
24220030906:
243	With the addition of siginfo support the old signal trampoline
244	code has been deprecated to COMPAT_16. Make sure that your running
245	kernel has COMPAT_16 enabled before building userland.
246
24720030801:
248	With the new openssl, there is some header and library shuffling.
249	rm -f /usr/include/des.h /usr/include/kerberosIV/* /lib/libdes* \
250	/usr/lib/libdes* before building.
251
25220030703:
253	Texinfo was updated to 4.6.  To avoid failures when trying to
254	build the included texinfo files, do:
255
256	cd src/gnu/usr.bin/texinfo
257	make MKINFO=no dependall install
258
25920030630:
260	Groff was updated to 1.19; it's probably necessary to do
261		cd share/mk && make install
262		cd src/gnu/usr.bin/groff
263		make MKMAN=no dependall install
264	(untested).
265
26620030516:
267	Due to bugs in the export handling code, invalid export lines
268	were accepted before and caused the kernel to panic when
269	mountd got restarted because it freed memory that had already
270	been freed. This has been fixed and the kernel checks
271	export addresses very strictly. If you upgrade your kernel,
272	make sure you also upgrade mountd, because if your export
273	file contains lines with an old inet4 address syntax (i.e.
274	a.b.c or a.b or a), they will get rejected by the new kernel.
275
27620030402:
277	The superblock layout for FFS was changed.  If you have 1.6
278	fsck binaries, they will signal a fatal superblock mismatch
279	with the first alternate, because they compare too many
280	fields (even ones that aren't useful).  If possible, upgrade
281	your fsck_ffs binary before using a new kernel.
282	None of this signals actual filesystem damage.
283
28420030324:
285	sendmail version 8.12.8 was imported.  Since sendmail is
286	now setgid to the smmsp group, and runs in "collection"
287	mode for most common activities, there is a new config
288	file called submit.cf that needs to live in /etc/mail.
289	The generic submit.cf sample in /usr/share/sendmail/cf
290	is named netbsd-msp.cf.  Upgrading your regular sendmail
291	configuration file is also strongly advised.
292
293	See the section named "MESSAGE SUBMISSION PROGRAM" in
294	the updated /usr/share/sendmail/README file for more
295	information.
296
29720030117:
298	Texinfo was updated to 4.3.  To avoid failures when trying to
299	build the included texinfo files, do:
300
301	cd src/gnu/usr.bin/texinfo
302	make MKINFO=no dependall install
303
30420021223:
305	The METALOG format changed slightly, to remove the leading
306	"${DESTDIR}" from path names.
307	This only affects people building with UNPRIVED.
308	For complete safety, remove the DESTDIR entirely and
309	update tools/mtree, before running make build.
310
31120021219:
312	CVS repository layout was changed.  See the following for details
313	if you are using (anonymous) cvs to update your tree.
314
315	http://mail-index.NetBSD.org/netbsd-announce/2002/12/19/0000.html
316
31720021219:
318	install(1) had a '-N dbdir' option added, to specify an
319	alternate location to look up users & groups (instead
320	of the host system passwd(5) and group(5) databases).
321
322	The build system was modified to take advantage of
323	this option (using ${NETBSDSRCDIR}/etc), so if you
324	use USETOOLS==no, you may have to rebuild and
325	reinstall usr.bin/xinstall first.
326
32720021130:
328	fparseln(3) moved from libutil to libc.
329	If building to DESTDIR=/, reinstall the includes
330	and rebuild libc:
331		make includes
332		make do-lib-libc
333	If using build.sh, "cd tools/compat && make clean"
334	before rebuilding the tools.
335
33620021126:
337	The mk.conf(5) variable SYS_INCLUDE has been deprecated,
338	including the optional "SYS_INCLUDE=symlinks" support.
339	All header files, including <sys/*.h> are copied into
340	/usr/include.
341
34220021121:
343	The C run-time support files crtbegin.o and crtend.o
344	(and their companions crtbeginS.o and crtendS.o) were
345	split up, with new crti.o and crtn.o files resulting.
346	This means that libtool needs to be rebuilt once the
347	new libraries are installed.  The process of rebuilding
348	libtool will cause it to automatically notice the new
349	required files, but it *must* be rebuilt in order to
350	do this.
351
352	An out-of-date libtool will result in shared libraries
353	which lack _init() and _fini() routines, which means that
354	their global contructors/destructors will not be invoked.
355
35620021121:
357	A bug related to how ARM ELF objects were tagged has been
358	corrected.
359
360	NetBSD ARM ELF uses the soft-VFP floating point model by
361	default.  However, the assembler lacked support for marking
362	objects as using the VFP floating point format, and the
363	compiler was not properly passing the flag indicating "soft-VFP"
364	to the assembler.
365
366	Unfortunately, this means that the linker will now consider
367	old (i.e. not marked "softvfp") NetBSD ARM ELF objects to be
368	incompatible with new (properly marked) objects.
369
370	The problem will only manifest itself if you attempt to compile
371	a new program using the fixed toolchain, and link that program
372	against old libraries which do not have the proper "softvfp"
373	markings.  ALL OF YOUR EXISTING BINARIES AND SHARED LIBRARIES
374	WILL CONTINUE TO WORK PROPERLY.
375
376	The only work-around for the problem is to recompile all of
377	the libraries on the system.  The easiest way to do this for
378	system libraries is to install a binary snapshot; they are
379	generally available on releng.NetBSD.org.  Any packages you
380	have installed which supply libraries will have to be recompiled
381	if you wish to link new programs against those libraries.
382
383	If you have questions about this matter, please contact
384	port-arm@NetBSD.org.
385
38620021011:
387	Systrace has been improved to support privilege elevation.
388	Updating the kernel requires the userland part of systrace
389	to be rebuilt.
390
39120021010:
392	The config(8) grammar was changed to allow options to register
393	dependencies on attributes, as well as other options.  Users
394	must update and reinstall usr.sbin/config before building a new
395	kernel.
396
39720021009:
398	A new attribute dependency syntax was introduced to config(8),
399	which is now used by the SCSI configuration description.  Users
400	must update and reinstall usr.sbin/config before building a new
401	kernel.
402
40320021003:
404	Several changes have been made to the autoconfiguration
405	framework.  Users must update and reinstall usr.sbin/config
406	before building a new kernel.
407
40820021001:
409	The i386mp branch has been merged.  To compile a kernel, users
410	will need to add the option 'cpu* at mainbus?' to their configuration
411	file.  Multiprocessor kernels will need
412	ioapic*		at mainbus? apid ?
413	options		MULTIPROCESSOR
414	options		COM_MPLOCK
415
41620020922:
417	MKDYNAMICROOT=yes enabled by default, which means that
418	certain shared libraries are installed into /lib, the shared
419	linker is installed into /libexec, and all programs in /bin
420	and /sbin are dynamically linked.
421	If you do not use "make build", you should ensure that
422	you have the libraries and shared linker in the new locations,
423	with:
424		make do-lib-csu do-lib-libc do-lib do-gnu-lib do-ld.elf_so
425
42620020917:
427	USE_NEW_TOOLCHAIN has been replaced with:
428	    -	TOOLCHAIN_MISSING -- set to "yes" on platforms for which
429		there is no working in-tree toolchain (hppa, ns32k, sh5,
430		x86_64).
431	    -	EXTERNAL_TOOLCHAIN -- if defined by the user, points to the
432		root of an external toolchain (e.g. /usr/local/gnu).  This
433		enables the cross-build framework even for TOOLCHAIN_MISSING
434		platforms.
435
43620020906:
437	gehenna-devsw has been merged into the trunk. Need to update and
438	reinstall usr.sbin/config before building the kernel.
439
44020020822:
441	Crunched rescue tools (contents of /bin and /sbin, plus others)
442	are now provided in /rescue.
443
444	To ensure that these are built statically linked (no matter
445	what the setting of LDSTATIC is), use a crunchgen(1) built
446	from sources newer than 20020820 (see the next entry).
447
44820020820:
449	crunchgen(1) changed to ensure that the generated program
450	is statically linked.
451
452	Solution: update and reinstall usr.bin/crunch
453
45420020605:
455	smmsp user/group has been added for sendmail.
456
457	Add the following into /etc/group:
458
459	smmsp:*:17:
460
461	and the following to /etc/master.passwd (via vipw):
462
463	smmsp:*:17:17::0:0:Sendmail Message Submission Program:/nonexistent:/sbin/nologin
464
46520020515:
466	sshd user/group has been added.  Need to hand add this in, or sshd
467	will not let you log in (with default, or UsePrivlegeSeparation=yes)
468
469	Add the following into /etc/group:
470
471	sshd:*:16:
472
473	and the following to /etc/master.passwd (via vipw):
474
475	sshd:*:16:16::0:0:& pseudo-user:/var/chroot/sshd:/sbin/nologin
476	
477	Also /var/chroot/sshd directory needs to be present (digged as part of
478	the build process).
479
48020020426:
481	NBUILDJOBS obsoleted in favor of just using -j.
482
48320020426:
484	etc/postinstall added, which performs various checks for 
485	configuration file updates and changes, and can fix most of
486	the problems identified.
487	This should make it much easier to upgrade a system's
488	configuration from earlier systems (as far back as NetBSD 1.5).
489
49020020320:
491	<bsd.lib.mk> needs a new install(1) for its "-a cmd" support.
492	Build and install at usr.bin/xinstall before the build.
493
49420020319:
495	Raw IPv6 socket now makes strict checking for sa_family and sa_len
496	on send(2) operation.  Be sure to have sbin/rtsol and usr.sbin/rtsold
497	newer than November 2001 when you upgrade the kernel.
498
49920020311:
500	ssh configuration files were moved from /etc to /etc/ssh.  Beware
501	if you restart your machine from remote.  Note that sshd.conf needs
502	to be changed (due to the use of "/etc" inside).
503
50420020223:
505	Users of the VAX port will need to rebuild and install gas
506	so it deal with the now present register prefix used in all
507	the VAX assembly files.
508
50920020118:
510	ntpd user/group has been added.  Need to hand add this in or builds
511	will break as mtree aborts early.
512
513	Add the following into /etc/group:
514
515	ntpd:*:15:
516
517	and the following to /etc/master.passwd (via vipw):
518
519	ntpd:*:15:15::0:0:Ntpd pseudo-user:/var/chroot/ntpd:/sbin/nologin
520
52120011207:
522	If you're attempting to build a snapshot on sparc64 and are getting
523	reloc errors from the toolchain groff binary this means your native
524	toolchain has some broken C++ bits.
525
526	To fix:
527
528	Build a new toolchain (i.e. build.sh -t)
529	Use the new toolchain to build and install natively (i.e. /usr/lib)
530
531	gnu/lib/libgcc
532	gnu/lib/libstdc++
533
534	After this a snapshot will be able to be built.
535
53620011201:
537	In order for a sparc64 build to work you must have a working awk. If
538	you've built and installed a system with the new toolchain up to this
539	point you do not have a working awk as its ability to do floating
540	point is broken. 
541
542	To build:
543
544	remake and install gnu/lib/libgcc
545	remake and install gnu/usr.bin/gawk into /usr/bin (make sure it links
546	against the new libgcc.a)
547
54820011128:
549	Kernel config information was changed to use defflag in
550	the various "files" files.  Bug fixes to config(8) are
551	required in order for this to work properly.  Make sure
552	to build and install in usr.sbin/config before attempting
553	to build a new kernel.
554
55520011030:
556	libc/locale/wcstod.c now needs new lint(1). Update lint(1)
557	before building libc.
558
55920011029:
560	The new document BUILDING.mdoc (view with nroff | more, or
561	see pre-generated .txt and .html versions) describes the build
562	procedure in great detail.  BUILDING, and the USE_NEW_TOOLCHAIN
563	build process, are intended in the long run to replace this
564	manual update log.
565
566	Users building a USE_NEW_TOOLCHAIN system should read the
567	BUILDING document for caveats.  Generally, BUILDING supersedes
568	UPDATING for these systems, as tool updating is taken care of
569	by the new build system.
570
57120011028:
572	src/etc/Makefile now needs install to be able to handle
573	symlinks that point to nowhere. A bug in install that
574	prevented this was corrected.
575
576	Solution: update and reinstall usr.bin/xinstall
577	Better Solution: Use the new toolchain and it will just work
578	for you.
579
58020011006:
581	/etc/mtree/NetBSD.dist has been updated to take advantage of
582	absolute path support added to mtree(8). Older mtree(8)s don't
583	understand the format.
584
585	Solution: update and reinstall usr.sbin/mtree
586
58720011004:
588	Crunchgen has been updated to work via reach-over makefiles. Updating
589	is suggested before running a snapshot build
590
59120010915:
592	The new "ubcperf" code committed by Chuck Silvers removed
593	a header file, uvm/uvm_vnode.h.  There may be stale .depend
594	files that still reference this file.
595
596	Solution: "make cleandir && make dependall" in affected
597	directories.
598
59920010803:
600	grep.info is now built from grep.texi using makeinfo.  Since it
601	requires makeinfo v4.0, you need to install new texinfo before
602	building gnu/usr.bin/grep.  To install new texinfo, please follow
603	the instruction described in 20010726 entry.
604
60520010803: 
606	(i386 only): i386 kernel now uses new instructions like
607	`fxsave' which old gas doesn't understand.  To build the
608	kernel successfully, you need to build and install a new toolchain, 
609	(i.e., build.sh -t) or 	(temporarily) comment out "options I686_CPU" 
610	from your kernel configuration until you rebuild your userland.
611	See 20011029 above and BUILDING file in this directory for more information.
612	[updated 20020630 since i386 gas moved when USE_NEW_TOOLCHAIN enabled]
613
61420010731:
615	Bootloader update on ELF platforms.  DDB in kernels from before
616	this will be unable to read symbol tables provided by newer
617	bootloaders.
618
61920010726:
620	Texinfo was updated to 4.0.  To avoid failures when trying to
621	build the included texinfo files, do:
622
623	cd src/gnu/usr.bin/texinfo
624	make MKINFO=no dependall install
625
62620010718:
627	Enabled correct .init/.fini processing in crt0.  The way this
628	was done was to change a -I directive to cc(1), which means
629	make(1) will have a stale dependency (it will be checking the
630	timestamp on the wrong "dot_init.h").
631
632	The symptom you will see is that new programs die with SIGSEGV
633	if you have a stale dependency.
634
635	Solution: "make cleandir" in both lib/csu and libexec/ld.elf_so
636	before starting your build.
637
63820010628:
639	A construct was added to uvm_page.h that uncovered a bug
640	in lint(1).  If you get a warning/error about a non-portable
641	bitfield, update your lint(1) before proceeding.
642
64320010226:
644	Added named user/group to system. Need to hand add this in or builds
645	will break as mtree aborts early.
646
647	To work around add by hand:
648
649	named:*:14:
650
651	to /etc/group and add:
652
653	named:*:14:14::0:0:Named pseudo-user:/var/named:/sbin/nologin
654
655	to master.passwd (use vipw for instance if doing by hand).
656
657	Now a make build should progress.
658
65920010219:
660	get/setprogname() added. Any hostprogs that may use this will need
661	to be bootstrapped manually until the host system is current.
662
663	Known problems: sys/arch/macppc/stand/fixcoff
664			usr.sbin/config (adding -DMAKE_BOOTSTRAP to
665			  CFLAGS and rebuilding should work)
666			usr.sbin/mdsetimage - Build a static copy if
667			  building a snapshot before fully bootstrapped.
668
66920010204:
670	prepare the code to compile with stricter gcc flags. in
671	particular start eliminating redundant declarations. Yacc
672	needs to be installed before make build.
673
67420010114:
675	introduce .if commands(target) in make(1). You need to
676	bring everything up-to-date first, then without installing
677	anything make and install in usr.bin/make, then proceed
678	with make build.
679
68020010101:
681	bsd.subdir.mk committed 20001230 had a bug which caused
682	afterinstall targets to run too soon; update again.
683
68420001230:
685	New share/mk files needed to support .WAIT in SUBDIR variables.
686	If you get make errors, 
687		(cd share/mk; make install)
688	Also, PRINTOBJDIR has changed and is now used more heavily.
689
69020001019:
691	The `ca' device driver has been replaced by `ld'; although the
692	major and minor numbers haven't changed, you should update your /dev
693	directory.
694
69520000929:
696	The following make directives are obsoleted.
697	MKCRYPTO_RSA NOCRYPTO_RSA NOCRYPTO_RC5 NOCRYPTO_IDEA 
698	By default, RSA is built into libcrypto.  IDEA and RC5 will not be
699	built into libcrypto.  By using MKCRYPTO_{RC5,IDEA}, you can build
700	additional library libcrypto_{idea,rc5}.
701
702
703Hints for a more successful build:
704^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
705    Use build.sh, but do not use its "expert mode":
706	This will automatically build the tools in the
707	   correct order, and it will keep the tools and the
708	   new build products from interfering with the running
709	   system.  This will allow you to ignore most of the
710	   other advice in this file.
711    Build a new kernel first:
712	This makes sure that any new system calls or features
713	   expected by the new userland will be present.  This
714	   helps to avoid critical errors when upgrading.
715    Use object directories:
716	This helps to keep stale object
717	   files from polluting the build if a Makefile "forgets"
718	   about one.  It also makes it easier to clean up after
719	   a build.  It's also necessary if you want to use the
720	   same source tree for multiple machines.
721	   To use object directories with build.sh:
722	    a) invoke build.sh with the "-M" or "-O" options.
723	   To use object directories without using build.sh:
724	    a) cd /usr/src ; make cleandir
725	    b) Add "OBJMACHINE=yes" to /etc/mk.conf
726	    c) Add "MKOBJDIRS=yes" to /etc/mk.conf
727	    d) cd /usr/src ; make build
728	   Note that running "make obj" in a directory will create
729	   in obj.$MACHINE directory.
730    Build to a DESTDIR:
731	This helps to keep old installed files (especially libraries)
732	   from interfering with the new build.
733	   To build to a DESTDIR with build.sh, use the "-D" option.
734	   To build to a DESTDIR without using build.sh, set the DESTDIR
735	   environment variable before running make build.  It should be
736	   set to the pathname of an initially empty directory.
737	   Problems: if you do not use build.sh, you might need to
738		update critical utilities without using DESTDIR since
739		nothing is executed from what is installed in DESTDIR.
740		(See critical utils, below.)
741    Build often:
742	This keeps critical utilities current enough to not choke
743	on any other part of the source tree that depends on up to
744	date functionality.  If you use build.sh, you should not have
745	this problem.
746 
747What to do if things don't work:
748^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
749When things don't work there is usually a few things that commonly
750should be done.
751    1)	make includes
752	This should be done automatically by make build.
753    2)  cd share/mk && make install
754	Again, automatically done by make build.
755
756Failsafe rebuild of a small part of the tree:
757^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
758To make sure you rebuild something correctly you want to do
759something like the following:
760    1)  Make sure the includes and .mk files are up to date.
761    2)  Make sure any program used to build the particular
762	utility is up to date.  (yacc, lex, etc...)
763    3)  cd ...path/to/util...
764	make cleandir
765	rm ...all obj directories...
766	make cleandir			# yes, again
767	make obj
768	make depend && make
769
770Failsafe rebuild of the entire tree:
771^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
772If you really want to make sure the source tree is clean and
773ready for a build try the following.  Note that sourcing /etc/mk.conf
774(a make(1) Makefile) in this manner is not right, and will not work
775for anyone who uses any make(1) features in /etc/mk.conf.
776
777---cut here---
778#!/bin/sh
779. /etc/mk.conf
780
781if [ -z $NETBSDSRCDIR ] ; then
782    NETBSDSRCDIR=/usr/src
783fi
784if [ \! -d $NETBSDSRCDIR ] ; then
785    echo Unable to find sources
786    exit 1
787fi
788find $NETBSDSRCDIR -name \*.o -o -name obj.\* -o -name obj -exec rm \{\} \;
789
790if [ -z $BSDOBJDIR ] ; then
791    BSDOBJDIR=/usr/obj
792fi
793if [ -d $BSDOBJDIR ] ; then
794    rm -rf $BSDOBJDIR
795fi
796
797cd $NETBSDSRCDIR && make cleandir
798
799---cut here---
800
801Critical utilities:
802^^^^^^^^^^^^^^^^^^^
803	usr.bin/compile_et
804	usr.bin/make
805	usr.bin/yacc
806	usr.bin/lex
807	usr.bin/xlint
808	usr.bin/config
809
810Other problems and possible solutions:
811^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
812Symptom:Complaints involving a Makefile.
813Fix:	Rebuild usr.bin/make:
814	cd usr.bin/make && make && make install
815	Or, a failsafe method if that doesn't work:
816	cd usr.bin/make && cc *.c */*.c -I . -o make && mv make /usr/bin
817
818Fix:	Make sure .mk files are up to date.
819	cd share/mk && make install
820
821Symptom:Kernel `config' fails to configure any kernel, including GENERIC.
822Fix:	Rebuild usr.bin/config
823
824Symptom:
825Fix:	Rebuild usr.bin/yacc
826
827Symptom:
828Fix:	Rebuild usr.bin/lex
829
830Symptom:
831Fix:	rm /usr/lib/libbfd.a
832
833Symptom:Obsolete intermediate files are used during compilation
834Fix:	Try the following sequence of commands in the directory in question.
835	make cleandir; rm `make print-objdir`; make cleandir; make obj
836	(If you built the tree without "make obj" in the past, obsolete files
837	may remain.  The command tries to clean everything up)
838
839Symptom:.../sysinst/run.c:xx: warning: initialization from incompatible pointer type
840Fix:	Rebuild and install usr.bin/menuc
841
842Symptom:mklocale not found during build in share/locale/ctype
843Fix:	Build and install usr.bin/mklocale
844
845Symptom:undefined reference to `__assert13' or `__unsetenv13'
846Fix:    Rebuild and install lib/libc
847
848Symptom:usr.bin/config fails to build.
849Fix:	Try building with -DMAKE_BOOTSTRAP added to CFLAGS in Makefile.
850
851Symptom:undefined reference to `getprogname' or `setprogname'
852Fix:    Rebuild and install lib/libc
853
854Symptom:lint does not understand the '-X' option
855Fix:    May need to build & install libs with NOLINT=1 before rebuilding lint
856