aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-19 16:47:38 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-19 16:47:38 -0400
commit4800be295c34268fd3211d49828bfaa6bf62867f (patch)
tree10f9b9094a749f26b524ec6ba601284d54f9476c
parentc4ec20717313daafba59225f812db89595952b83 (diff)
parent7bb9d092de0b21f8f3f0a20dc2ec84395549fb62 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild
* git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild: kbuild: fix first module build kconfig: update kconfig-language text kbuild: introduce cc-cross-prefix kbuild: disable depmod in cross-compile kernel build kbuild: make deb-pkg - add 'Provides:' line kconfig: comment typo in scripts/kconfig/Makefile. kbuild: stop docproc segfaulting when SRCTREE isn't set. kbuild: modpost problem when symbols move from one module to another kbuild: cscope - filter out .tmp_* in find_sources kbuild: mailing list has moved kbuild: check asm symlink when building a kernel
-rw-r--r--Documentation/kbuild/kconfig-language.txt14
-rw-r--r--Documentation/kbuild/makefiles.txt22
-rw-r--r--MAINTAINERS3
-rw-r--r--Makefile71
-rw-r--r--scripts/Kbuild.include11
-rw-r--r--scripts/basic/docproc.c11
-rw-r--r--scripts/kconfig/Makefile2
-rw-r--r--scripts/mod/modpost.c3
-rw-r--r--scripts/package/builddeb2
9 files changed, 101 insertions, 38 deletions
diff --git a/Documentation/kbuild/kconfig-language.txt b/Documentation/kbuild/kconfig-language.txt
index fe8b0c4892cf..616043a6da99 100644
--- a/Documentation/kbuild/kconfig-language.txt
+++ b/Documentation/kbuild/kconfig-language.txt
@@ -77,7 +77,12 @@ applicable everywhere (see syntax).
77 Optionally, dependencies only for this default value can be added with 77 Optionally, dependencies only for this default value can be added with
78 "if". 78 "if".
79 79
80- dependencies: "depends on"/"requires" <expr> 80- type definition + default value:
81 "def_bool"/"def_tristate" <expr> ["if" <expr>]
82 This is a shorthand notation for a type definition plus a value.
83 Optionally dependencies for this default value can be added with "if".
84
85- dependencies: "depends on" <expr>
81 This defines a dependency for this menu entry. If multiple 86 This defines a dependency for this menu entry. If multiple
82 dependencies are defined, they are connected with '&&'. Dependencies 87 dependencies are defined, they are connected with '&&'. Dependencies
83 are applied to all other options within this menu entry (which also 88 are applied to all other options within this menu entry (which also
@@ -289,3 +294,10 @@ source:
289 "source" <prompt> 294 "source" <prompt>
290 295
291This reads the specified configuration file. This file is always parsed. 296This reads the specified configuration file. This file is always parsed.
297
298mainmenu:
299
300 "mainmenu" <prompt>
301
302This sets the config program's title bar if the config program chooses
303to use it.
diff --git a/Documentation/kbuild/makefiles.txt b/Documentation/kbuild/makefiles.txt
index f099b814d383..6166e2d7da76 100644
--- a/Documentation/kbuild/makefiles.txt
+++ b/Documentation/kbuild/makefiles.txt
@@ -518,6 +518,28 @@ more details, with real examples.
518 In this example for a specific GCC version the build will error out explaining 518 In this example for a specific GCC version the build will error out explaining
519 to the user why it stops. 519 to the user why it stops.
520 520
521 cc-cross-prefix
522 cc-cross-prefix is used to check if there exist a $(CC) in path with
523 one of the listed prefixes. The first prefix where there exist a
524 prefix$(CC) in the PATH is returned - and if no prefix$(CC) is found
525 then nothing is returned.
526 Additional prefixes are separated by a single space in the
527 call of cc-cross-prefix.
528 This functionality is usefull for architecture Makefile that try
529 to set CROSS_COMPILE to well know values but may have several
530 values to select between.
531 It is recommended only to try to set CROSS_COMPILE is it is a cross
532 build (host arch is different from target arch). And is CROSS_COMPILE
533 is already set then leave it with the old value.
534
535 Example:
536 #arch/m68k/Makefile
537 ifneq ($(SUBARCH),$(ARCH))
538 ifeq ($(CROSS_COMPILE),)
539 CROSS_COMPILE := $(call cc-cross-prefix, m68k-linux-gnu-)
540 endif
541 endif
542
521=== 4 Host Program support 543=== 4 Host Program support
522 544
523Kbuild supports building executables on the host for use during the 545Kbuild supports building executables on the host for use during the
diff --git a/MAINTAINERS b/MAINTAINERS
index 2534dc4aa95a..4ed41394e492 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -2178,7 +2178,7 @@ S: Maintained
2178KCONFIG 2178KCONFIG
2179P: Roman Zippel 2179P: Roman Zippel
2180M: zippel@linux-m68k.org 2180M: zippel@linux-m68k.org
2181L: kbuild-devel@lists.sourceforge.net 2181L: linux-kbuild@vger.kernel.org
2182S: Maintained 2182S: Maintained
2183 2183
2184KDUMP 2184KDUMP
@@ -2207,6 +2207,7 @@ KERNEL BUILD (kbuild: Makefile, scripts/Makefile.*)
2207P: Sam Ravnborg 2207P: Sam Ravnborg
2208M: sam@ravnborg.org 2208M: sam@ravnborg.org
2209T: git kernel.org:/pub/scm/linux/kernel/git/sam/kbuild.git 2209T: git kernel.org:/pub/scm/linux/kernel/git/sam/kbuild.git
2210L: linux-kbuild@vger.kernel.org
2210S: Maintained 2211S: Maintained
2211 2212
2212KERNEL JANITORS 2213KERNEL JANITORS
diff --git a/Makefile b/Makefile
index 68ef80b30340..f9c264e243a2 100644
--- a/Makefile
+++ b/Makefile
@@ -887,10 +887,7 @@ prepare2: prepare3 outputmakefile
887 887
888prepare1: prepare2 include/linux/version.h include/linux/utsrelease.h \ 888prepare1: prepare2 include/linux/version.h include/linux/utsrelease.h \
889 include/asm include/config/auto.conf 889 include/asm include/config/auto.conf
890ifneq ($(KBUILD_MODULES),) 890 $(cmd_crmodverdir)
891 $(Q)mkdir -p $(MODVERDIR)
892 $(Q)rm -f $(MODVERDIR)/*
893endif
894 891
895archprepare: prepare1 scripts_basic 892archprepare: prepare1 scripts_basic
896 893
@@ -906,14 +903,24 @@ prepare: prepare0
906 903
907export CPPFLAGS_vmlinux.lds += -P -C -U$(ARCH) 904export CPPFLAGS_vmlinux.lds += -P -C -U$(ARCH)
908 905
909# FIXME: The asm symlink changes when $(ARCH) changes. That's 906# The asm symlink changes when $(ARCH) changes.
910# hard to detect, but I suppose "make mrproper" is a good idea 907# Detect this and ask user to run make mrproper
911# before switching between archs anyway. 908
912 909include/asm: FORCE
913include/asm: 910 $(Q)set -e; asmlink=`readlink include/asm | cut -d '-' -f 2`; \
914 @echo ' SYMLINK $@ -> include/asm-$(SRCARCH)' 911 if [ -L include/asm ]; then \
915 $(Q)if [ ! -d include ]; then mkdir -p include; fi; 912 if [ "$$asmlink" != "$(SRCARCH)" ]; then \
916 @ln -fsn asm-$(SRCARCH) $@ 913 echo "ERROR: the symlink $@ points to asm-$$asmlink but asm-$(SRCARCH) was expected"; \
914 echo " set ARCH or save .config and run 'make mrproper' to fix it"; \
915 exit 1; \
916 fi; \
917 else \
918 echo ' SYMLINK $@ -> include/asm-$(SRCARCH)'; \
919 if [ ! -d include ]; then \
920 mkdir -p include; \
921 fi; \
922 ln -fsn asm-$(SRCARCH) $@; \
923 fi
917 924
918# Generate some files 925# Generate some files
919# --------------------------------------------------------------------------- 926# ---------------------------------------------------------------------------
@@ -1023,19 +1030,12 @@ _modinst_:
1023 fi 1030 fi
1024 $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modinst 1031 $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modinst
1025 1032
1026# If System.map exists, run depmod. This deliberately does not have a 1033# This depmod is only for convenience to give the initial
1027# dependency on System.map since that would run the dependency tree on
1028# vmlinux. This depmod is only for convenience to give the initial
1029# boot a modules.dep even before / is mounted read-write. However the 1034# boot a modules.dep even before / is mounted read-write. However the
1030# boot script depmod is the master version. 1035# boot script depmod is the master version.
1031ifeq "$(strip $(INSTALL_MOD_PATH))" ""
1032depmod_opts :=
1033else
1034depmod_opts := -b $(INSTALL_MOD_PATH) -r
1035endif
1036PHONY += _modinst_post 1036PHONY += _modinst_post
1037_modinst_post: _modinst_ 1037_modinst_post: _modinst_
1038 if [ -r System.map -a -x $(DEPMOD) ]; then $(DEPMOD) -ae -F System.map $(depmod_opts) $(KERNELRELEASE); fi 1038 $(call cmd,depmod)
1039 1039
1040else # CONFIG_MODULES 1040else # CONFIG_MODULES
1041 1041
@@ -1223,8 +1223,7 @@ else # KBUILD_EXTMOD
1223KBUILD_MODULES := 1 1223KBUILD_MODULES := 1
1224PHONY += crmodverdir 1224PHONY += crmodverdir
1225crmodverdir: 1225crmodverdir:
1226 $(Q)mkdir -p $(MODVERDIR) 1226 $(cmd_crmodverdir)
1227 $(Q)rm -f $(MODVERDIR)/*
1228 1227
1229PHONY += $(objtree)/Module.symvers 1228PHONY += $(objtree)/Module.symvers
1230$(objtree)/Module.symvers: 1229$(objtree)/Module.symvers:
@@ -1252,15 +1251,6 @@ _emodinst_:
1252 $(Q)mkdir -p $(MODLIB)/$(install-dir) 1251 $(Q)mkdir -p $(MODLIB)/$(install-dir)
1253 $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modinst 1252 $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modinst
1254 1253
1255# Run depmod only is we have System.map and depmod is executable
1256quiet_cmd_depmod = DEPMOD $(KERNELRELEASE)
1257 cmd_depmod = if [ -r System.map -a -x $(DEPMOD) ]; then \
1258 $(DEPMOD) -ae -F System.map \
1259 $(if $(strip $(INSTALL_MOD_PATH)), \
1260 -b $(INSTALL_MOD_PATH) -r) \
1261 $(KERNELRELEASE); \
1262 fi
1263
1264PHONY += _emodinst_post 1254PHONY += _emodinst_post
1265_emodinst_post: _emodinst_ 1255_emodinst_post: _emodinst_
1266 $(call cmd,depmod) 1256 $(call cmd,depmod)
@@ -1344,7 +1334,7 @@ define find-sources
1344 find $(__srctree)include/asm-generic $(RCS_FIND_IGNORE) \ 1334 find $(__srctree)include/asm-generic $(RCS_FIND_IGNORE) \
1345 -name $1 -print; \ 1335 -name $1 -print; \
1346 find $(__srctree) $(RCS_FIND_IGNORE) \ 1336 find $(__srctree) $(RCS_FIND_IGNORE) \
1347 \( -name include -o -name arch \) -prune -o \ 1337 \( -name include -o -name arch -o -name '.tmp_*' \) -prune -o \
1348 -name $1 -print; \ 1338 -name $1 -print; \
1349 ) 1339 )
1350endef 1340endef
@@ -1493,9 +1483,11 @@ endif
1493 1483
1494# Modules 1484# Modules
1495/ %/: prepare scripts FORCE 1485/ %/: prepare scripts FORCE
1486 $(cmd_crmodverdir)
1496 $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \ 1487 $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \
1497 $(build)=$(build-dir) 1488 $(build)=$(build-dir)
1498%.ko: prepare scripts FORCE 1489%.ko: prepare scripts FORCE
1490 $(cmd_crmodverdir)
1499 $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \ 1491 $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \
1500 $(build)=$(build-dir) $(@:.ko=.o) 1492 $(build)=$(build-dir) $(@:.ko=.o)
1501 $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost 1493 $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost
@@ -1509,6 +1501,19 @@ quiet_cmd_rmdirs = $(if $(wildcard $(rm-dirs)),CLEAN $(wildcard $(rm-dirs)))
1509quiet_cmd_rmfiles = $(if $(wildcard $(rm-files)),CLEAN $(wildcard $(rm-files))) 1501quiet_cmd_rmfiles = $(if $(wildcard $(rm-files)),CLEAN $(wildcard $(rm-files)))
1510 cmd_rmfiles = rm -f $(rm-files) 1502 cmd_rmfiles = rm -f $(rm-files)
1511 1503
1504# Run depmod only is we have System.map and depmod is executable
1505# and we build for the host arch
1506quiet_cmd_depmod = DEPMOD $(KERNELRELEASE)
1507 cmd_depmod = \
1508 if [ -r System.map -a -x $(DEPMOD) -a "$(SUBARCH)" == "$(ARCH)" ]; then \
1509 $(DEPMOD) -ae -F System.map \
1510 $(if $(strip $(INSTALL_MOD_PATH)), -b $(INSTALL_MOD_PATH) -r) \
1511 $(KERNELRELEASE); \
1512 fi
1513
1514# Create temporary dir for module support files
1515cmd_crmodverdir = $(Q)mkdir -p $(MODVERDIR); rm -f $(MODVERDIR)/*
1516
1512 1517
1513a_flags = -Wp,-MD,$(depfile) $(KBUILD_AFLAGS) $(AFLAGS_KERNEL) \ 1518a_flags = -Wp,-MD,$(depfile) $(KBUILD_AFLAGS) $(AFLAGS_KERNEL) \
1514 $(NOSTDINC_FLAGS) $(KBUILD_CPPFLAGS) \ 1519 $(NOSTDINC_FLAGS) $(KBUILD_CPPFLAGS) \
diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include
index de7bb284c611..b96ea8d6a5ed 100644
--- a/scripts/Kbuild.include
+++ b/scripts/Kbuild.include
@@ -56,6 +56,17 @@ endef
56# gcc support functions 56# gcc support functions
57# See documentation in Documentation/kbuild/makefiles.txt 57# See documentation in Documentation/kbuild/makefiles.txt
58 58
59# cc-cross-prefix
60# Usage: CROSS_COMPILE := $(call cc-cross-prefix, m68k-linux-gnu- m68k-linux-)
61# Return first prefix where a prefix$(CC) is found in PATH.
62# If no $(CC) found in PATH with listed prefixes return nothing
63cc-cross-prefix = \
64 $(word 1, $(foreach c,$(1), \
65 $(shell set -e; \
66 if (which $(strip $(c))$(CC)) > /dev/null 2>&1 ; then \
67 echo $(c); \
68 fi)))
69
59# output directory for tests below 70# output directory for tests below
60TMPOUT := $(if $(KBUILD_EXTMOD),$(firstword $(KBUILD_EXTMOD))/) 71TMPOUT := $(if $(KBUILD_EXTMOD),$(firstword $(KBUILD_EXTMOD))/)
61 72
diff --git a/scripts/basic/docproc.c b/scripts/basic/docproc.c
index e5c6ac7bde9b..0e4bd5459df4 100644
--- a/scripts/basic/docproc.c
+++ b/scripts/basic/docproc.c
@@ -66,12 +66,15 @@ FILELINE * entity_system;
66#define FUNCTION "-function" 66#define FUNCTION "-function"
67#define NOFUNCTION "-nofunction" 67#define NOFUNCTION "-nofunction"
68 68
69char *srctree;
70
69void usage (void) 71void usage (void)
70{ 72{
71 fprintf(stderr, "Usage: docproc {doc|depend} file\n"); 73 fprintf(stderr, "Usage: docproc {doc|depend} file\n");
72 fprintf(stderr, "Input is read from file.tmpl. Output is sent to stdout\n"); 74 fprintf(stderr, "Input is read from file.tmpl. Output is sent to stdout\n");
73 fprintf(stderr, "doc: frontend when generating kernel documentation\n"); 75 fprintf(stderr, "doc: frontend when generating kernel documentation\n");
74 fprintf(stderr, "depend: generate list of files referenced within file\n"); 76 fprintf(stderr, "depend: generate list of files referenced within file\n");
77 fprintf(stderr, "Environment variable SRCTREE: absolute path to kernel source tree.\n");
75} 78}
76 79
77/* 80/*
@@ -90,7 +93,7 @@ void exec_kernel_doc(char **svec)
90 exit(1); 93 exit(1);
91 case 0: 94 case 0:
92 memset(real_filename, 0, sizeof(real_filename)); 95 memset(real_filename, 0, sizeof(real_filename));
93 strncat(real_filename, getenv("SRCTREE"), PATH_MAX); 96 strncat(real_filename, srctree, PATH_MAX);
94 strncat(real_filename, KERNELDOCPATH KERNELDOC, 97 strncat(real_filename, KERNELDOCPATH KERNELDOC,
95 PATH_MAX - strlen(real_filename)); 98 PATH_MAX - strlen(real_filename));
96 execvp(real_filename, svec); 99 execvp(real_filename, svec);
@@ -171,7 +174,7 @@ void find_export_symbols(char * filename)
171 if (filename_exist(filename) == NULL) { 174 if (filename_exist(filename) == NULL) {
172 char real_filename[PATH_MAX + 1]; 175 char real_filename[PATH_MAX + 1];
173 memset(real_filename, 0, sizeof(real_filename)); 176 memset(real_filename, 0, sizeof(real_filename));
174 strncat(real_filename, getenv("SRCTREE"), PATH_MAX); 177 strncat(real_filename, srctree, PATH_MAX);
175 strncat(real_filename, filename, 178 strncat(real_filename, filename,
176 PATH_MAX - strlen(real_filename)); 179 PATH_MAX - strlen(real_filename));
177 sym = add_new_file(filename); 180 sym = add_new_file(filename);
@@ -338,6 +341,10 @@ void parse_file(FILE *infile)
338int main(int argc, char *argv[]) 341int main(int argc, char *argv[])
339{ 342{
340 FILE * infile; 343 FILE * infile;
344
345 srctree = getenv("SRCTREE");
346 if (!srctree)
347 srctree = getcwd(NULL, 0);
341 if (argc != 3) { 348 if (argc != 3) {
342 usage(); 349 usage();
343 exit(1); 350 exit(1);
diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
index bb08069b04af..83c5e76414ce 100644
--- a/scripts/kconfig/Makefile
+++ b/scripts/kconfig/Makefile
@@ -84,7 +84,7 @@ help:
84# lxdialog stuff 84# lxdialog stuff
85check-lxdialog := $(srctree)/$(src)/lxdialog/check-lxdialog.sh 85check-lxdialog := $(srctree)/$(src)/lxdialog/check-lxdialog.sh
86 86
87# Use reursively expanded variables so we do not call gcc unless 87# Use recursively expanded variables so we do not call gcc unless
88# we really need to do so. (Do not call gcc as part of make mrproper) 88# we really need to do so. (Do not call gcc as part of make mrproper)
89HOST_EXTRACFLAGS = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ccflags) 89HOST_EXTRACFLAGS = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ccflags)
90HOST_LOADLIBES = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ldflags $(HOSTCC)) 90HOST_LOADLIBES = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ldflags $(HOSTCC))
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 2ef9a193fcae..93ac52adb498 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -268,6 +268,9 @@ static struct symbol *sym_add_exported(const char *name, struct module *mod,
268 "was in %s%s\n", mod->name, name, 268 "was in %s%s\n", mod->name, name,
269 s->module->name, 269 s->module->name,
270 is_vmlinux(s->module->name) ?"":".ko"); 270 is_vmlinux(s->module->name) ?"":".ko");
271 } else {
272 /* In case Modules.symvers was out of date */
273 s->module = mod;
271 } 274 }
272 } 275 }
273 s->preloaded = 0; 276 s->preloaded = 0;
diff --git a/scripts/package/builddeb b/scripts/package/builddeb
index 6edb29f2b4a6..0f657b5f3bc8 100644
--- a/scripts/package/builddeb
+++ b/scripts/package/builddeb
@@ -83,6 +83,7 @@ Maintainer: $name
83Standards-Version: 3.6.1 83Standards-Version: 3.6.1
84 84
85Package: $packagename 85Package: $packagename
86Provides: kernel-image-$version, linux-image-$version
86Architecture: any 87Architecture: any
87Description: User Mode Linux kernel, version $version 88Description: User Mode Linux kernel, version $version
88 User-mode Linux is a port of the Linux kernel to its own system call 89 User-mode Linux is a port of the Linux kernel to its own system call
@@ -104,6 +105,7 @@ Maintainer: $name
104Standards-Version: 3.6.1 105Standards-Version: 3.6.1
105 106
106Package: $packagename 107Package: $packagename
108Provides: kernel-image-$version, linux-image-$version
107Architecture: any 109Architecture: any
108Description: Linux kernel, version $version 110Description: Linux kernel, version $version
109 This package contains the Linux kernel, modules and corresponding other 111 This package contains the Linux kernel, modules and corresponding other