diff options
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/Makefile.lib | 28 | ||||
| -rw-r--r-- | scripts/Makefile.modinst | 5 | ||||
| -rw-r--r-- | scripts/genksyms/genksyms.h | 16 | ||||
| -rw-r--r-- | scripts/kconfig/Makefile | 8 | ||||
| -rw-r--r-- | scripts/mod/modpost.c | 5 | ||||
| -rw-r--r-- | scripts/mod/modpost.h | 4 | ||||
| -rw-r--r-- | scripts/namespace.pl | 5 |
7 files changed, 48 insertions, 23 deletions
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 6e75ced8b583..7cf75cc4f849 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -183,15 +183,24 @@ cmd_gzip = gzip -f -9 < $< > $@ # Generic stuff # =========================================================================== +ifneq ($(KBUILD_NOCMDDEP),1) +# Check if both arguments has same arguments. Result in empty string if equal +# User may override this check using make KBUILD_NOCMDDEP=1 +arg-check = $(strip $(filter-out $(1), $(2)) $(filter-out $(2), $(1)) ) + +endif + +# echo command. Short version is $(quiet) equals quiet, otherwise full command +echo-cmd = $(if $($(quiet)cmd_$(1)), \ + echo ' $(subst ','\'',$($(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 # note: when using inline perl scripts [perl -e '...$$t=1;...'] in $(cmd_xxx) double $$ your perl vars - -if_changed = $(if $(strip $? \ - $(filter-out $(cmd_$(1)),$(cmd_$@))\ - $(filter-out $(cmd_$@),$(cmd_$(1)))),\ +# +if_changed = $(if $(strip $? $(call arg-check, $(cmd_$(1)), $(cmd_$@)) ), \ @set -e; \ - $(if $($(quiet)cmd_$(1)),echo ' $(subst ','\'',$($(quiet)cmd_$(1)))';) \ + $(echo-cmd) \ $(cmd_$(1)); \ echo 'cmd_$@ := $(subst $$,$$$$,$(subst ','\'',$(cmd_$(1))))' > $(@D)/.$(@F).cmd) @@ -200,10 +209,9 @@ if_changed = $(if $(strip $? \ # file if_changed_dep = $(if $(strip $? $(filter-out FORCE $(wildcard $^),$^)\ - $(filter-out $(cmd_$(1)),$(cmd_$@))\ - $(filter-out $(cmd_$@),$(cmd_$(1)))),\ + $(call arg-check, $(cmd_$(1)), $(cmd_$@)) ), \ @set -e; \ - $(if $($(quiet)cmd_$(1)),echo ' $(subst ','\'',$($(quiet)cmd_$(1)))';) \ + $(echo-cmd) \ $(cmd_$(1)); \ scripts/basic/fixdep $(depfile) $@ '$(subst $$,$$$$,$(subst ','\'',$(cmd_$(1))))' > $(@D)/.$(@F).tmp; \ rm -f $(depfile); \ @@ -213,9 +221,7 @@ if_changed_dep = $(if $(strip $? $(filter-out FORCE $(wildcard $^),$^)\ # will check if $(cmd_foo) changed, or any of the prequisites changed, # and if so will execute $(rule_foo) -if_changed_rule = $(if $(strip $? \ - $(filter-out $(cmd_$(1)),$(cmd_$@))\ - $(filter-out $(cmd_$@),$(cmd_$(1)))),\ +if_changed_rule = $(if $(strip $? $(call arg-check, $(cmd_$(1)), $(cmd_$@)) ),\ @set -e; \ $(rule_$(1))) diff --git a/scripts/Makefile.modinst b/scripts/Makefile.modinst index ba47b7fcb140..85d6494e3c24 100644 --- a/scripts/Makefile.modinst +++ b/scripts/Makefile.modinst @@ -21,8 +21,9 @@ quiet_cmd_modules_install = INSTALL $@ # Modules built outside the kernel source tree go into extra by default INSTALL_MOD_DIR ?= extra +ext-mod-dir = $(INSTALL_MOD_DIR)$(subst $(KBUILD_EXTMOD),,$(@D)) -modinst_dir = $(MODLIB)/$(if $(filter ../% /%,$@),$(INSTALL_MOD_DIR)/,kernel/$(@D)) +modinst_dir = $(if $(KBUILD_EXTMOD),$(ext-mod-dir),kernel/$(@D)) $(modules): - $(call cmd,modules_install,$(modinst_dir)) + $(call cmd,modules_install,$(MODLIB)/$(modinst_dir)) diff --git a/scripts/genksyms/genksyms.h b/scripts/genksyms/genksyms.h index 7b711731abf2..f09af47ab281 100644 --- a/scripts/genksyms/genksyms.h +++ b/scripts/genksyms/genksyms.h @@ -25,7 +25,6 @@ #define MODUTILS_GENKSYMS_H 1 #include <stdio.h> -#include <assert.h> enum symbol_type @@ -89,8 +88,17 @@ void error_with_pos(const char *, ...); #define MODUTILS_VERSION "<in-kernel>" -#define xmalloc(size) ({ void *__ptr = malloc(size); assert(__ptr || size == 0); __ptr; }) -#define xstrdup(str) ({ char *__str = strdup(str); assert(__str); __str; }) - +#define xmalloc(size) ({ void *__ptr = malloc(size); \ + if(!__ptr && size != 0) { \ + fprintf(stderr, "out of memory\n"); \ + exit(1); \ + } \ + __ptr; }) +#define xstrdup(str) ({ char *__str = strdup(str); \ + if (!__str) { \ + fprintf(stderr, "out of memory\n"); \ + exit(1); \ + } \ + __str; }) #endif /* genksyms.h */ diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile index 51492ba6fbcd..5a5ddc40f36c 100644 --- a/scripts/kconfig/Makefile +++ b/scripts/kconfig/Makefile @@ -50,10 +50,12 @@ endif # Help text used by make help help: - @echo ' oldconfig - Update current config utilising a line-oriented program' + @echo ' config - Update current config utilising a line-oriented program' @echo ' menuconfig - Update current config utilising a menu based program' @echo ' xconfig - Update current config utilising a QT based front-end' @echo ' gconfig - Update current config utilising a GTK based front-end' + @echo ' oldconfig - Update current config utilising a provided .config as base' + @echo ' randconfig - New config with random answer to all options' @echo ' defconfig - New config with default answer to all options' @echo ' allmodconfig - New config selecting modules when possible' @echo ' allyesconfig - New config where all options are accepted with yes' @@ -107,6 +109,10 @@ HOSTCFLAGS_gconf.o = `pkg-config gtk+-2.0 gmodule-2.0 libglade-2.0 --cflags` \ $(obj)/conf.o $(obj)/mconf.o $(obj)/qconf.o $(obj)/gconf.o: $(obj)/zconf.tab.h +$(obj)/zconf.tab.h: $(src)/zconf.tab.h_shipped +$(obj)/zconf.tab.c: $(src)/zconf.tab.c_shipped +$(obj)/lex.zconf.c: $(src)/lex.zconf.c_shipped + $(obj)/qconf.o: $(obj)/.tmp_qtcheck ifeq ($(qconf-target),1) diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index 347549c35d6c..9b9f94c915d2 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -47,11 +47,10 @@ warn(const char *fmt, ...) va_end(arglist); } -void *do_nofail(void *ptr, const char *file, int line, const char *expr) +void *do_nofail(void *ptr, const char *expr) { if (!ptr) { - fatal("Memory allocation failure %s line %d: %s.\n", - file, line, expr); + fatal("modpost: Memory allocation failure: %s.\n", expr); } return ptr; } diff --git a/scripts/mod/modpost.h b/scripts/mod/modpost.h index eb8815ae209e..7334d839145d 100644 --- a/scripts/mod/modpost.h +++ b/scripts/mod/modpost.h @@ -53,8 +53,8 @@ static inline void __endian(const void *src, void *dest, unsigned int size) #endif -#define NOFAIL(ptr) do_nofail((ptr), __FILE__, __LINE__, #ptr) -void *do_nofail(void *ptr, const char *file, int line, const char *expr); +#define NOFAIL(ptr) do_nofail((ptr), #ptr) +void *do_nofail(void *ptr, const char *expr); struct buffer { char *p; diff --git a/scripts/namespace.pl b/scripts/namespace.pl index 399c831e5d12..88e30e82f1ca 100644 --- a/scripts/namespace.pl +++ b/scripts/namespace.pl @@ -406,6 +406,11 @@ sub resolve_external_references && $name !~ /^__.*per_cpu_end/ && $name !~ /^__alt_instructions/ && $name !~ /^__setup_/ + && $name !~ /^jiffies/ + && $name !~ /^__mod_timer/ + && $name !~ /^__mod_page_state/ + && $name !~ /^init_module/ + && $name !~ /^cleanup_module/ ) { printf "Cannot resolve "; printf "weak " if ($type eq "w"); |
