bk://linux-sam.bkbits.net/kbuild
vda@port.imtp.ilyichevsk.odessa.ua|ChangeSet|20041017094859|24918 vda

# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
#   2004/10/21 14:34:41-07:00 akpm@bix.(none) 
#   Merge bix.(none):/usr/src/bk25 into bix.(none):/usr/src/bk-kbuild
# 
# Documentation/DocBook/Makefile
#   2004/10/21 14:34:37-07:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/10/21 00:47:21-07:00 akpm@bix.(none) 
#   Merge bix.(none):/usr/src/bk25 into bix.(none):/usr/src/bk-kbuild
# 
# lib/Kconfig.debug
#   2004/10/21 00:47:17-07:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# init/Kconfig
#   2004/10/21 00:47:17-07:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# arch/i386/Makefile
#   2004/10/21 00:47:17-07:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/10/19 23:11:06-07:00 akpm@bix.(none) 
#   Merge bix.(none):/usr/src/bk25 into bix.(none):/usr/src/bk-kbuild
# 
# init/Kconfig
#   2004/10/19 23:11:02-07:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# arch/arm/Makefile
#   2004/10/19 23:11:02-07:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/10/18 20:30:44-07:00 akpm@bix.(none) 
#   Merge bk://linux-sam.bkbits.net/kbuild
#   into bix.(none):/usr/src/bk-kbuild
# 
# init/Kconfig
#   2004/10/18 20:30:38-07:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# Makefile
#   2004/10/18 20:30:38-07:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/10/17 11:48:59+02:00 vda@port.imtp.ilyichevsk.odessa.ua 
#   kbuild: make gcc -align options .config-settable
#   
#   With all alignment options set to 1 (minimum alignment),
#   I've got 5% smaller vmlinux compared to one built with
#   default code alignment.
#   Original implementation altered to use cc-option-align by sam.
#   
#   From: Denis Vlasenko <vda@port.imtp.ilyichevsk.odessa.ua>
#   Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
# 
# init/Kconfig
#   2004/10/17 02:03:21+02:00 vda@port.imtp.ilyichevsk.odessa.ua +37 -0
#   kbuild: make gcc -align options .config-settable
# 
# Makefile
#   2004/10/17 11:44:55+02:00 vda@port.imtp.ilyichevsk.odessa.ua +7 -0
#   kbuild: make gcc -align options .config-settable
# 
# ChangeSet
#   2004/10/17 11:41:54+02:00 sam@mars.ravnborg.org 
#   kbuild: Add cc-option-align
#   
#   gcc version >= 3.00 shifted from -malign-* to -falign-*. $(cc-option-align) will
#   based on current gcc version specify the right prefix for the align option.
#   Documented in Documentation/makefiles.txt
#   
#   Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
# 
# arch/i386/Makefile
#   2004/10/17 11:41:36+02:00 sam@mars.ravnborg.org +1 -1
#   Use cc-option-align from top-level Makefile
# 
# Makefile
#   2004/10/17 11:41:36+02:00 sam@mars.ravnborg.org +5 -0
#   Introduced cc-option-align
# 
# Documentation/kbuild/makefiles.txt
#   2004/10/17 11:41:36+02:00 sam@mars.ravnborg.org +15 -0
#   Documented cc-option-align
# 
# ChangeSet
#   2004/10/17 02:01:07+02:00 sam@mars.ravnborg.org 
#   kbuild: explicit enable framepointer
#   
#   Newer gcc versions automatically turns on -fomit-frame-pointer when
#   -O2 is specified thus breaking CONFIG_FRAME_POINTER option.
#   Explicitly specifying -fno-omit-frame-pointer fixes it.
#   
#   From: Tejun Heo <tj@home-tj.org>
#   Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
# 
# Makefile
#   2004/10/17 02:00:48+02:00 sam@mars.ravnborg.org +3 -1
#   Newer gcc versions automatically turns on -fomit-frame-pointer when
#   -O2 is specified thus breaking CONFIG_FRAME_POINTER option.
#   Explicitly specifying -fno-omit-frame-pointer fixes it.
# 
# ChangeSet
#   2004/10/17 01:55:32+02:00 sam@mars.ravnborg.org 
#   kbuild: use two double-quotes for localversion
#   
#   Modifies LOCALVERSION definition such that it uses
#   patsubst instead of subst to remove surrounding double quotes from
#   CONFIG_LOCALVERSION.  This helps syntax-highlighting editors.
#   
#   From: Tejun Heo <tj@home-tj.org>
#   Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
# 
# Makefile
#   2004/10/17 01:55:11+02:00 sam@mars.ravnborg.org +1 -1
#   Use two double qutes so editors do not get confused
# 
# ChangeSet
#   2004/10/17 01:17:08+02:00 sam@mars.ravnborg.org 
#   kbuild: Create Makefile in output dir for *config targets
#   
#   Upon request from Andi Kleen the Makefile is now created for *config
#   targets also. So the MAkefile in the output directory is present when
#   it is expected (after kernel configuration).
#   Also tell user the Makefile is generated.
#   
#   Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
# 
# Makefile
#   2004/10/17 01:16:51+02:00 sam@mars.ravnborg.org +19 -14
#   Create a Makefile in output directory for *config targets and
#   tell user a Makefile is generated.
# 
# ChangeSet
#   2004/10/16 23:51:27+02:00 trini@kernel.crashing.org 
#   kbuild: fix 'htmldocs' and friends with O=
#   
#   The following patch fixes up 'htmldocs' and related to work when
#   trees are being built with O=.  I fixed it all up by passing the srctree
#   as an env-var to docproc (and thus what it calls) and then pull that out
#   when needed.
#   
#   Signed-off-by: Tom Rini <trini@kernel.crashing.org>
#   Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
# 
# scripts/kernel-doc
#   2004/10/16 02:00:00+02:00 trini@kernel.crashing.org +1 -1
#   kbuild: fix 'htmldocs' and friends with O=
# 
# scripts/basic/docproc.c
#   2004/10/16 02:00:00+02:00 trini@kernel.crashing.org +15 -4
#   kbuild: fix 'htmldocs' and friends with O=
# 
# Documentation/DocBook/Makefile
#   2004/10/16 02:00:00+02:00 trini@kernel.crashing.org +5 -2
#   kbuild: fix 'htmldocs' and friends with O=
# 
# ChangeSet
#   2004/10/16 23:48:22+02:00 agruen@suse.de 
#   kbuild: Allow install of external modules to custom path
#   
#   Currently, a ``make modules_install'' for an external module will
#   install that module into /lib/modules/$(uname -r)/extra. Allow to
#   override this default by specifying INSTALL_MOD_DIR.
#   
#   Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
#   Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
# 
# scripts/Makefile.modinst
#   2004/10/16 02:00:00+02:00 agruen@suse.de +4 -1
#   kbuild: Allow install of external modules to custom path
# 
# ChangeSet
#   2004/10/16 23:26:48+02:00 rddunlap@osdl.org 
#   kconfig: OVERRIDE: save kernel version in .config file
#   
#   Omit .config file timestamp in the file if the environment variable
#   "KCONFIG_NOTIMESTAMP" exists and is non-null.
#   
#   Signed-off-by: Randy Dunlap <rddunlap@osdl.org>
#   Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
# 
# scripts/kconfig/confdata.c
#   2004/09/17 18:31:23+02:00 rddunlap@osdl.org +12 -4
#   kconfig: OVERRIDE: save kernel version in .config file
# 
# ChangeSet
#   2004/10/16 23:03:11+02:00 vda@port.imtp.ilyichevsk.odessa.ua 
#   kconfig.debug: mention that DEBUG_SLAB can slow down machine quite a bit
#   
#   I experienced x3 slowdown due to this option being set.
#   
#   Please add this small warning to DEBUG_SLAB help text.
#   
#   Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
# 
# lib/Kconfig.debug
#   2004/09/16 13:19:28+02:00 vda@port.imtp.ilyichevsk.odessa.ua +1 -1
#   kconfig.debug: mention that DEBUG_SLAB can slow down machine quite a bit
# 
# ChangeSet
#   2004/10/09 21:44:52-07:00 akpm@bix.(none) 
#   Merge bix.(none):/usr/src/bk25 into bix.(none):/usr/src/bk-kbuild
# 
# arch/arm/Makefile
#   2004/10/09 21:44:48-07:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/10/05 22:37:06-07:00 akpm@bix.(none) 
#   Merge bix.(none):/usr/src/bk25 into bix.(none):/usr/src/bk-kbuild
# 
# arch/ppc/Makefile
#   2004/10/05 22:37:02-07:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# arch/arm/Makefile
#   2004/10/05 22:37:02-07:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/09/14 14:45:36-07:00 akpm@bix.(none) 
#   Merge bix.(none):/usr/src/bk25 into bix.(none):/usr/src/bk-kbuild
# 
# arch/ppc/Makefile
#   2004/09/14 14:45:31-07:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/09/11 15:15:15-07:00 akpm@bix.(none) 
#   Merge bix.(none):/usr/src/bk25 into bix.(none):/usr/src/bk-kbuild
# 
# init/Kconfig
#   2004/09/11 15:15:10-07:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# arch/ppc/Makefile
#   2004/09/11 15:15:10-07:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# arch/arm/Makefile
#   2004/09/11 15:15:10-07:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/09/08 22:20:41-07:00 akpm@bix.(none) 
#   Merge bk://linux-sam.bkbits.net/kbuild
#   into bix.(none):/usr/src/bk-kbuild
# 
# init/Kconfig
#   2004/09/08 22:20:36-07:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# arch/ppc/Makefile
#   2004/09/08 22:20:36-07:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/09/07 21:15:17-07:00 akpm@bix.(none) 
#   Merge bix.(none):/usr/src/bk25 into bix.(none):/usr/src/bk-kbuild
# 
# arch/arm/Makefile
#   2004/09/07 21:15:13-07:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/09/05 15:42:40-07:00 akpm@bix.(none) 
#   Merge
# 
# init/Kconfig
#   2004/09/05 15:42:36-07:00 akpm@bix.(none) +0 -0
#   SCCS merged
# 
diff -Nru a/Documentation/DocBook/Makefile b/Documentation/DocBook/Makefile
--- a/Documentation/DocBook/Makefile	2004-10-21 14:35:49 -07:00
+++ b/Documentation/DocBook/Makefile	2004-10-21 14:35:49 -07:00
@@ -58,14 +58,14 @@
 # The following rules are used to generate the .sgml documentation
 # required to generate the final targets. (ps, pdf, html).
 quiet_cmd_docproc = DOCPROC $@
-      cmd_docproc = $(DOCPROC) doc $< >$@
+      cmd_docproc = SRCTREE=$(srctree)/ $(DOCPROC) doc $< >$@
 define rule_docproc
 	set -e;								\
         $(if $($(quiet)cmd_$(1)),echo '  $($(quiet)cmd_$(1))';) 	\
         $(cmd_$(1)); 							\
         ( 								\
           echo 'cmd_$@ := $(cmd_$(1))'; 				\
-          echo $@: `$(DOCPROC) depend $<`; 				\
+          echo $@: `SRCTREE=$(srctree) $(DOCPROC) depend $<`; 		\
         ) > $(dir $@).$(notdir $@).cmd
 endef
 
@@ -129,6 +129,9 @@
 # Rule to generate man files - output is placed in the man subdirectory
 
 %.9:	%.sgml
+ifneq ($(KBUILD_SRC),)
+	$(Q)mkdir -p $(objtree)/Documentation/DocBook/man
+endif
 	$(SPLITMAN) $< $(objtree)/Documentation/DocBook/man "$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)"
 	$(MAKEMAN) convert $(objtree)/Documentation/DocBook/man $<
 
diff -Nru a/Documentation/kbuild/makefiles.txt b/Documentation/kbuild/makefiles.txt
--- a/Documentation/kbuild/makefiles.txt	2004-10-21 14:35:49 -07:00
+++ b/Documentation/kbuild/makefiles.txt	2004-10-21 14:35:49 -07:00
@@ -997,6 +997,21 @@
 	option. When $(biarch) equals to y the expanded variables $(aflags-y)
 	and $(cflags-y) will be assigned the values -a32 and -m32.
 
+    cc-option-align
+	gcc version >= 3.0 shifted type of options used to speify
+	alignment of functions, loops etc. $(cc-option-align) whrn used
+	as prefix to the align options will select the right prefix:
+	gcc < 3.00
+		cc-option-align = -malign
+	gcc >= 3.00
+		cc-option-align = -falign
+	
+	Example:
+		CFLAGS += $(cc-option-align)-functions=4
+
+	In the above example the option -falign-functions=4 is used for
+	gcc >= 3.00. For gcc < 3.00 -malign-functions=4 is used.
+	
     cc-version
 	cc-version return a numerical version of the $(CC) compiler version.
 	The format is <major><minor> where both are two digits. So for example
diff -Nru a/Makefile b/Makefile
--- a/Makefile	2004-10-21 14:35:49 -07:00
+++ b/Makefile	2004-10-21 14:35:49 -07:00
@@ -157,7 +157,7 @@
 
 LOCALVERSION = $(subst $(space),, \
 	       $(shell cat /dev/null $(localversion-files)) \
-	       $(subst ",,$(CONFIG_LOCALVERSION)))
+	       $(patsubst "%",%,$(CONFIG_LOCALVERSION)))
 
 KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)$(LOCALVERSION)
 
@@ -295,6 +295,11 @@
 cc-option-yn = $(shell if $(CC) $(CFLAGS) $(1) -S -o /dev/null -xc /dev/null \
                 > /dev/null 2>&1; then echo "y"; else echo "n"; fi;)
 
+# cc-option-align
+# Prefix align with either -falign or -malign
+cc-option-align = $(subst -functions=0,,\
+	$(call cc-option,-falign-functions=0,-malign-functions=0))
+
 # cc-version
 # Usage gcc-ver := $(call cc-version $(CC))
 cc-version = $(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-version.sh \
@@ -379,6 +384,18 @@
 scripts_basic:
 	$(Q)$(MAKE) $(build)=scripts/basic
 
+.PHONY: outputmakefile
+# outputmakefile generate a Makefile to be placed in output directory, if
+# using a seperate output directory. This allows convinient use
+# of make in output directory
+outputmakefile:
+	$(Q)if /usr/bin/env test ! $(srctree) -ef $(objtree); then \
+	$(CONFIG_SHELL) $(srctree)/scripts/mkmakefile              \
+	    $(srctree) $(objtree) $(VERSION) $(PATCHLEVEL)         \
+	    > $(objtree)/Makefile;                                 \
+	    echo '  GEN    $(objtree)/Makefile';                   \
+	fi
+
 # To make sure we do not include .config for any of the *config targets
 # catch them early, and hand them over to scripts/kconfig/Makefile
 # It is allowed to specify more targets when calling make, including
@@ -423,9 +440,9 @@
 # *config targets only - make sure prerequisites are updated, and descend
 # in scripts/kconfig to make the *config target
 
-config: scripts_basic FORCE
+config: scripts_basic outputmakefile FORCE
 	$(Q)$(MAKE) $(build)=scripts/kconfig $@
-%config: scripts_basic FORCE
+%config: scripts_basic outputmakefile FORCE
 	$(Q)$(MAKE) $(build)=scripts/kconfig $@
 
 else
@@ -486,7 +503,16 @@
 CFLAGS		+= -O2
 endif
 
-ifndef CONFIG_FRAME_POINTER
+#Add align options if CONFIG_CC_* is not equal to 0
+add-align = $(if $(filter-out 0,$($(1))),$(cc-option-align)$(2)=$($(1)))
+CFLAGS		+= $(call add-align,CONFIG_CC_ALIGN_FUNCTIONS,-functions)
+CFLAGS		+= $(call add-align,CONFIG_CC_ALIGN_LABELS,-labels)
+CFLAGS		+= $(call add-align,CONFIG_CC_ALIGN_LOOPS,-loops)
+CFLAGS		+= $(call add-align,CONFIG_CC_ALIGN_JUMPS,-jumps)
+
+ifdef CONFIG_FRAME_POINTER
+CFLAGS		+= -fno-omit-frame-pointer
+else
 CFLAGS		+= -fomit-frame-pointer
 endif
 
@@ -711,22 +737,12 @@
 
 .PHONY: prepare-all prepare prepare0 prepare1 prepare2
 
-# prepare 2 generate Makefile to be placed in output directory, if
-# using a seperate output directory. This allows convinient use
-# of make in output directory
-prepare2:
-	$(Q)if /usr/bin/env test ! $(srctree) -ef $(objtree); then \
-	$(CONFIG_SHELL) $(srctree)/scripts/mkmakefile              \
-	    $(srctree) $(objtree) $(VERSION) $(PATCHLEVEL)         \
-	    > $(objtree)/Makefile;                                 \
-	fi
-
-# prepare1 is used to check if we are building in a separate output directory,
+# prepare2 is used to check if we are building in a separate output directory,
 # and if so do:
 # 1) Check that make has not been executed in the kernel src $(srctree)
 # 2) Create the include2 directory, used for the second asm symlink
 
-prepare1: prepare2
+prepare2:
 ifneq ($(KBUILD_SRC),)
 	@echo '  Using $(srctree) as source for kernel'
 	$(Q)if [ -h $(srctree)/include/asm -o -f $(srctree)/.config ]; then \
@@ -737,6 +753,9 @@
 	$(Q)if [ ! -d include2 ]; then mkdir -p include2; fi;
 	$(Q)ln -fsn $(srctree)/include/asm-$(ARCH) include2/asm
 endif
+
+# prepare1 creates a makefile if using a separate output directory
+prepare1: prepare2 outputmakefile
 
 prepare0: prepare1 include/linux/version.h include/asm include/config/MARKER
 ifneq ($(KBUILD_MODULES),)
diff -Nru a/arch/i386/Makefile b/arch/i386/Makefile
--- a/arch/i386/Makefile	2004-10-21 14:35:49 -07:00
+++ b/arch/i386/Makefile	2004-10-21 14:35:49 -07:00
@@ -25,7 +25,7 @@
 # prevent gcc from keeping the stack 16 byte aligned
 CFLAGS += $(call cc-option,-mpreferred-stack-boundary=2)
 
-align := $(subst -functions=0,,$(call cc-option,-falign-functions=0,-malign-functions=0))
+align := $(cc-option-align)
 cflags-$(CONFIG_M386)		+= -march=i386
 cflags-$(CONFIG_M486)		+= -march=i486
 cflags-$(CONFIG_M586)		+= -march=i586
diff -Nru a/init/Kconfig b/init/Kconfig
--- a/init/Kconfig	2004-10-21 14:35:49 -07:00
+++ b/init/Kconfig	2004-10-21 14:35:49 -07:00
@@ -322,6 +322,43 @@
 	  option replaces shmem and tmpfs with the much simpler ramfs code,
 	  which may be appropriate on small systems without swap.
 
+config CC_ALIGN_FUNCTIONS
+	int "Function alignment"
+	default 0
+	help
+	  Align the start of functions to the next power-of-two greater than n,
+	  skipping up to n bytes.  For instance, 32 aligns functions
+	  to the next 32-byte boundary, but 24 would align to the next
+	  32-byte boundary only if this can be done by skipping 23 bytes or less.
+	  Zero means use compiler's default.
+
+config CC_ALIGN_LABELS
+	int "Label alignment"
+	default 0
+	help
+	  Align all branch targets to a power-of-two boundary, skipping
+	  up to n bytes like ALIGN_FUNCTIONS.  This option can easily
+	  make code slower, because it must insert dummy operations for
+	  when the branch target is reached in the usual flow of the code.
+	  Zero means use compiler's default.
+
+config CC_ALIGN_LOOPS
+	int "Loop alignment"
+	default 0
+	help
+	  Align loops to a power-of-two boundary, skipping up to n bytes.
+	  Zero means use compiler's default.
+
+config CC_ALIGN_JUMPS
+	int "Jump alignment"
+	default 0
+	help
+	  Align branch targets to a power-of-two boundary, for branch
+	  targets where the targets can only be reached by jumping,
+	  skipping up to n bytes like ALIGN_FUNCTIONS.  In this case,
+	  no dummy operations need be executed.
+	  Zero means use compiler's default.
+
 endmenu		# General setup
 
 config TINY_SHMEM
diff -Nru a/lib/Kconfig.debug b/lib/Kconfig.debug
--- a/lib/Kconfig.debug	2004-10-21 14:35:49 -07:00
+++ b/lib/Kconfig.debug	2004-10-21 14:35:49 -07:00
@@ -46,7 +46,7 @@
 	help
 	  Say Y here to have the kernel do limited verification on memory
 	  allocation as well as poisoning memory on free to catch use of freed
-	  memory.
+	  memory. This can make kmalloc/kfree-intensive workloads much slower.
 
 config DEBUG_SPINLOCK
 	bool "Spinlock debugging"
diff -Nru a/scripts/Makefile.modinst b/scripts/Makefile.modinst
--- a/scripts/Makefile.modinst	2004-10-21 14:35:49 -07:00
+++ b/scripts/Makefile.modinst	2004-10-21 14:35:49 -07:00
@@ -19,7 +19,10 @@
 quiet_cmd_modules_install = INSTALL $@
       cmd_modules_install = mkdir -p $(2); cp $@ $(2)
 
-modinst_dir = $(MODLIB)/$(if $(filter ../% /%,$@),extra/,kernel/$(@D))
+# Modules built outside the kernel source tree go into extra by default
+INSTALL_MOD_DIR ?= extra
+
+modinst_dir = $(MODLIB)/$(if $(filter ../% /%,$@),$(INSTALL_MOD_DIR)/,kernel/$(@D))
 
 $(modules):
 	$(call cmd,modules_install,$(modinst_dir))
diff -Nru a/scripts/basic/docproc.c b/scripts/basic/docproc.c
--- a/scripts/basic/docproc.c	2004-10-21 14:35:49 -07:00
+++ b/scripts/basic/docproc.c	2004-10-21 14:35:49 -07:00
@@ -79,6 +79,7 @@
 {
 	pid_t pid;
 	int ret;
+	char real_filename[PATH_MAX + 1];
 	/* Make sure output generated so far are flushed */
 	fflush(stdout);
 	switch(pid=fork()) {
@@ -86,8 +87,13 @@
 			perror("fork");
 			exit(1);
 		case  0:
-			execvp(KERNELDOCPATH KERNELDOC, svec);
-			perror("exec " KERNELDOCPATH KERNELDOC);
+			memset(real_filename, 0, sizeof(real_filename));
+			strncat(real_filename, getenv("SRCTREE"), PATH_MAX);
+			strncat(real_filename, KERNELDOCPATH KERNELDOC,
+					PATH_MAX - strlen(real_filename));
+			execvp(real_filename, svec);
+			fprintf(stderr, "exec ");
+			perror(real_filename);
 			exit(1);
 		default:
 			waitpid(pid, &ret ,0);
@@ -160,12 +166,17 @@
 	struct symfile *sym;
 	char line[MAXLINESZ];
 	if (filename_exist(filename) == NULL) {
+		char real_filename[PATH_MAX + 1];
+		memset(real_filename, 0, sizeof(real_filename));
+		strncat(real_filename, getenv("SRCTREE"), PATH_MAX);
+		strncat(real_filename, filename,
+				PATH_MAX - strlen(real_filename));
 		sym = add_new_file(filename);
-		fp = fopen(filename, "r");
+		fp = fopen(real_filename, "r");
 		if (fp == NULL)
 		{
 			fprintf(stderr, "docproc: ");
-			perror(filename);
+			perror(real_filename);
 		}
 		while(fgets(line, MAXLINESZ, fp)) {
 			char *p;
diff -Nru a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c
--- a/scripts/kconfig/confdata.c	2004-10-21 14:35:49 -07:00
+++ b/scripts/kconfig/confdata.c	2004-10-21 14:35:49 -07:00
@@ -270,6 +270,8 @@
 	int type, l;
 	const char *str;
 	time_t now;
+	int use_timestamp = 1;
+	char *env;
 
 	dirname[0] = 0;
 	if (name && name[0]) {
@@ -306,22 +308,28 @@
 	sym = sym_lookup("KERNELRELEASE", 0);
 	sym_calc_value(sym);
 	time(&now);
+	env = getenv("KCONFIG_NOTIMESTAMP");
+	if (env && *env)
+		use_timestamp = 0;
+
 	fprintf(out, "#\n"
 		     "# Automatically generated make config: don't edit\n"
 		     "# Linux kernel version: %s\n"
-		     "# %s"
+		     "%s%s"
 		     "#\n",
 		     sym_get_string_value(sym),
-		     ctime(&now));
+		     use_timestamp ? "# " : "",
+		     use_timestamp ? ctime(&now) : "");
 	if (out_h)
 		fprintf(out_h, "/*\n"
 			       " * Automatically generated C config: don't edit\n"
 			       " * Linux kernel version: %s\n"
-			       " * %s"
+			       "%s%s"
 			       " */\n"
 			       "#define AUTOCONF_INCLUDED\n",
 			       sym_get_string_value(sym),
-			       ctime(&now));
+			       use_timestamp ? " * " : "",
+			       use_timestamp ? ctime(&now) : "");
 
 	if (!sym_change_count)
 		sym_clear_all_valid();
diff -Nru a/scripts/kernel-doc b/scripts/kernel-doc
--- a/scripts/kernel-doc	2004-10-21 14:35:49 -07:00
+++ b/scripts/kernel-doc	2004-10-21 14:35:49 -07:00
@@ -1531,7 +1531,7 @@
 }
 
 sub process_file($) {
-    my ($file) = @_;
+    my ($file) = "$ENV{'SRCTREE'}@_";
     my $identifier;
     my $func;
     my $initial_section_counter = $section_counter;
