Merge git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild-next

* git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild-next: (25 commits)
setlocalversion: do not describe if there is nothing to describe
kconfig: fix typos: "Suport" -> "Support"
kconfig: make defconfig is no longer chatty
kconfig: make oldconfig is now less chatty
kconfig: speed up all*config + randconfig
kconfig: set all new symbols automatically
kconfig: add diffconfig utility
kbuild: remove Module.markers during mrproper
kbuild: sparse needs CF not CHECKFLAGS
kernel-doc: handle/strip __init
vmlinux.lds: move __attribute__((__cold__)) functions back into final .text section
init: fix URL of "The GNU Accounting Utilities"
kbuild: add arch/$ARCH/include to search path
kbuild: asm symlink support for arch/$ARCH/include
kbuild: support arch/$ARCH/include for tags, cscope
kbuild: prepare headers_* for arch/$ARCH/include
kbuild: install all headers when arch is changed
kbuild: make clean removes *.o.* as well
kbuild: optimize headers_* targets
kbuild: only one call for include/ in make headers_*
...

+576 -325
+4 -4
Documentation/sparse.txt
··· 73 73 be recompiled or not. The latter is a fast way to check the whole tree if you 74 74 have already built it. 75 75 76 - The optional make variable CHECKFLAGS can be used to pass arguments to sparse. 77 - The build system passes -Wbitwise to sparse automatically. To perform 78 - endianness checks, you may define __CHECK_ENDIAN__: 76 + The optional make variable CF can be used to pass arguments to sparse. The 77 + build system passes -Wbitwise to sparse automatically. To perform endianness 78 + checks, you may define __CHECK_ENDIAN__: 79 79 80 - make C=2 CHECKFLAGS="-D__CHECK_ENDIAN__" 80 + make C=2 CF="-D__CHECK_ENDIAN__" 81 81 82 82 These checks are disabled by default as they generate a host of warnings.
+1 -2
Kbuild
··· 43 43 # 2) Generate asm-offsets.h 44 44 # 45 45 46 - offsets-file := include/asm-$(SRCARCH)/asm-offsets.h 46 + offsets-file := include/asm/asm-offsets.h 47 47 48 48 always += $(offsets-file) 49 49 targets += $(offsets-file) ··· 81 81 $(call if_changed_dep,cc_s_c) 82 82 83 83 $(obj)/$(offsets-file): arch/$(SRCARCH)/kernel/asm-offsets.s Kbuild 84 - $(Q)mkdir -p $(dir $@) 85 84 $(call cmd,offsets) 86 85 87 86 #####
+70 -45
Makefile
··· 205 205 SRCARCH := x86 206 206 endif 207 207 208 + # Where to locate arch specific headers 209 + hdr-arch := $(SRCARCH) 210 + 208 211 KCONFIG_CONFIG ?= .config 209 212 210 213 # SHELL used by kbuild ··· 329 326 # Needed to be compatible with the O= option 330 327 LINUXINCLUDE := -Iinclude \ 331 328 $(if $(KBUILD_SRC),-Iinclude2 -I$(srctree)/include) \ 332 - -include include/linux/autoconf.h 329 + -I$(srctree)/arch/$(hdr-arch)/include \ 330 + -include include/linux/autoconf.h 333 331 334 332 KBUILD_CPPFLAGS := -D__KERNEL__ $(LINUXINCLUDE) 335 333 ··· 926 922 /bin/false; \ 927 923 fi; 928 924 $(Q)if [ ! -d include2 ]; then mkdir -p include2; fi; 929 - $(Q)ln -fsn $(srctree)/include/asm-$(SRCARCH) include2/asm 925 + $(Q)if [ -e $(srctree)/include/asm-$(SRCARCH)/system.h ]; then \ 926 + ln -fsn $(srctree)/include/asm-$(SRCARCH) include2/asm; \ 927 + fi 930 928 endif 931 929 932 930 # prepare2 creates a makefile if using a separate output directory ··· 954 948 955 949 # The asm symlink changes when $(ARCH) changes. 956 950 # Detect this and ask user to run make mrproper 957 - 958 - include/asm: FORCE 959 - $(Q)set -e; asmlink=`readlink include/asm | cut -d '-' -f 2`; \ 960 - if [ -L include/asm ]; then \ 961 - if [ "$$asmlink" != "$(SRCARCH)" ]; then \ 951 + define check-symlink 952 + set -e; \ 953 + if [ -L include/asm ]; then \ 954 + asmlink=`readlink include/asm | cut -d '-' -f 2`; \ 955 + if [ "$$asmlink" != "$(SRCARCH)" ]; then \ 962 956 echo "ERROR: the symlink $@ points to asm-$$asmlink but asm-$(SRCARCH) was expected"; \ 963 957 echo " set ARCH or save .config and run 'make mrproper' to fix it"; \ 964 - exit 1; \ 965 - fi; \ 966 - else \ 967 - echo ' SYMLINK $@ -> include/asm-$(SRCARCH)'; \ 968 - if [ ! -d include ]; then \ 969 - mkdir -p include; \ 970 - fi; \ 971 - ln -fsn asm-$(SRCARCH) $@; \ 958 + exit 1; \ 959 + fi; \ 972 960 fi 961 + endef 962 + 963 + # We create the target directory of the symlink if it does 964 + # not exist so the test in chack-symlink works and we have a 965 + # directory for generated filesas used by some architectures. 966 + define create-symlink 967 + if [ ! -L include/asm ]; then \ 968 + echo ' SYMLINK $@ -> include/asm-$(SRCARCH)'; \ 969 + if [ ! -d include/asm-$(SRCARCH) ]; then \ 970 + mkdir -p include/asm-$(SRCARCH); \ 971 + fi; \ 972 + ln -fsn asm-$(SRCARCH) $@; \ 973 + fi 974 + endef 975 + 976 + include/asm: FORCE 977 + $(Q)$(check-symlink) 978 + $(Q)$(create-symlink) 973 979 974 980 # Generate some files 975 981 # --------------------------------------------------------------------------- ··· 1028 1010 1029 1011 # --------------------------------------------------------------------------- 1030 1012 # Kernel headers 1031 - INSTALL_HDR_PATH=$(objtree)/usr 1032 - export INSTALL_HDR_PATH 1033 1013 1034 - HDRFILTER=generic i386 x86_64 1035 - HDRARCHES=$(filter-out $(HDRFILTER),$(patsubst $(srctree)/include/asm-%/Kbuild,%,$(wildcard $(srctree)/include/asm-*/Kbuild))) 1014 + #Default location for installed headers 1015 + export INSTALL_HDR_PATH = $(objtree)/usr 1016 + 1017 + hdr-inst := -rR -f $(srctree)/scripts/Makefile.headersinst obj 1018 + # Find out where the Kbuild file is located to support 1019 + # arch/$(ARCH)/include/asm 1020 + hdr-dir = $(strip \ 1021 + $(if $(wildcard $(srctree)/arch/$(hdr-arch)/include/asm/Kbuild), \ 1022 + arch/$(hdr-arch)/include/asm, include/asm-$(hdr-arch))) 1023 + 1024 + # If we do an all arch process set dst to asm-$(hdr-arch) 1025 + hdr-dst = $(if $(KBUILD_HEADERS), dst=include/asm-$(hdr-arch), dst=include/asm) 1026 + 1027 + PHONY += __headers 1028 + __headers: include/linux/version.h scripts_basic FORCE 1029 + $(Q)$(MAKE) $(build)=scripts scripts/unifdef 1036 1030 1037 1031 PHONY += headers_install_all 1038 - headers_install_all: include/linux/version.h scripts_basic FORCE 1039 - $(Q)$(MAKE) $(build)=scripts scripts/unifdef 1040 - $(Q)for arch in $(HDRARCHES); do \ 1041 - $(MAKE) ARCH=$$arch -f $(srctree)/scripts/Makefile.headersinst obj=include BIASMDIR=-bi-$$arch ;\ 1042 - done 1032 + headers_install_all: 1033 + $(Q)$(CONFIG_SHELL) $(srctree)/scripts/headers.sh install 1043 1034 1044 1035 PHONY += headers_install 1045 - headers_install: include/linux/version.h scripts_basic FORCE 1046 - @if [ ! -r $(srctree)/include/asm-$(SRCARCH)/Kbuild ]; then \ 1047 - echo '*** Error: Headers not exportable for this architecture ($(SRCARCH))'; \ 1048 - exit 1 ; fi 1049 - $(Q)$(MAKE) $(build)=scripts scripts/unifdef 1050 - $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.headersinst ARCH=$(SRCARCH) obj=include 1036 + headers_install: __headers 1037 + $(if $(wildcard $(srctree)/$(hdr-dir)/Kbuild),, \ 1038 + $(error Headers not exportable for the $(SRCARCH) architecture)) 1039 + $(Q)$(MAKE) $(hdr-inst)=include 1040 + $(Q)$(MAKE) $(hdr-inst)=$(hdr-dir) $(hdr-dst) 1051 1041 1052 1042 PHONY += headers_check_all 1053 1043 headers_check_all: headers_install_all 1054 - $(Q)for arch in $(HDRARCHES); do \ 1055 - $(MAKE) ARCH=$$arch -f $(srctree)/scripts/Makefile.headersinst obj=include BIASMDIR=-bi-$$arch HDRCHECK=1 ;\ 1056 - done 1044 + $(Q)$(CONFIG_SHELL) $(srctree)/scripts/headers.sh check 1057 1045 1058 1046 PHONY += headers_check 1059 1047 headers_check: headers_install 1060 - $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.headersinst ARCH=$(SRCARCH) obj=include HDRCHECK=1 1048 + $(Q)$(MAKE) $(hdr-inst)=include HDRCHECK=1 1049 + $(Q)$(MAKE) $(hdr-inst)=$(hdr-dir) $(hdr-dst) HDRCHECK=1 1061 1050 1062 1051 # --------------------------------------------------------------------------- 1063 1052 # Modules ··· 1156 1131 include/linux/autoconf.h include/linux/version.h \ 1157 1132 include/linux/utsrelease.h \ 1158 1133 include/linux/bounds.h include/asm*/asm-offsets.h \ 1159 - Module.symvers tags TAGS cscope* 1134 + Module.symvers Module.markers tags TAGS cscope* 1160 1135 1161 1136 # clean - Delete most, but leave enough to build external modules 1162 1137 # ··· 1175 1150 \( -name '*.[oas]' -o -name '*.ko' -o -name '.*.cmd' \ 1176 1151 -o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \ 1177 1152 -o -name '*.symtypes' -o -name 'modules.order' \ 1178 - -o -name 'Module.markers' \) \ 1153 + -o -name 'Module.markers' -o -name '.tmp_*.o.*' \) \ 1179 1154 -type f -print | xargs rm -f 1180 1155 1181 1156 # mrproper - Delete all generated files, including .config ··· 1249 1224 @echo ' cscope - Generate cscope index' 1250 1225 @echo ' kernelrelease - Output the release version string' 1251 1226 @echo ' kernelversion - Output the version stored in Makefile' 1252 - @if [ -r $(srctree)/include/asm-$(SRCARCH)/Kbuild ]; then \ 1253 - echo ' headers_install - Install sanitised kernel headers to INSTALL_HDR_PATH'; \ 1227 + @echo ' headers_install - Install sanitised kernel headers to INSTALL_HDR_PATH'; \ 1254 1228 echo ' (default: $(INSTALL_HDR_PATH))'; \ 1255 - fi 1256 - @echo '' 1229 + echo '' 1257 1230 @echo 'Static analysers' 1258 1231 @echo ' checkstack - Generate a list of stack hogs' 1259 1232 @echo ' namespacecheck - Name space analysis on compiled kernel' 1260 1233 @echo ' versioncheck - Sanity check on version.h usage' 1261 1234 @echo ' includecheck - Check for duplicate included header files' 1262 1235 @echo ' export_report - List the usages of all exported symbols' 1263 - @if [ -r $(srctree)/include/asm-$(SRCARCH)/Kbuild ]; then \ 1264 - echo ' headers_check - Sanity check on exported headers'; \ 1265 - fi 1266 - @echo '' 1236 + @echo ' headers_check - Sanity check on exported headers'; \ 1237 + echo '' 1267 1238 @echo 'Kernel packaging:' 1268 1239 @$(MAKE) $(build)=$(package-dir) help 1269 1240 @echo '' ··· 1432 1411 \( -name config -o -name 'asm-*' \) -prune \ 1433 1412 -o -name $1 -print; \ 1434 1413 for arch in $(ALLINCLUDE_ARCHS) ; do \ 1435 - find $(__srctree)include/asm-$${arch} $(RCS_FIND_IGNORE) \ 1414 + test -e $(__srctree)include/asm-$${arch} && \ 1415 + find $(__srctree)include/asm-$${arch} $(RCS_FIND_IGNORE) \ 1416 + -name $1 -print; \ 1417 + test -e $(__srctree)arch/$${arch}/include/asm && \ 1418 + find $(__srctree)arch/$${arch}/include/asm $(RCS_FIND_IGNORE) \ 1436 1419 -name $1 -print; \ 1437 1420 done ; \ 1438 1421 find $(__srctree)include/asm-generic $(RCS_FIND_IGNORE) \
+1 -1
drivers/misc/Kconfig
··· 360 360 If you are not sure, say Y here. 361 361 362 362 config THINKPAD_ACPI_HOTKEY_POLL 363 - bool "Suport NVRAM polling for hot keys" 363 + bool "Support NVRAM polling for hot keys" 364 364 depends on THINKPAD_ACPI 365 365 default y 366 366 ---help---
+3 -2
include/Kbuild
··· 1 + # Top-level Makefile calls into asm-$(ARCH) 2 + # List only non-arch directories below 3 + 1 4 header-y += asm-generic/ 2 5 header-y += linux/ 3 6 header-y += sound/ ··· 8 5 header-y += rdma/ 9 6 header-y += video/ 10 7 header-y += drm/ 11 - 12 - header-y += asm-$(ARCH)/
+3 -1
include/asm-generic/vmlinux.lds.h
··· 221 221 * during second ld run in second ld pass when generating System.map */ 222 222 #define TEXT_TEXT \ 223 223 ALIGN_FUNCTION(); \ 224 + *(.text.hot) \ 224 225 *(.text) \ 225 226 *(.ref.text) \ 226 227 *(.text.init.refok) \ ··· 231 230 CPU_KEEP(init.text) \ 232 231 CPU_KEEP(exit.text) \ 233 232 MEM_KEEP(init.text) \ 234 - MEM_KEEP(exit.text) 233 + MEM_KEEP(exit.text) \ 234 + *(.text.unlikely) 235 235 236 236 237 237 /* sched.text is aling to function alignment to secure we have same
+2 -2
init/Kconfig
··· 171 171 process and it's parent. Note that this file format is incompatible 172 172 with previous v0/v1/v2 file formats, so you will need updated tools 173 173 for processing it. A preliminary version of these tools is available 174 - at <http://www.physik3.uni-rostock.de/tim/kernel/utils/acct/>. 174 + at <http://www.gnu.org/software/acct/>. 175 175 176 176 config TASKSTATS 177 177 bool "Export task/process statistics through netlink (EXPERIMENTAL)" ··· 486 486 default n 487 487 depends on NAMESPACES && EXPERIMENTAL 488 488 help 489 - Suport process id namespaces. This allows having multiple 489 + Support process id namespaces. This allows having multiple 490 490 process with the same pid as long as they are in different 491 491 pid namespaces. This is a building block of containers. 492 492
+67 -163
scripts/Makefile.headersinst
··· 1 1 # ========================================================================== 2 2 # Installing headers 3 3 # 4 - # header-y files will be installed verbatim 5 - # unifdef-y are the files where unifdef will be run before installing files 6 - # objhdr-y are generated files that will be installed verbatim 4 + # header-y - list files to be installed. They are preprocessed 5 + # to remove __KERNEL__ section of the file 6 + # unifdef-y - Same as header-y. Obsolete 7 + # objhdr-y - Same as header-y but for generated files 7 8 # 8 9 # ========================================================================== 9 10 10 - UNIFDEF := scripts/unifdef -U__KERNEL__ 11 - 12 - # Eliminate the contents of (and inclusions of) compiler.h 13 - HDRSED := sed -e "s/ inline / __inline__ /g" \ 14 - -e "s/[[:space:]]__user[[:space:]]\{1,\}/ /g" \ 15 - -e "s/(__user[[:space:]]\{1,\}/ (/g" \ 16 - -e "s/[[:space:]]__force[[:space:]]\{1,\}/ /g" \ 17 - -e "s/(__force[[:space:]]\{1,\}/ (/g" \ 18 - -e "s/[[:space:]]__iomem[[:space:]]\{1,\}/ /g" \ 19 - -e "s/(__iomem[[:space:]]\{1,\}/ (/g" \ 20 - -e "s/[[:space:]]__attribute_const__[[:space:]]\{1,\}/\ /g" \ 21 - -e "s/[[:space:]]__attribute_const__$$//" \ 22 - -e "/^\#include <linux\/compiler.h>/d" 23 - 11 + # called may set destination dir (when installing to asm/) 24 12 _dst := $(if $(dst),$(dst),$(obj)) 25 13 26 - ifeq (,$(patsubst include/asm/%,,$(obj)/)) 27 - # For producing the generated stuff in include/asm for biarch builds, include 28 - # both sets of Kbuild files; we'll generate anything which is mentioned in 29 - # _either_ arch, and recurse into subdirectories which are mentioned in either 30 - # arch. Since some directories may exist in one but not the other, we must 31 - # use $(wildcard...). 32 - GENASM := 1 33 - archasm := $(subst include/asm,asm-$(ARCH),$(obj)) 34 - altarchasm := $(subst include/asm,asm-$(ALTARCH),$(obj)) 35 - KBUILDFILES := $(wildcard $(srctree)/include/$(archasm)/Kbuild $(srctree)/include/$(altarchasm)/Kbuild) 36 - else 37 - KBUILDFILES := $(srctree)/$(obj)/Kbuild 38 - endif 14 + kbuild-file := $(srctree)/$(obj)/Kbuild 15 + include $(kbuild-file) 39 16 40 - include $(KBUILDFILES) 17 + include scripts/Kbuild.include 41 18 42 - include scripts/Kbuild.include 19 + install := $(INSTALL_HDR_PATH)/$(_dst) 43 20 44 - # If this is include/asm-$(ARCH) and there's no $(ALTARCH), then 45 - # override $(_dst) so that we install to include/asm directly. 46 - # Unless $(BIASMDIR) is set, in which case we're probably doing 47 - # a 'headers_install_all' build and we should keep the -$(ARCH) 48 - # in the directory name. 49 - ifeq ($(obj)$(ALTARCH),include/asm-$(ARCH)$(BIASMDIR)) 50 - _dst := include/asm 51 - endif 21 + header-y := $(sort $(header-y) $(unifdef-y)) 22 + subdirs := $(patsubst %/,%,$(filter %/, $(header-y))) 23 + header-y := $(filter-out %/, $(header-y)) 52 24 53 - header-y := $(sort $(header-y)) 54 - unifdef-y := $(sort $(unifdef-y)) 55 - subdir-y := $(patsubst %/,%,$(filter %/, $(header-y))) 56 - header-y := $(filter-out %/, $(header-y)) 57 - header-y := $(filter-out $(unifdef-y),$(header-y)) 25 + # files used to track state of install/check 26 + install-file := $(install)/.install 27 + check-file := $(install)/.check 58 28 59 - # stamp files for header checks 60 - check-y := $(patsubst %,.check.%,$(header-y) $(unifdef-y) $(objhdr-y)) 29 + # all headers files for this dir 30 + all-files := $(header-y) $(objhdr-y) 31 + input-files := $(addprefix $(srctree)/$(obj)/,$(header-y)) \ 32 + $(addprefix $(objtree)/$(obj)/,$(objhdr-y)) 33 + output-files := $(addprefix $(install)/, $(all-files)) 61 34 62 35 # Work out what needs to be removed 63 - oldheaders := $(patsubst $(INSTALL_HDR_PATH)/$(_dst)/%,%,$(wildcard $(INSTALL_HDR_PATH)/$(_dst)/*.h)) 64 - unwanted := $(filter-out $(header-y) $(unifdef-y) $(objhdr-y),$(oldheaders)) 36 + oldheaders := $(patsubst $(install)/%,%,$(wildcard $(install)/*.h)) 37 + unwanted := $(filter-out $(all-files),$(oldheaders)) 65 38 66 - oldcheckstamps := $(patsubst $(INSTALL_HDR_PATH)/$(_dst)/%,%,$(wildcard $(INSTALL_HDR_PATH)/$(_dst)/.check.*.h)) 67 - unwanted += $(filter-out $(check-y),$(oldcheckstamps)) 39 + # Prefix unwanted with full paths to $(INSTALL_HDR_PATH) 40 + unwanted-file := $(addprefix $(install)/, $(unwanted)) 68 41 69 - # Prefix them all with full paths to $(INSTALL_HDR_PATH) 70 - header-y := $(patsubst %,$(INSTALL_HDR_PATH)/$(_dst)/%,$(header-y)) 71 - unifdef-y := $(patsubst %,$(INSTALL_HDR_PATH)/$(_dst)/%,$(unifdef-y)) 72 - objhdr-y := $(patsubst %,$(INSTALL_HDR_PATH)/$(_dst)/%,$(objhdr-y)) 73 - check-y := $(patsubst %,$(INSTALL_HDR_PATH)/$(_dst)/%,$(check-y)) 42 + printdir = $(patsubst $(INSTALL_HDR_PATH)/%/,%,$(dir $@)) 74 43 44 + quiet_cmd_install = INSTALL $(printdir) ($(words $(all-files))\ 45 + file$(if $(word 2, $(all-files)),s)) 46 + cmd_install = \ 47 + $(PERL) $< $(srctree)/$(obj) $(install) $(SRCARCH) $(header-y); \ 48 + $(PERL) $< $(objtree)/$(obj) $(install) $(SRCARCH) $(objhdr-y); \ 49 + touch $@ 75 50 76 - ifdef ALTARCH 77 - ifeq ($(obj),include/asm-$(ARCH)) 78 - altarch-y := altarch-dir 79 - endif 80 - endif 51 + quiet_cmd_remove = REMOVE $(unwanted) 52 + cmd_remove = rm -f $(unwanted-file) 81 53 82 - # Make the definitions visible for recursive make invocations 83 - export ALTARCH 84 - export ARCHDEF 85 - export ALTARCHDEF 54 + quiet_cmd_check = CHECK $(printdir) ($(words $(all-files)) files) 55 + cmd_check = $(PERL) $< $(INSTALL_HDR_PATH)/include $(SRCARCH) \ 56 + $(addprefix $(install)/, $(all-files)); \ 57 + touch $@ 86 58 87 - quiet_cmd_o_hdr_install = INSTALL $(patsubst $(INSTALL_HDR_PATH)/%,%,$@) 88 - cmd_o_hdr_install = cp $(patsubst $(INSTALL_HDR_PATH)/$(_dst)/%,$(objtree)/$(obj)/%,$@) \ 89 - $(INSTALL_HDR_PATH)/$(_dst) 59 + PHONY += __headersinst __headerscheck 90 60 91 - quiet_cmd_headers_install = INSTALL $(patsubst $(INSTALL_HDR_PATH)/%,%,$@) 92 - cmd_headers_install = $(HDRSED) $(patsubst $(INSTALL_HDR_PATH)/$(_dst)/%,$(srctree)/$(obj)/%,$@) \ 93 - > $@ 94 - 95 - quiet_cmd_unifdef = UNIFDEF $(patsubst $(INSTALL_HDR_PATH)/%,%,$@) 96 - cmd_unifdef = $(UNIFDEF) $(patsubst $(INSTALL_HDR_PATH)/$(_dst)/%,$(srctree)/$(obj)/%,$@) \ 97 - | $(HDRSED) > $@ || : 98 - 99 - quiet_cmd_check = CHECK $(patsubst $(INSTALL_HDR_PATH)/$(_dst)/.check.%,$(_dst)/%,$@) 100 - cmd_check = $(CONFIG_SHELL) $(srctree)/scripts/hdrcheck.sh \ 101 - $(INSTALL_HDR_PATH)/include $(subst /.check.,/,$@) $@ 102 - 103 - quiet_cmd_remove = REMOVE $(_dst)/$@ 104 - cmd_remove = rm -f $(INSTALL_HDR_PATH)/$(_dst)/$@ 105 - 106 - quiet_cmd_mkdir = MKDIR $(patsubst $(INSTALL_HDR_PATH)/%,%,$@) 107 - cmd_mkdir = mkdir -p $@ 108 - 109 - quiet_cmd_gen = GEN $(patsubst $(INSTALL_HDR_PATH)/%,%,$@) 110 - cmd_gen = \ 111 - FNAME=$(patsubst $(INSTALL_HDR_PATH)/$(_dst)/%,%,$@); \ 112 - STUBDEF=__ASM_STUB_`echo $$FNAME | tr a-z.- A-Z__`; \ 113 - (echo "/* File autogenerated by 'make headers_install' */" ; \ 114 - echo "\#ifndef $$STUBDEF" ; \ 115 - echo "\#define $$STUBDEF" ; \ 116 - echo "\# if $(ARCHDEF)" ; \ 117 - if [ -r $(subst /$(_dst)/,/include/$(archasm)/,$@) ]; then \ 118 - echo "\# include <$(archasm)/$$FNAME>" ; \ 119 - else \ 120 - echo "\# error $(archasm)/$$FNAME does not exist in" \ 121 - "the $(ARCH) architecture" ; \ 122 - fi ; \ 123 - echo "\# elif $(ALTARCHDEF)" ; \ 124 - if [ -r $(subst /$(_dst)/,/include/$(altarchasm)/,$@) ]; then \ 125 - echo "\# include <$(altarchasm)/$$FNAME>" ; \ 126 - else \ 127 - echo "\# error $(altarchasm)/$$FNAME does not exist in" \ 128 - "the $(ALTARCH) architecture" ; \ 129 - fi ; \ 130 - echo "\# else" ; \ 131 - echo "\# warning This machine appears to be" \ 132 - "neither $(ARCH) nor $(ALTARCH)." ; \ 133 - echo "\# endif" ; \ 134 - echo "\#endif /* $$STUBDEF */" ; \ 135 - ) > $@ 136 - 137 - .PHONY: __headersinst __headerscheck 138 - 139 - ifdef HDRCHECK 140 - __headerscheck: $(subdir-y) $(check-y) 141 - @true 142 - 143 - $(check-y) : $(INSTALL_HDR_PATH)/$(_dst)/.check.%.h : $(INSTALL_HDR_PATH)/$(_dst)/%.h 144 - $(call cmd,check) 145 - 146 - # Other dependencies for $(check-y) 147 - include /dev/null $(wildcard $(check-y)) 148 - 149 - # ... but leave $(check-y) as .PHONY for now until those deps are actually correct. 150 - .PHONY: $(check-y) 151 - 152 - else 61 + ifndef HDRCHECK 153 62 # Rules for installing headers 154 - __headersinst: $(subdir-y) $(header-y) $(unifdef-y) $(altarch-y) $(objhdr-y) 155 - @true 63 + __headersinst: $(subdirs) $(install-file) 64 + @: 156 65 157 - $(objhdr-y) $(subdir-y) $(header-y) $(unifdef-y): | $(INSTALL_HDR_PATH)/$(_dst) $(unwanted) 158 - 159 - $(INSTALL_HDR_PATH)/$(_dst): 160 - $(call cmd,mkdir) 161 - 162 - .PHONY: $(unwanted) 163 - $(unwanted): 164 - $(call cmd,remove) 165 - 166 - ifdef GENASM 167 - $(objhdr-y) $(header-y) $(unifdef-y): $(KBUILDFILES) 168 - $(call cmd,gen) 66 + targets += $(install-file) 67 + $(install-file): scripts/headers_install.pl $(input-files) FORCE 68 + $(if $(unwanted),$(call cmd,remove),) 69 + $(if $(wildcard $(dir $@)),,$(shell mkdir -p $(dir $@))) 70 + $(call if_changed,install) 169 71 170 72 else 171 - $(objhdr-y) : $(INSTALL_HDR_PATH)/$(_dst)/%.h: $(objtree)/$(obj)/%.h $(KBUILDFILES) 172 - $(call cmd,o_hdr_install) 73 + __headerscheck: $(subdirs) $(check-file) 74 + @: 173 75 174 - $(header-y) : $(INSTALL_HDR_PATH)/$(_dst)/%.h: $(srctree)/$(obj)/%.h $(KBUILDFILES) 175 - $(call cmd,headers_install) 76 + targets += $(check-file) 77 + $(check-file): scripts/headers_check.pl $(output-files) FORCE 78 + $(call if_changed,check) 176 79 177 - $(unifdef-y) : $(INSTALL_HDR_PATH)/$(_dst)/%.h: $(srctree)/$(obj)/%.h $(KBUILDFILES) 178 - $(call cmd,unifdef) 179 80 endif 180 - endif 181 - 182 - hdrinst := -rR -f $(srctree)/scripts/Makefile.headersinst obj 183 - 184 - .PHONY: altarch-dir 185 - # All the files in the normal arch dir must be created first, since we test 186 - # for their existence. 187 - altarch-dir: $(subdir-y) $(header-y) $(unifdef-y) $(objhdr-y) 188 - $(Q)$(MAKE) $(hdrinst)=include/asm-$(ALTARCH) dst=include/asm-$(ALTARCH) 189 - $(Q)$(MAKE) $(hdrinst)=include/asm dst=include/asm$(BIASMDIR) 190 81 191 82 # Recursion 192 - .PHONY: $(subdir-y) 193 - $(subdir-y): 194 - $(Q)$(MAKE) $(hdrinst)=$(obj)/$@ dst=$(_dst)/$@ rel=../$(rel) 83 + hdr-inst := -rR -f $(srctree)/scripts/Makefile.headersinst obj 84 + .PHONY: $(subdirs) 85 + $(subdirs): 86 + $(Q)$(MAKE) $(hdr-inst)=$(obj)/$@ dst=$(_dst)/$@ 87 + 88 + targets := $(wildcard $(sort $(targets))) 89 + cmd_files := $(wildcard \ 90 + $(foreach f,$(targets),$(dir $(f)).$(notdir $(f)).cmd)) 91 + 92 + ifneq ($(cmd_files),) 93 + include $(cmd_files) 94 + endif 95 + 96 + .PHONY: $(PHONY) 97 + PHONY += FORCE 98 + FORCE: ;
+129
scripts/diffconfig
··· 1 + #!/usr/bin/python 2 + # 3 + # diffconfig - a tool to compare .config files. 4 + # 5 + # originally written in 2006 by Matt Mackall 6 + # (at least, this was in his bloatwatch source code) 7 + # last worked on 2008 by Tim Bird 8 + # 9 + 10 + import sys, os 11 + 12 + def usage(): 13 + print """Usage: diffconfig [-h] [-m] [<config1> <config2>] 14 + 15 + Diffconfig is a simple utility for comparing two .config files. 16 + Using standard diff to compare .config files often includes extraneous and 17 + distracting information. This utility produces sorted output with only the 18 + changes in configuration values between the two files. 19 + 20 + Added and removed items are shown with a leading plus or minus, respectively. 21 + Changed items show the old and new values on a single line. 22 + 23 + If -m is specified, then output will be in "merge" style, which has the 24 + changed and new values in kernel config option format. 25 + 26 + If no config files are specified, .config and .config.old are used. 27 + 28 + Example usage: 29 + $ diffconfig .config config-with-some-changes 30 + -EXT2_FS_XATTR n 31 + -EXT2_FS_XIP n 32 + CRAMFS n -> y 33 + EXT2_FS y -> n 34 + LOG_BUF_SHIFT 14 -> 16 35 + PRINTK_TIME n -> y 36 + """ 37 + sys.exit(0) 38 + 39 + # returns a dictionary of name/value pairs for config items in the file 40 + def readconfig(config_file): 41 + d = {} 42 + for line in config_file: 43 + line = line[:-1] 44 + if line[:7] == "CONFIG_": 45 + name, val = line[7:].split("=", 1) 46 + d[name] = val 47 + if line[-11:] == " is not set": 48 + d[line[9:-11]] = "n" 49 + return d 50 + 51 + def print_config(op, config, value, new_value): 52 + global merge_style 53 + 54 + if merge_style: 55 + if new_value: 56 + if new_value=="n": 57 + print "# CONFIG_%s is not set" % config 58 + else: 59 + print "CONFIG_%s=%s" % (config, new_value) 60 + else: 61 + if op=="-": 62 + print "-%s %s" % (config, value) 63 + elif op=="+": 64 + print "+%s %s" % (config, new_value) 65 + else: 66 + print " %s %s -> %s" % (config, value, new_value) 67 + 68 + def main(): 69 + global merge_style 70 + 71 + # parse command line args 72 + if ("-h" in sys.argv or "--help" in sys.argv): 73 + usage() 74 + 75 + merge_style = 0 76 + if "-m" in sys.argv: 77 + merge_style = 1 78 + sys.argv.remove("-m") 79 + 80 + argc = len(sys.argv) 81 + if not (argc==1 or argc == 3): 82 + print "Error: incorrect number of arguments or unrecognized option" 83 + usage() 84 + 85 + if argc == 1: 86 + # if no filenames given, assume .config and .config.old 87 + build_dir="" 88 + if os.environ.has_key("KBUILD_OUTPUT"): 89 + build_dir = os.environ["KBUILD_OUTPUT"]+"/" 90 + 91 + configa_filename = build_dir + ".config.old" 92 + configb_filename = build_dir + ".config" 93 + else: 94 + configa_filename = sys.argv[1] 95 + configb_filename = sys.argv[2] 96 + 97 + a = readconfig(file(configa_filename)) 98 + b = readconfig(file(configb_filename)) 99 + 100 + # print items in a but not b (accumulate, sort and print) 101 + old = [] 102 + for config in a: 103 + if config not in b: 104 + old.append(config) 105 + old.sort() 106 + for config in old: 107 + print_config("-", config, a[config], None) 108 + del a[config] 109 + 110 + # print items that changed (accumulate, sort, and print) 111 + changed = [] 112 + for config in a: 113 + if a[config] != b[config]: 114 + changed.append(config) 115 + else: 116 + del b[config] 117 + changed.sort() 118 + for config in changed: 119 + print_config("->", config, a[config], b[config]) 120 + del b[config] 121 + 122 + # now print items in b but not in a 123 + # (items from b that were in a were removed above) 124 + new = b.keys() 125 + new.sort() 126 + for config in new: 127 + print_config("+", config, None, b[config]) 128 + 129 + main()
-10
scripts/hdrcheck.sh
··· 1 - #!/bin/sh 2 - 3 - for FILE in `grep '^[ \t]*#[ \t]*include[ \t]*<' $2 | cut -f2 -d\< | cut -f1 -d\> | egrep ^linux\|^asm` ; do 4 - if [ ! -r $1/$FILE ]; then 5 - echo $2 requires $FILE, which does not exist in exported headers 6 - exit 1 7 - fi 8 - done 9 - # FIXME: List dependencies into $3 10 - touch $3
+41
scripts/headers.sh
··· 1 + #!/bin/sh 2 + # Run headers_$1 command for all suitable architectures 3 + 4 + # Stop on error 5 + set -e 6 + 7 + do_command() 8 + { 9 + if [ -f ${srctree}/arch/$2/include/asm/Kbuild ]; then 10 + make ARCH=$2 KBUILD_HEADERS=$1 headers_$1 11 + elif [ -f ${srctree}/include/asm-$2/Kbuild ]; then 12 + make ARCH=$2 KBUILD_HEADERS=$1 headers_$1 13 + else 14 + printf "Ignoring arch: %s\n" ${arch} 15 + fi 16 + } 17 + 18 + # Do not try this architecture 19 + drop="generic um ppc sparc64 cris" 20 + 21 + archs=$(ls ${srctree}/arch) 22 + 23 + for arch in ${archs}; do 24 + case ${arch} in 25 + um) # no userspace export 26 + ;; 27 + ppc) # headers exported by powerpc 28 + ;; 29 + sparc64) # headers exported by sparc 30 + ;; 31 + cris) # headers export are known broken 32 + ;; 33 + *) 34 + if [ -d ${srctree}/arch/${arch} ]; then 35 + do_command $1 ${arch} 36 + fi 37 + ;; 38 + esac 39 + done 40 + 41 +
+56
scripts/headers_check.pl
··· 1 + #!/usr/bin/perl 2 + # 3 + # headers_check.pl execute a number of trivial consistency checks 4 + # 5 + # Usage: headers_check.pl dir [files...] 6 + # dir: dir to look for included files 7 + # arch: architecture 8 + # files: list of files to check 9 + # 10 + # The script reads the supplied files line by line and: 11 + # 12 + # 1) for each include statement it checks if the 13 + # included file actually exists. 14 + # Only include files located in asm* and linux* are checked. 15 + # The rest are assumed to be system include files. 16 + # 17 + # 2) TODO: check for leaked CONFIG_ symbols 18 + 19 + use strict; 20 + use warnings; 21 + 22 + my ($dir, $arch, @files) = @ARGV; 23 + 24 + my $ret = 0; 25 + my $line; 26 + my $lineno = 0; 27 + my $filename; 28 + 29 + foreach my $file (@files) { 30 + $filename = $file; 31 + open(my $fh, '<', "$filename") or die "$filename: $!\n"; 32 + $lineno = 0; 33 + while ($line = <$fh>) { 34 + $lineno++; 35 + check_include(); 36 + } 37 + close $fh; 38 + } 39 + exit $ret; 40 + 41 + sub check_include 42 + { 43 + if ($line =~ m/^\s*#\s*include\s+<((asm|linux).*)>/) { 44 + my $inc = $1; 45 + my $found; 46 + $found = stat($dir . "/" . $inc); 47 + if (!$found) { 48 + $inc =~ s#asm/#asm-$arch/#; 49 + $found = stat($dir . "/" . $inc); 50 + } 51 + if (!$found) { 52 + printf STDERR "$filename:$lineno: included file '$inc' is not exported\n"; 53 + $ret = 1; 54 + } 55 + } 56 + }
+45
scripts/headers_install.pl
··· 1 + #!/usr/bin/perl 2 + # 3 + # headers_install prepare the listed header files for use in 4 + # user space and copy the files to their destination. 5 + # 6 + # Usage: headers_install.pl readdir installdir arch [files...] 7 + # readdir: dir to open files 8 + # installdir: dir to install the files 9 + # arch: current architecture 10 + # arch is used to force a reinstallation when the arch 11 + # changes because kbuild then detect a command line change. 12 + # files: list of files to check 13 + # 14 + # Step in preparation for users space: 15 + # 1) Drop all use of compiler.h definitions 16 + # 2) Drop include of compiler.h 17 + # 3) Drop all sections defined out by __KERNEL__ (using unifdef) 18 + 19 + use strict; 20 + use warnings; 21 + 22 + my ($readdir, $installdir, $arch, @files) = @ARGV; 23 + 24 + my $unifdef = "scripts/unifdef -U__KERNEL__"; 25 + 26 + foreach my $file (@files) { 27 + my $tmpfile = "$installdir/$file.tmp"; 28 + open(my $infile, '<', "$readdir/$file") 29 + or die "$readdir/$file: $!\n"; 30 + open(my $outfile, '>', "$tmpfile") or die "$tmpfile: $!\n"; 31 + while (my $line = <$infile>) { 32 + $line =~ s/([\s(])__user\s/$1/g; 33 + $line =~ s/([\s(])__force\s/$1/g; 34 + $line =~ s/([\s(])__iomem\s/$1/g; 35 + $line =~ s/\s__attribute_const__\s/ /g; 36 + $line =~ s/\s__attribute_const__$//g; 37 + $line =~ s/^#include <linux\/compiler.h>//; 38 + printf $outfile "%s", $line; 39 + } 40 + close $outfile; 41 + close $infile; 42 + system $unifdef . " $tmpfile > $installdir/$file"; 43 + unlink $tmpfile; 44 + } 45 + exit 0;
+71 -94
scripts/kconfig/conf.c
··· 76 76 static int conf_askvalue(struct symbol *sym, const char *def) 77 77 { 78 78 enum symbol_type type = sym_get_type(sym); 79 - tristate val; 80 79 81 80 if (!sym_has_value(sym)) 82 81 printf(_("(NEW) ")); ··· 91 92 } 92 93 93 94 switch (input_mode) { 94 - case set_no: 95 - case set_mod: 96 - case set_yes: 97 - case set_random: 98 - if (sym_has_value(sym)) { 99 - printf("%s\n", def); 100 - return 0; 101 - } 102 - break; 103 95 case ask_new: 104 96 case ask_silent: 105 97 if (sym_has_value(sym)) { ··· 101 111 case ask_all: 102 112 fflush(stdout); 103 113 fgets(line, 128, stdin); 104 - return 1; 105 - case set_default: 106 - printf("%s\n", def); 107 114 return 1; 108 115 default: 109 116 break; ··· 114 127 return 1; 115 128 default: 116 129 ; 117 - } 118 - switch (input_mode) { 119 - case set_yes: 120 - if (sym_tristate_within_range(sym, yes)) { 121 - line[0] = 'y'; 122 - line[1] = '\n'; 123 - line[2] = 0; 124 - break; 125 - } 126 - case set_mod: 127 - if (type == S_TRISTATE) { 128 - if (sym_tristate_within_range(sym, mod)) { 129 - line[0] = 'm'; 130 - line[1] = '\n'; 131 - line[2] = 0; 132 - break; 133 - } 134 - } else { 135 - if (sym_tristate_within_range(sym, yes)) { 136 - line[0] = 'y'; 137 - line[1] = '\n'; 138 - line[2] = 0; 139 - break; 140 - } 141 - } 142 - case set_no: 143 - if (sym_tristate_within_range(sym, no)) { 144 - line[0] = 'n'; 145 - line[1] = '\n'; 146 - line[2] = 0; 147 - break; 148 - } 149 - case set_random: 150 - do { 151 - val = (tristate)(rand() % 3); 152 - } while (!sym_tristate_within_range(sym, val)); 153 - switch (val) { 154 - case no: line[0] = 'n'; break; 155 - case mod: line[0] = 'm'; break; 156 - case yes: line[0] = 'y'; break; 157 - } 158 - line[1] = '\n'; 159 - line[2] = 0; 160 - break; 161 - default: 162 - break; 163 130 } 164 131 printf("%s", line); 165 132 return 1; ··· 315 374 else 316 375 continue; 317 376 break; 318 - case set_random: 319 - if (is_new) 320 - def = (rand() % cnt) + 1; 321 - case set_default: 322 - case set_yes: 323 - case set_mod: 324 - case set_no: 325 - cnt = def; 326 - printf("%d\n", cnt); 377 + default: 327 378 break; 328 379 } 329 380 ··· 427 494 check_conf(child); 428 495 } 429 496 497 + static void conf_do_update(void) 498 + { 499 + /* Update until a loop caused no more changes */ 500 + do { 501 + conf_cnt = 0; 502 + check_conf(&rootmenu); 503 + } while (conf_cnt); 504 + } 505 + 506 + static int conf_silent_update(void) 507 + { 508 + const char *name; 509 + 510 + if (conf_get_changed()) { 511 + name = getenv("KCONFIG_NOSILENTUPDATE"); 512 + if (name && *name) { 513 + fprintf(stderr, 514 + _("\n*** Kernel configuration requires explicit update.\n\n")); 515 + return 1; 516 + } 517 + conf_do_update(); 518 + } 519 + return 0; 520 + } 521 + 522 + static int conf_update(void) 523 + { 524 + rootEntry = &rootmenu; 525 + conf(&rootmenu); 526 + if (input_mode == ask_all) { 527 + input_mode = ask_silent; 528 + valid_stdin = 1; 529 + } 530 + conf_do_update(); 531 + return 0; 532 + } 533 + 430 534 int main(int ac, char **av) 431 535 { 432 536 int opt; ··· 569 599 default: 570 600 break; 571 601 } 572 - 573 - if (input_mode != ask_silent) { 574 - rootEntry = &rootmenu; 575 - conf(&rootmenu); 576 - if (input_mode == ask_all) { 577 - input_mode = ask_silent; 578 - valid_stdin = 1; 579 - } 580 - } else if (conf_get_changed()) { 581 - name = getenv("KCONFIG_NOSILENTUPDATE"); 582 - if (name && *name) { 583 - fprintf(stderr, _("\n*** Kernel configuration requires explicit update.\n\n")); 584 - return 1; 585 - } 586 - } else 587 - goto skip_check; 588 - 589 - do { 590 - conf_cnt = 0; 591 - check_conf(&rootmenu); 592 - } while (conf_cnt); 593 - if (conf_write(NULL)) { 594 - fprintf(stderr, _("\n*** Error during writing of the kernel configuration.\n\n")); 595 - return 1; 602 + switch (input_mode) { 603 + case set_no: 604 + conf_set_all_new_symbols(def_no); 605 + break; 606 + case set_yes: 607 + conf_set_all_new_symbols(def_yes); 608 + break; 609 + case set_mod: 610 + conf_set_all_new_symbols(def_mod); 611 + break; 612 + case set_random: 613 + conf_set_all_new_symbols(def_random); 614 + break; 615 + case set_default: 616 + conf_set_all_new_symbols(def_default); 617 + break; 618 + case ask_silent: 619 + case ask_new: 620 + if (conf_silent_update()) 621 + exit(1); 622 + break; 623 + case ask_all: 624 + if (conf_update()) 625 + exit(1); 626 + break; 596 627 } 597 - skip_check: 628 + 629 + if (conf_get_changed() && conf_write(NULL)) { 630 + fprintf(stderr, _("\n*** Error during writing of the kernel configuration.\n\n")); 631 + exit(1); 632 + } 633 + /* ask_silent is used during the build so we shall update autoconf. 634 + * All other commands are only used to generate a config. 635 + */ 598 636 if (input_mode == ask_silent && conf_write_autoconf()) { 599 637 fprintf(stderr, _("\n*** Error during writing of the kernel configuration.\n\n")); 600 638 return 1; 601 639 } 602 - 603 640 return 0; 604 641 }
+70
scripts/kconfig/confdata.c
··· 812 812 { 813 813 conf_changed_callback = fn; 814 814 } 815 + 816 + 817 + void conf_set_all_new_symbols(enum conf_def_mode mode) 818 + { 819 + struct symbol *sym, *csym; 820 + struct property *prop; 821 + struct expr *e; 822 + int i, cnt, def; 823 + 824 + for_all_symbols(i, sym) { 825 + if (sym_has_value(sym)) 826 + continue; 827 + switch (sym_get_type(sym)) { 828 + case S_BOOLEAN: 829 + case S_TRISTATE: 830 + switch (mode) { 831 + case def_yes: 832 + sym->def[S_DEF_USER].tri = yes; 833 + break; 834 + case def_mod: 835 + sym->def[S_DEF_USER].tri = mod; 836 + break; 837 + case def_no: 838 + sym->def[S_DEF_USER].tri = no; 839 + break; 840 + case def_random: 841 + sym->def[S_DEF_USER].tri = (tristate)(rand() % 3); 842 + break; 843 + default: 844 + continue; 845 + } 846 + if (!sym_is_choice(sym) || mode != def_random) 847 + sym->flags |= SYMBOL_DEF_USER; 848 + break; 849 + default: 850 + break; 851 + } 852 + 853 + } 854 + 855 + if (modules_sym) 856 + sym_calc_value(modules_sym); 857 + 858 + if (mode != def_random) 859 + return; 860 + 861 + for_all_symbols(i, csym) { 862 + if (sym_has_value(csym) || !sym_is_choice(csym)) 863 + continue; 864 + 865 + sym_calc_value(csym); 866 + prop = sym_get_choice_prop(csym); 867 + def = -1; 868 + while (1) { 869 + cnt = 0; 870 + expr_list_for_each_sym(prop->expr, e, sym) { 871 + if (sym->visible == no) 872 + continue; 873 + if (def == cnt++) { 874 + csym->def[S_DEF_USER].val = sym; 875 + break; 876 + } 877 + } 878 + if (def >= 0 || cnt < 2) 879 + break; 880 + def = (rand() % cnt) + 1; 881 + } 882 + csym->flags |= SYMBOL_DEF_USER; 883 + } 884 + }
+9
scripts/kconfig/lkc.h
··· 42 42 #define TF_PARAM 0x0002 43 43 #define TF_OPTION 0x0004 44 44 45 + enum conf_def_mode { 46 + def_default, 47 + def_yes, 48 + def_mod, 49 + def_no, 50 + def_random 51 + }; 52 + 45 53 #define T_OPT_MODULES 1 46 54 #define T_OPT_DEFCONFIG_LIST 2 47 55 #define T_OPT_ENV 3 ··· 77 69 char *conf_get_default_confname(void); 78 70 void sym_set_change_count(int count); 79 71 void sym_add_change_count(int count); 72 + void conf_set_all_new_symbols(enum conf_def_mode mode); 80 73 81 74 /* kconfig_load.c */ 82 75 void kconfig_load(void);
+1
scripts/kernel-doc
··· 1643 1643 $prototype =~ s/^__always_inline +//; 1644 1644 $prototype =~ s/^noinline +//; 1645 1645 $prototype =~ s/__devinit +//; 1646 + $prototype =~ s/__init +//; 1646 1647 $prototype =~ s/^#define\s+//; #ak added 1647 1648 $prototype =~ s/__attribute__\s*\(\([a-z,]*\)\)//; 1648 1649
+3 -1
scripts/setlocalversion
··· 12 12 if head=`git rev-parse --verify HEAD 2>/dev/null`; then 13 13 # Do we have an untagged version? 14 14 if git name-rev --tags HEAD | grep -E '^HEAD[[:space:]]+(.*~[0-9]*|undefined)$' > /dev/null; then 15 - git describe | awk -F- '{printf("-%05d-%s", $(NF-1),$(NF))}' 15 + if tag=`git describe 2>/dev/null`; then 16 + echo $tag | awk -F- '{printf("-%05d-%s", $(NF-1),$(NF))}' 17 + fi 16 18 fi 17 19 18 20 # Are there uncommitted changes?