diff options
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/Kbuild.include | 13 | ||||
-rw-r--r-- | scripts/Makefile.build | 4 | ||||
-rw-r--r-- | scripts/Makefile.modpost | 2 | ||||
-rw-r--r-- | scripts/bloat-o-meter | 58 | ||||
-rw-r--r-- | scripts/kconfig/conf.c | 18 | ||||
-rw-r--r-- | scripts/kconfig/confdata.c | 2 | ||||
-rw-r--r-- | scripts/kconfig/gconf.c | 2 | ||||
-rw-r--r-- | scripts/kconfig/lxdialog/Makefile | 48 | ||||
-rw-r--r-- | scripts/kconfig/lxdialog/check-lxdialog.sh | 80 | ||||
-rw-r--r-- | scripts/kconfig/mconf.c | 2 | ||||
-rw-r--r-- | scripts/kconfig/qconf.h | 6 | ||||
-rw-r--r-- | scripts/kconfig/symbol.c | 4 | ||||
-rwxr-xr-x | scripts/kernel-doc | 12 | ||||
-rw-r--r-- | scripts/mksysmap | 2 | ||||
-rw-r--r-- | scripts/mod/file2alias.c | 2 | ||||
-rw-r--r-- | scripts/reference_discarded.pl | 6 | ||||
-rw-r--r-- | scripts/setlocalversion | 2 |
17 files changed, 203 insertions, 60 deletions
diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include index db3c708e546b..0168d6c37075 100644 --- a/scripts/Kbuild.include +++ b/scripts/Kbuild.include @@ -3,6 +3,7 @@ # Convinient variables comma := , +squote := ' empty := space := $(empty) $(empty) @@ -12,6 +13,10 @@ space := $(empty) $(empty) depfile = $(subst $(comma),_,$(@D)/.$(@F).d) ### +# Escape single quote for use in echo statements +escsq = $(subst $(squote),'\$(squote)',$1) + +### # filechk is used to check if the content of a generated file is updated. # Sample usage: # define filechk_sample @@ -47,7 +52,7 @@ build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj # If quiet is set, only print short version of command cmd = @$(if $($(quiet)cmd_$(1)),\ - echo ' $(subst ','\'',$($(quiet)cmd_$(1)))' &&) $(cmd_$(1)) + echo ' $(call escsq,$($(quiet)cmd_$(1)))' &&) $(cmd_$(1)) # Add $(obj)/ for paths that is not absolute objectify = $(foreach o,$(1),$(if $(filter /%,$(o)),$(o),$(obj)/$(o))) @@ -68,7 +73,7 @@ endif # echo command. Short version is $(quiet) equals quiet, otherwise full command echo-cmd = $(if $($(quiet)cmd_$(1)), \ - echo ' $(subst ','\'',$($(quiet)cmd_$(1)))';) + echo ' $(call escsq,$($(quiet)cmd_$(1)))';) # function to only execute the passed command if necessary # >'< substitution is for echo to work, >$< substitution to preserve $ when reloading .cmd file @@ -78,7 +83,7 @@ if_changed = $(if $(strip $? $(call arg-check, $(cmd_$(1)), $(cmd_$@)) ), \ @set -e; \ $(echo-cmd) \ $(cmd_$(1)); \ - echo 'cmd_$@ := $(subst $$,$$$$,$(subst ','\'',$(cmd_$(1))))' > $(@D)/.$(@F).cmd) + echo 'cmd_$@ := $(subst $$,$$$$,$(call escsq,$(cmd_$(1))))' > $(@D)/.$(@F).cmd) # execute the command and also postprocess generated .d dependencies # file @@ -87,7 +92,7 @@ if_changed_dep = $(if $(strip $? $(filter-out FORCE $(wildcard $^),$^)\ @set -e; \ $(echo-cmd) \ $(cmd_$(1)); \ - scripts/basic/fixdep $(depfile) $@ '$(subst $$,$$$$,$(subst ','\'',$(cmd_$(1))))' > $(@D)/.$(@F).tmp; \ + scripts/basic/fixdep $(depfile) $@ '$(subst $$,$$$$,$(call escsq,$(cmd_$(1))))' > $(@D)/.$(@F).tmp; \ rm -f $(depfile); \ mv -f $(@D)/.$(@F).tmp $(@D)/.$(@F).cmd) diff --git a/scripts/Makefile.build b/scripts/Makefile.build index 506e3f3befe3..c33e62bde6b0 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build @@ -179,10 +179,10 @@ endif define rule_cc_o_c $(if $($(quiet)cmd_checksrc),echo ' $($(quiet)cmd_checksrc)';) \ $(cmd_checksrc) \ - $(if $($(quiet)cmd_cc_o_c),echo ' $(subst ','\'',$($(quiet)cmd_cc_o_c))';) \ + $(if $($(quiet)cmd_cc_o_c),echo ' $(call escsq,$($(quiet)cmd_cc_o_c))';) \ $(cmd_cc_o_c); \ $(cmd_modversions) \ - scripts/basic/fixdep $(depfile) $@ '$(subst ','\'',$(cmd_cc_o_c))' > $(@D)/.$(@F).tmp; \ + scripts/basic/fixdep $(depfile) $@ '$(call escsq,$(cmd_cc_o_c))' > $(@D)/.$(@F).tmp; \ rm -f $(depfile); \ mv -f $(@D)/.$(@F).tmp $(@D)/.$(@F).cmd endef diff --git a/scripts/Makefile.modpost b/scripts/Makefile.modpost index 0c4f3a9f2ea9..bf96a61d4b86 100644 --- a/scripts/Makefile.modpost +++ b/scripts/Makefile.modpost @@ -30,7 +30,7 @@ # - See include/linux/module.h for more details # Step 4 is solely used to allow module versioning in external modules, -# where the CRC of each module is retreived from the Module.symers file. +# where the CRC of each module is retrieved from the Module.symers file. .PHONY: _modpost _modpost: __modpost diff --git a/scripts/bloat-o-meter b/scripts/bloat-o-meter new file mode 100644 index 000000000000..75f21d843c1d --- /dev/null +++ b/scripts/bloat-o-meter @@ -0,0 +1,58 @@ +#!/usr/bin/python +# +# Copyright 2004 Matt Mackall <mpm@selenic.com> +# +# inspired by perl Bloat-O-Meter (c) 1997 by Andi Kleen +# +# This software may be used and distributed according to the terms +# of the GNU General Public License, incorporated herein by reference. + +import sys, os, re + +if len(sys.argv) != 3: + sys.stderr.write("usage: %s file1 file2\n" % sys.argv[0]) + sys.exit(-1) + +def getsizes(file): + sym = {} + for l in os.popen("nm --size-sort " + file).readlines(): + size, type, name = l[:-1].split() + if type in "tTdDbB": + sym[name] = int(size, 16) + return sym + +old = getsizes(sys.argv[1]) +new = getsizes(sys.argv[2]) +grow, shrink, add, remove, up, down = 0, 0, 0, 0, 0, 0 +delta, common = [], {} + +for a in old: + if a in new: + common[a] = 1 + +for name in old: + if name not in common: + remove += 1 + down += old[name] + delta.append((-old[name], name)) + +for name in new: + if name not in common: + add += 1 + up += new[name] + delta.append((new[name], name)) + +for name in common: + d = new.get(name, 0) - old.get(name, 0) + if d>0: grow, up = grow+1, up+d + if d<0: shrink, down = shrink+1, down-d + delta.append((d, name)) + +delta.sort() +delta.reverse() + +print "add/remove: %s/%s grow/shrink: %s/%s up/down: %s/%s (%s)" % \ + (add, remove, grow, shrink, up, -down, up-down) +print "%-40s %7s %7s %+7s" % ("function", "old", "new", "delta") +for d, n in delta: + if d: print "%-40s %7s %7s %+7d" % (n, old.get(n,"-"), new.get(n,"-"), d) diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c index 8ba5d29d3d42..10eeae53d827 100644 --- a/scripts/kconfig/conf.c +++ b/scripts/kconfig/conf.c @@ -63,6 +63,20 @@ static void check_stdin(void) } } +static char *fgets_check_stream(char *s, int size, FILE *stream) +{ + char *ret = fgets(s, size, stream); + + if (ret == NULL && feof(stream)) { + printf(_("aborted!\n\n")); + printf(_("Console input is closed. ")); + printf(_("Run 'make oldconfig' to update configuration.\n\n")); + exit(1); + } + + return ret; +} + static void conf_askvalue(struct symbol *sym, const char *def) { enum symbol_type type = sym_get_type(sym); @@ -100,7 +114,7 @@ static void conf_askvalue(struct symbol *sym, const char *def) check_stdin(); case ask_all: fflush(stdout); - fgets(line, 128, stdin); + fgets_check_stream(line, 128, stdin); return; case set_default: printf("%s\n", def); @@ -356,7 +370,7 @@ static int conf_choice(struct menu *menu) check_stdin(); case ask_all: fflush(stdout); - fgets(line, 128, stdin); + fgets_check_stream(line, 128, stdin); strip(line); if (line[0] == '?') { printf("\n%s\n", menu->sym->help ? diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c index ccd45130c482..b0cbbe2e41bb 100644 --- a/scripts/kconfig/confdata.c +++ b/scripts/kconfig/confdata.c @@ -375,7 +375,7 @@ int conf_write(const char *name) if (!out_h) return 1; } - sym = sym_lookup("KERNELRELEASE", 0); + sym = sym_lookup("KERNELVERSION", 0); sym_calc_value(sym); time(&now); env = getenv("KCONFIG_NOTIMESTAMP"); diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c index 9f5aabd58fa9..665bd5300a19 100644 --- a/scripts/kconfig/gconf.c +++ b/scripts/kconfig/gconf.c @@ -276,7 +276,7 @@ void init_main_window(const gchar * glade_file) NULL); sprintf(title, _("Linux Kernel v%s Configuration"), - getenv("KERNELRELEASE")); + getenv("KERNELVERSION")); gtk_window_set_title(GTK_WINDOW(main_wnd), title); gtk_widget_show(main_wnd); diff --git a/scripts/kconfig/lxdialog/Makefile b/scripts/kconfig/lxdialog/Makefile index a45a13fb26ed..fae3e29fc924 100644 --- a/scripts/kconfig/lxdialog/Makefile +++ b/scripts/kconfig/lxdialog/Makefile @@ -1,42 +1,18 @@ -HOST_EXTRACFLAGS := -DLOCALE -ifeq ($(shell uname),SunOS) -HOST_LOADLIBES := -lcurses -else -HOST_LOADLIBES := -lncurses -endif +# Makefile to build lxdialog package +# -ifeq (/usr/include/ncurses/ncurses.h, $(wildcard /usr/include/ncurses/ncurses.h)) - HOST_EXTRACFLAGS += -I/usr/include/ncurses -DCURSES_LOC="<ncurses.h>" -else -ifeq (/usr/include/ncurses/curses.h, $(wildcard /usr/include/ncurses/curses.h)) - HOST_EXTRACFLAGS += -I/usr/include/ncurses -DCURSES_LOC="<ncurses/curses.h>" -else -ifeq (/usr/include/ncurses.h, $(wildcard /usr/include/ncurses.h)) - HOST_EXTRACFLAGS += -DCURSES_LOC="<ncurses.h>" -else - HOST_EXTRACFLAGS += -DCURSES_LOC="<curses.h>" -endif -endif -endif +check-lxdialog := $(srctree)/$(src)/check-lxdialog.sh +HOST_EXTRACFLAGS:= $(shell $(CONFIG_SHELL) $(check-lxdialog) -ccflags) +HOST_LOADLIBES := $(shell $(CONFIG_SHELL) $(check-lxdialog) -ldflags $(HOSTCC)) + +HOST_EXTRACFLAGS += -DLOCALE + +.PHONY: dochecklxdialog +$(obj)/dochecklxdialog: + $(Q)$(CONFIG_SHELL) $(check-lxdialog) -check $(HOSTCC) $(HOST_LOADLIBES) hostprogs-y := lxdialog -always := ncurses $(hostprogs-y) +always := $(hostprogs-y) dochecklxdialog lxdialog-objs := checklist.o menubox.o textbox.o yesno.o inputbox.o \ util.o lxdialog.o msgbox.o - -.PHONY: $(obj)/ncurses -$(obj)/ncurses: - @echo "main() {}" > lxtemp.c - @if $(HOSTCC) lxtemp.c $(HOST_LOADLIBES); then \ - rm -f lxtemp.c a.out; \ - else \ - rm -f lxtemp.c; \ - echo -e "\007" ;\ - echo ">> Unable to find the Ncurses libraries." ;\ - echo ">>" ;\ - echo ">> You must install ncurses-devel in order" ;\ - echo ">> to use 'make menuconfig'" ;\ - echo ;\ - exit 1 ;\ - fi diff --git a/scripts/kconfig/lxdialog/check-lxdialog.sh b/scripts/kconfig/lxdialog/check-lxdialog.sh new file mode 100644 index 000000000000..448e353923f3 --- /dev/null +++ b/scripts/kconfig/lxdialog/check-lxdialog.sh @@ -0,0 +1,80 @@ +#!/bin/sh +# Check ncurses compatibility + +# What library to link +ldflags() +{ + echo "main() {}" | $cc -lncursesw -xc - -o /dev/null 2> /dev/null + if [ $? -eq 0 ]; then + echo '-lncursesw' + exit + fi + echo "main() {}" | $cc -lncurses -xc - -o /dev/null 2> /dev/null + if [ $? -eq 0 ]; then + echo '-lncurses' + exit + fi + echo "main() {}" | $cc -lcurses -xc - -o /dev/null 2> /dev/null + if [ $? -eq 0 ]; then + echo '-lcurses' + exit + fi + exit 1 +} + +# Where is ncurses.h? +ccflags() +{ + if [ -f /usr/include/ncurses/ncurses.h ]; then + echo '-I/usr/include/ncurses -DCURSES_LOC="<ncurses.h>"' + elif [ -f /usr/include/ncurses/curses.h ]; then + echo '-I/usr/include/ncurses -DCURSES_LOC="<ncurses/curses.h>"' + elif [ -f /usr/include/ncurses.h ]; then + echo '-DCURSES_LOC="<ncurses.h>"' + else + echo '-DCURSES_LOC="<curses.h>"' + fi +} + +compiler="" +# Check if we can link to ncurses +check() { + echo "main() {}" | $cc -xc - -o /dev/null 2> /dev/null + if [ $? != 0 ]; then + echo " *** Unable to find the ncurses libraries." 1>&2 + echo " *** make menuconfig require the ncurses libraries" 1>&2 + echo " *** " 1>&2 + echo " *** Install ncurses (ncurses-devel) and try again" 1>&2 + echo " *** " 1>&2 + exit 1 + fi +} + +usage() { + printf "Usage: $0 [-check compiler options|-header|-library]\n" +} + +if [ $# == 0 ]; then + usage + exit 1 +fi + +case "$1" in + "-check") + shift + cc="$@" + check + ;; + "-ccflags") + ccflags + ;; + "-ldflags") + shift + cc="$@" + ldflags + ;; + "*") + usage + exit 1 + ;; +esac diff --git a/scripts/kconfig/mconf.c b/scripts/kconfig/mconf.c index d63d7fb677e4..7f973195e79a 100644 --- a/scripts/kconfig/mconf.c +++ b/scripts/kconfig/mconf.c @@ -1051,7 +1051,7 @@ int main(int ac, char **av) conf_parse(av[1]); conf_read(NULL); - sym = sym_lookup("KERNELRELEASE", 0); + sym = sym_lookup("KERNELVERSION", 0); sym_calc_value(sym); sprintf(menu_backtitle, _("Linux Kernel v%s Configuration"), sym_get_string_value(sym)); diff --git a/scripts/kconfig/qconf.h b/scripts/kconfig/qconf.h index 7c03927d4c7c..e52f3e90bf0c 100644 --- a/scripts/kconfig/qconf.h +++ b/scripts/kconfig/qconf.h @@ -22,8 +22,8 @@ public: #if QT_VERSION >= 300 void readListSettings(); - QValueList<int> ConfigSettings::readSizes(const QString& key, bool *ok); - bool ConfigSettings::writeSizes(const QString& key, const QValueList<int>& value); + QValueList<int> readSizes(const QString& key, bool *ok); + bool writeSizes(const QString& key, const QValueList<int>& value); #endif bool showAll; @@ -124,7 +124,7 @@ public: void setParentMenu(void); template <class P> - void ConfigList::updateMenuList(P*, struct menu*); + void updateMenuList(P*, struct menu*); bool updateAll; diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c index 69c2549c0baa..3d7877afccd5 100644 --- a/scripts/kconfig/symbol.c +++ b/scripts/kconfig/symbol.c @@ -61,10 +61,10 @@ void sym_init(void) if (p) sym_add_default(sym, p); - sym = sym_lookup("KERNELRELEASE", 0); + sym = sym_lookup("KERNELVERSION", 0); sym->type = S_STRING; sym->flags |= SYMBOL_AUTO; - p = getenv("KERNELRELEASE"); + p = getenv("KERNELVERSION"); if (p) sym_add_default(sym, p); diff --git a/scripts/kernel-doc b/scripts/kernel-doc index 2f45fd2969d0..9fd5f5b87d1e 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -1405,6 +1405,7 @@ sub create_parameterlist($$$) { my $type; my $param; + # temporarily replace commas inside function pointer definition while ($args =~ /(\([^\),]+),/) { $args =~ s/(\([^\),]+),/$1#/g; } @@ -1465,11 +1466,10 @@ sub push_parameter($$$) { my $param_name = $param; $param_name =~ s/\[.*//; - if ($type eq "" && $param eq "...") + if ($type eq "" && $param =~ /\.\.\.$/) { $type=""; - $param="..."; - $parameterdescs{"..."} = "variable arguments"; + $parameterdescs{$param} = "variable arguments"; } elsif ($type eq "" && ($param eq "" or $param eq "void")) { @@ -1477,7 +1477,11 @@ sub push_parameter($$$) { $param="void"; $parameterdescs{void} = "no arguments"; } - if (defined $type && $type && !defined $parameterdescs{$param_name}) { + # warn if parameter has no description + # (but ignore ones starting with # as these are no parameters + # but inline preprocessor statements + if (!defined $parameterdescs{$param_name} && $param_name !~ /^#/) { + $parameterdescs{$param_name} = $undescribed; if (($type eq 'function') || ($type eq 'enum')) { diff --git a/scripts/mksysmap b/scripts/mksysmap index a6430e05972d..4390fab9f5bd 100644 --- a/scripts/mksysmap +++ b/scripts/mksysmap @@ -1,7 +1,7 @@ #!/bin/sh -x # Based on the vmlinux file create the System.map file # System.map is used by module-init tools and some debugging -# tools to retreive the actual addresses of symbols in the kernel. +# tools to retrieve the actual addresses of symbols in the kernel. # # Usage # mksysmap vmlinux System.map diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c index e0eedffe565b..be97caf664bb 100644 --- a/scripts/mod/file2alias.c +++ b/scripts/mod/file2alias.c @@ -417,7 +417,7 @@ static int do_input_entry(const char *filename, struct input_device_id *id, do_input(alias, id->sndbit, 0, SND_MAX); sprintf(alias + strlen(alias), "f*"); if (id->flags&INPUT_DEVICE_ID_MATCH_FFBIT) - do_input(alias, id->ffbit, 0, SND_MAX); + do_input(alias, id->ffbit, 0, FF_MAX); sprintf(alias + strlen(alias), "w*"); if (id->flags&INPUT_DEVICE_ID_MATCH_SWBIT) do_input(alias, id->swbit, 0, SW_MAX); diff --git a/scripts/reference_discarded.pl b/scripts/reference_discarded.pl index c2d54148a91f..4ee6ab2135b3 100644 --- a/scripts/reference_discarded.pl +++ b/scripts/reference_discarded.pl @@ -71,6 +71,11 @@ foreach $object (keys(%object)) { # printf("ignoring %d conglomerate(s)\n", $ignore); # printf("Scanning objects\n"); + +# Keith Ownes <kaos@sgi.com> commented: +# For our future {in}sanity, add a comment that this is the ppc .opd +# section, not the ia64 .opd section. +# ia64 .opd should not point to discarded sections. $errorcount = 0; foreach $object (keys(%object)) { my $from; @@ -88,6 +93,7 @@ foreach $object (keys(%object)) { ($from !~ /\.text\.exit$/ && $from !~ /\.exit\.text$/ && $from !~ /\.data\.exit$/ && + $from !~ /\.opd$/ && $from !~ /\.exit\.data$/ && $from !~ /\.altinstructions$/ && $from !~ /\.pdr$/ && diff --git a/scripts/setlocalversion b/scripts/setlocalversion index f54dac88cfd1..9a23825218f2 100644 --- a/scripts/setlocalversion +++ b/scripts/setlocalversion @@ -17,6 +17,6 @@ if head=`git rev-parse --verify HEAD 2>/dev/null`; then # Are there uncommitted changes? if git diff-files | read dummy; then - printf '%s' -git_dirty + printf '%s' -dirty fi fi |