ia64/linux-2.6.18-xen.hg

annotate Documentation/smart-config.txt @ 854:950b9eb27661

usbback: fix urb interval value for interrupt urbs.

Signed-off-by: Noboru Iwamatsu <n_iwamatsu@jp.fujitsu.com>
author Keir Fraser <keir.fraser@citrix.com>
date Mon Apr 06 13:51:20 2009 +0100 (2009-04-06)
parents 831230e53067
children
rev   line source
ian@0 1 Smart CONFIG_* Dependencies
ian@0 2 1 August 1999
ian@0 3
ian@0 4 Michael Chastain <mec@shout.net>
ian@0 5 Werner Almesberger <almesber@lrc.di.epfl.ch>
ian@0 6 Martin von Loewis <martin@mira.isdn.cs.tu-berlin.de>
ian@0 7
ian@0 8 Here is the problem:
ian@0 9
ian@0 10 Suppose that drivers/net/foo.c has the following lines:
ian@0 11
ian@0 12 #include <linux/config.h>
ian@0 13
ian@0 14 ...
ian@0 15
ian@0 16 #ifdef CONFIG_FOO_AUTOFROB
ian@0 17 /* Code for auto-frobbing */
ian@0 18 #else
ian@0 19 /* Manual frobbing only */
ian@0 20 #endif
ian@0 21
ian@0 22 ...
ian@0 23
ian@0 24 #ifdef CONFIG_FOO_MODEL_TWO
ian@0 25 /* Code for model two */
ian@0 26 #endif
ian@0 27
ian@0 28 Now suppose the user (the person building kernels) reconfigures the
ian@0 29 kernel to change some unrelated setting. This will regenerate the
ian@0 30 file include/linux/autoconf.h, which will cause include/linux/config.h
ian@0 31 to be out of date, which will cause drivers/net/foo.c to be recompiled.
ian@0 32
ian@0 33 Most kernel sources, perhaps 80% of them, have at least one CONFIG_*
ian@0 34 dependency somewhere. So changing _any_ CONFIG_* setting requires
ian@0 35 almost _all_ of the kernel to be recompiled.
ian@0 36
ian@0 37 Here is the solution:
ian@0 38
ian@0 39 We've made the dependency generator, mkdep.c, smarter. Instead of
ian@0 40 generating this dependency:
ian@0 41
ian@0 42 drivers/net/foo.c: include/linux/config.h
ian@0 43
ian@0 44 It now generates these dependencies:
ian@0 45
ian@0 46 drivers/net/foo.c: \
ian@0 47 include/config/foo/autofrob.h \
ian@0 48 include/config/foo/model/two.h
ian@0 49
ian@0 50 So drivers/net/foo.c depends only on the CONFIG_* lines that
ian@0 51 it actually uses.
ian@0 52
ian@0 53 A new program, split-include.c, runs at the beginning of
ian@0 54 compilation (make bzImage or make zImage). split-include reads
ian@0 55 include/linux/autoconf.h and updates the include/config/ tree,
ian@0 56 writing one file per option. It updates only the files for options
ian@0 57 that have changed.
ian@0 58
ian@0 59 Flag Dependencies
ian@0 60
ian@0 61 Martin Von Loewis contributed another feature to this patch:
ian@0 62 'flag dependencies'. The idea is that a .o file depends on
ian@0 63 the compilation flags used to build it. The file foo.o has
ian@0 64 its flags stored in .flags.foo.o.
ian@0 65
ian@0 66 Suppose the user changes the foo driver from resident to modular.
ian@0 67 'make' will notice that the current foo.o was not compiled with
ian@0 68 -DMODULE and will recompile foo.c.
ian@0 69
ian@0 70 All .o files made from C source have flag dependencies. So do .o
ian@0 71 files made with ld, and .a files made with ar. However, .o files
ian@0 72 made from assembly source do not have flag dependencies (nobody
ian@0 73 needs this yet, but it would be good to fix).
ian@0 74
ian@0 75 Per-source-file Flags
ian@0 76
ian@0 77 Flag dependencies also work with per-source-file flags.
ian@0 78 You can specify compilation flags for individual source files
ian@0 79 like this:
ian@0 80
ian@0 81 CFLAGS_foo.o = -DSPECIAL_FOO_DEFINE
ian@0 82
ian@0 83 This helps clean up drivers/net/Makefile, drivers/scsi/Makefile,
ian@0 84 and several other Makefiles.
ian@0 85
ian@0 86 Credit
ian@0 87
ian@0 88 Werner Almesberger had the original idea and wrote the first
ian@0 89 version of this patch.
ian@0 90
ian@0 91 Michael Chastain picked it up and continued development. He is
ian@0 92 now the principal author and maintainer. Please report any bugs
ian@0 93 to him.
ian@0 94
ian@0 95 Martin von Loewis wrote flag dependencies, with some modifications
ian@0 96 by Michael Chastain.
ian@0 97
ian@0 98 Thanks to all of the beta testers.