Skip to content

Commit 264a268

Browse files
sravnborgmichal42
authored andcommitted
kbuild: move autoconf.h to include/generated
Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Michal Marek <mmarek@suse.cz>
1 parent 98b8788 commit 264a268

File tree

7 files changed

+16
-15
lines changed

7 files changed

+16
-15
lines changed

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ Module.symvers
4646
# Generated include files
4747
#
4848
include/config
49-
include/linux/autoconf.h
5049
include/linux/version.h
5150
include/linux/utsrelease.h
5251
include/generated

Documentation/kbuild/kconfig.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,8 @@ This environment variable can be set to specify the path & name of the
106106
KCONFIG_AUTOHEADER
107107
--------------------------------------------------
108108
This environment variable can be set to specify the path & name of the
109-
"autoconf.h" (header) file. Its default value is "include/linux/autoconf.h".
109+
"autoconf.h" (header) file.
110+
Its default value is "include/generated/autoconf.h".
110111

111112

112113
======================================================================

Makefile

+6-5
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ CFLAGS_GCOV = -fprofile-arcs -ftest-coverage
336336
# Needed to be compatible with the O= option
337337
LINUXINCLUDE := -I$(srctree)/arch/$(hdr-arch)/include -Iinclude \
338338
$(if $(KBUILD_SRC), -I$(srctree)/include) \
339-
-include include/linux/autoconf.h
339+
-include include/generated/autoconf.h
340340

341341
KBUILD_CPPFLAGS := -D__KERNEL__
342342

@@ -492,17 +492,18 @@ $(KCONFIG_CONFIG) include/config/auto.conf.cmd: ;
492492
# if auto.conf.cmd is missing then we are probably in a cleaned tree so
493493
# we execute the config step to be sure to catch updated Kconfig files
494494
include/config/auto.conf: $(KCONFIG_CONFIG) include/config/auto.conf.cmd
495+
$(Q)mkdir -p include/generated
495496
$(Q)$(MAKE) -f $(srctree)/Makefile silentoldconfig
496497
else
497-
# external modules needs include/linux/autoconf.h and include/config/auto.conf
498+
# external modules needs include/generated/autoconf.h and include/config/auto.conf
498499
# but do not care if they are up-to-date. Use auto.conf to trigger the test
499500
PHONY += include/config/auto.conf
500501

501502
include/config/auto.conf:
502-
$(Q)test -e include/linux/autoconf.h -a -e $@ || ( \
503+
$(Q)test -e include/generated/autoconf.h -a -e $@ || ( \
503504
echo; \
504505
echo " ERROR: Kernel configuration is invalid."; \
505-
echo " include/linux/autoconf.h or $@ are missing."; \
506+
echo " include/generated/autoconf.h or $@ are missing.";\
506507
echo " Run 'make oldconfig && make prepare' on kernel src to fix it."; \
507508
echo; \
508509
/bin/false)
@@ -1149,7 +1150,7 @@ CLEAN_FILES += vmlinux System.map \
11491150
# Directories & files removed with 'make mrproper'
11501151
MRPROPER_DIRS += include/config usr/include include/generated
11511152
MRPROPER_FILES += .config .config.old .version .old_version \
1152-
include/linux/autoconf.h include/linux/version.h \
1153+
include/linux/version.h \
11531154
include/linux/utsrelease.h \
11541155
Module.symvers Module.markers tags TAGS cscope*
11551156

arch/m68k/kernel/head.S

+1-1
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@
196196
* for them and trying to understand what they mean.
197197
*
198198
* CONFIG_xxx: These are the obvious machine configuration defines created
199-
* during configuration. These are defined in include/linux/autoconf.h.
199+
* during configuration. These are defined in autoconf.h.
200200
*
201201
* CONSOLE: There is support for head.S console in this file. This
202202
* console can talk to a Mac frame buffer, but could easily be extrapolated

scripts/basic/fixdep.c

+5-5
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@
1616
* tells make when to remake a file.
1717
*
1818
* To use this list as-is however has the drawback that virtually
19-
* every file in the kernel includes <linux/autoconf.h>.
19+
* every file in the kernel includes autoconf.h.
2020
*
21-
* If the user re-runs make *config, linux/autoconf.h will be
21+
* If the user re-runs make *config, autoconf.h will be
2222
* regenerated. make notices that and will rebuild every file which
2323
* includes autoconf.h, i.e. basically all files. This is extremely
2424
* annoying if the user just changed CONFIG_HIS_DRIVER from n to m.
2525
*
2626
* So we play the same trick that "mkdep" played before. We replace
27-
* the dependency on linux/autoconf.h by a dependency on every config
27+
* the dependency on autoconf.h by a dependency on every config
2828
* option which is mentioned in any of the listed prequisites.
2929
*
3030
* kconfig populates a tree in include/config/ with an empty file
@@ -73,7 +73,7 @@
7373
* cmd_<target> = <cmdline>
7474
*
7575
* and then basically copies the .<target>.d file to stdout, in the
76-
* process filtering out the dependency on linux/autoconf.h and adding
76+
* process filtering out the dependency on autoconf.h and adding
7777
* dependencies on include/config/my/option.h for every
7878
* CONFIG_MY_OPTION encountered in any of the prequisites.
7979
*
@@ -324,7 +324,7 @@ static void parse_dep_file(void *map, size_t len)
324324
p++;
325325
}
326326
memcpy(s, m, p-m); s[p-m] = 0;
327-
if (strrcmp(s, "include/linux/autoconf.h") &&
327+
if (strrcmp(s, "include/generated/autoconf.h") &&
328328
strrcmp(s, "arch/um/include/uml-config.h") &&
329329
strrcmp(s, ".ver")) {
330330
printf(" %s \\\n", s);

scripts/kconfig/confdata.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -776,7 +776,7 @@ int conf_write_autoconf(void)
776776

777777
name = getenv("KCONFIG_AUTOHEADER");
778778
if (!name)
779-
name = "include/linux/autoconf.h";
779+
name = "include/generated/autoconf.h";
780780
if (rename(".tmpconfig.h", name))
781781
return 1;
782782
name = conf_get_autoconfig_name();

scripts/mkcompile_h

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ vecho() { [ "${quiet}" = "silent_" ] || echo "$@" ; }
1414
# So "sudo make install" won't change the "compiled by <user>"
1515
# do "compiled by root"
1616

17-
if [ -r $TARGET -a ! -O include/linux/autoconf.h ]; then
17+
if [ -r $TARGET -a ! -O include/generated/autoconf.h ]; then
1818
vecho " SKIPPED $TARGET"
1919
exit 0
2020
fi

0 commit comments

Comments
 (0)