Commit f56dec02 authored by Kai Germaschewski's avatar Kai Germaschewski

Merge tp1.ruhr-uni-bochum.de:/home/kai/kernel/v2.5/linux-2.5

into tp1.ruhr-uni-bochum.de:/home/kai/kernel/v2.5/linux-2.5.make
parents 3da9cf28 561e79b0
...@@ -106,21 +106,23 @@ DEPMOD = /sbin/depmod ...@@ -106,21 +106,23 @@ DEPMOD = /sbin/depmod
PERL = perl PERL = perl
MODFLAGS = -DMODULE MODFLAGS = -DMODULE
CFLAGS_MODULE = $(MODFLAGS) CFLAGS_MODULE = $(MODFLAGS)
AFLAGS_MODULE = AFLAGS_MODULE = $(MODFLAGS)
CFLAGS_KERNEL = CFLAGS_KERNEL =
AFLAGS_KERNEL = AFLAGS_KERNEL =
EXPORT_FLAGS = EXPORT_FLAGS =
NOSTDINC_FLAGS = -nostdinc -iwithprefix include
export VERSION PATCHLEVEL SUBLEVEL EXTRAVERSION KERNELRELEASE ARCH \ export VERSION PATCHLEVEL SUBLEVEL EXTRAVERSION KERNELRELEASE ARCH \
CONFIG_SHELL TOPDIR HPATH HOSTCC HOSTCFLAGS CROSS_COMPILE AS LD CC \ CONFIG_SHELL TOPDIR HPATH HOSTCC HOSTCFLAGS CROSS_COMPILE AS LD CC \
CPP AR NM STRIP OBJCOPY OBJDUMP MAKE MAKEFILES GENKSYMS PERL CPP AR NM STRIP OBJCOPY OBJDUMP MAKE MAKEFILES GENKSYMS PERL
export CPPFLAGS EXPORT_FLAGS export CPPFLAGS EXPORT_FLAGS NOSTDINC_FLAGS
export CFLAGS CFLAGS_KERNEL CFLAGS_MODULE export CFLAGS CFLAGS_KERNEL CFLAGS_MODULE
export AFLAGS AFLAGS_KERNEL AFLAGS_MODULE export AFLAGS AFLAGS_KERNEL AFLAGS_MODULE
noconfig_targets := oldconfig xconfig menuconfig config clean mrproper \ noconfig_targets := xconfig menuconfig config oldconfig randconfig \
distclean defconfig allyesconfig allnoconfig allmodconfig \
clean mrproper distclean
ifeq ($(filter $(noconfig_targets),$(MAKECMDGOALS)),) ifeq ($(filter $(noconfig_targets),$(MAKECMDGOALS)),)
...@@ -175,18 +177,14 @@ ifdef CONFIG_MODULES ...@@ -175,18 +177,14 @@ ifdef CONFIG_MODULES
EXPORT_FLAGS := -DEXPORT_SYMTAB EXPORT_FLAGS := -DEXPORT_SYMTAB
endif endif
INIT =init/init.o # Link components for vmlinux
CORE_FILES =kernel/kernel.o mm/mm.o fs/fs.o ipc/ipc.o # ---------------------------------------------------------------------------
NETWORKS =net/network.o SUBDIRS := init kernel mm fs ipc lib drivers sound net
INIT := init/init.o
LIBS =$(TOPDIR)/lib/lib.a CORE_FILES := kernel/kernel.o mm/mm.o fs/fs.o ipc/ipc.o
SUBDIRS =init kernel lib drivers mm fs net ipc sound LIBS := lib/lib.a
DRIVERS := drivers/built-in.o sound/sound.o
DRIVERS-y = drivers/built-in.o NETWORKS := net/network.o
DRIVERS-$(CONFIG_SOUND) += sound/sound.o
DRIVERS := $(DRIVERS-y)
include arch/$(ARCH)/Makefile include arch/$(ARCH)/Makefile
...@@ -300,8 +298,19 @@ include/linux/autoconf.h: .config ...@@ -300,8 +298,19 @@ include/linux/autoconf.h: .config
# version.h changes when $(KERNELRELEASE) etc change, as defined in # version.h changes when $(KERNELRELEASE) etc change, as defined in
# this Makefile # this Makefile
uts_len := 64
include/linux/version.h: Makefile include/linux/version.h: Makefile
@scripts/mkversion_h $@ $(KERNELRELEASE) $(VERSION) $(PATCHLEVEL) $(SUBLEVEL) @if expr length "$(KERNELRELEASE)" \> $(uts_len) >/dev/null ; then \
echo '"$(KERNELRELEASE)" exceeds $(uts_len) characters' >&2; \
exit 1; \
fi;
@echo -n 'Generating $@'
@(echo \#define UTS_RELEASE \"$(KERNELRELEASE)\"; \
echo \#define LINUX_VERSION_CODE `expr $(VERSION) \\* 65536 + $(PATCHLEVEL) \\* 256 + $(SUBLEVEL)`; \
echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))'; \
) > $@.tmp
@$(update-if-changed)
# Helpers built in scripts/ # Helpers built in scripts/
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
...@@ -339,6 +348,7 @@ ifdef CONFIG_MODVERSIONS ...@@ -339,6 +348,7 @@ ifdef CONFIG_MODVERSIONS
include/linux/modversions.h: scripts/fixdep prepare FORCE include/linux/modversions.h: scripts/fixdep prepare FORCE
@rm -rf .tmp_export-objs @rm -rf .tmp_export-objs
@$(MAKE) $(patsubst %,_sfdep_%,$(SUBDIRS)) @$(MAKE) $(patsubst %,_sfdep_%,$(SUBDIRS))
@echo -n 'Generating $@'
@( echo "#ifndef _LINUX_MODVERSIONS_H";\ @( echo "#ifndef _LINUX_MODVERSIONS_H";\
echo "#define _LINUX_MODVERSIONS_H"; \ echo "#define _LINUX_MODVERSIONS_H"; \
echo "#include <linux/modsetver.h>"; \ echo "#include <linux/modsetver.h>"; \
...@@ -346,15 +356,8 @@ include/linux/modversions.h: scripts/fixdep prepare FORCE ...@@ -346,15 +356,8 @@ include/linux/modversions.h: scripts/fixdep prepare FORCE
echo "#include <linux/$${f}>"; \ echo "#include <linux/$${f}>"; \
done; \ done; \
echo "#endif"; \ echo "#endif"; \
) > $@.tmp ) > $@.tmp; \
@rm -rf .tmp_export-objs $(update-if-changed)
@if [ -r $@ ] && cmp -s $@ $@.tmp; then \
echo $@ was not updated; \
rm -f $@.tmp; \
else \
echo $@ was updated; \
mv -f $@.tmp $@; \
fi
$(patsubst %,_sfdep_%,$(SUBDIRS)): FORCE $(patsubst %,_sfdep_%,$(SUBDIRS)): FORCE
@$(MAKE) -C $(patsubst _sfdep_%, %, $@) fastdep @$(MAKE) -C $(patsubst _sfdep_%, %, $@) fastdep
...@@ -519,9 +522,6 @@ else # ifeq ($(filter $(noconfig_targets),$(MAKECMDGOALS)),) ...@@ -519,9 +522,6 @@ else # ifeq ($(filter $(noconfig_targets),$(MAKECMDGOALS)),)
.PHONY: oldconfig xconfig menuconfig config \ .PHONY: oldconfig xconfig menuconfig config \
make_with_config make_with_config
oldconfig:
$(CONFIG_SHELL) scripts/Configure -d arch/$(ARCH)/config.in
xconfig: xconfig:
@$(MAKE) -C scripts kconfig.tk @$(MAKE) -C scripts kconfig.tk
wish -f scripts/kconfig.tk wish -f scripts/kconfig.tk
...@@ -533,6 +533,24 @@ menuconfig: ...@@ -533,6 +533,24 @@ menuconfig:
config: config:
$(CONFIG_SHELL) scripts/Configure arch/$(ARCH)/config.in $(CONFIG_SHELL) scripts/Configure arch/$(ARCH)/config.in
oldconfig:
$(CONFIG_SHELL) scripts/Configure -d arch/$(ARCH)/config.in
randconfig:
$(CONFIG_SHELL) scripts/Configure -r arch/$(ARCH)/config.in
allyesconfig:
$(CONFIG_SHELL) scripts/Configure -y arch/$(ARCH)/config.in
allnoconfig:
$(CONFIG_SHELL) scripts/Configure -n arch/$(ARCH)/config.in
allmodconfig:
$(CONFIG_SHELL) scripts/Configure -m arch/$(ARCH)/config.in
defconfig:
yes '' | $(CONFIG_SHELL) scripts/Configure -d arch/$(ARCH)/config.in
# How we generate .config depends on which *config the # How we generate .config depends on which *config the
# user chose when calling make # user chose when calling make
...@@ -576,10 +594,6 @@ CLEAN_FILES += \ ...@@ -576,10 +594,6 @@ CLEAN_FILES += \
net/khttpd/times.h \ net/khttpd/times.h \
submenu* submenu*
# directories removed with 'make clean'
CLEAN_DIRS += \
modules
# files removed with 'make mrproper' # files removed with 'make mrproper'
MRPROPER_FILES += \ MRPROPER_FILES += \
include/linux/autoconf.h include/linux/version.h \ include/linux/autoconf.h include/linux/version.h \
...@@ -617,7 +631,6 @@ clean: archclean ...@@ -617,7 +631,6 @@ clean: archclean
-name .\*.tmp -o -name .\*.d \) -type f -print \ -name .\*.tmp -o -name .\*.d \) -type f -print \
| grep -v lxdialog/ | xargs rm -f | grep -v lxdialog/ | xargs rm -f
@rm -f $(CLEAN_FILES) @rm -f $(CLEAN_FILES)
@rm -rf $(CLEAN_DIRS)
@$(MAKE) -C Documentation/DocBook clean @$(MAKE) -C Documentation/DocBook clean
mrproper: clean archmrproper mrproper: clean archmrproper
...@@ -660,5 +673,15 @@ if_changed_rule = $(if $(strip $? \ ...@@ -660,5 +673,15 @@ if_changed_rule = $(if $(strip $? \
cmd = @$(if $($(quiet)$(1)),echo ' $($(quiet)$(1))' &&) $($(1)) cmd = @$(if $($(quiet)$(1)),echo ' $($(quiet)$(1))' &&) $($(1))
define update-if-changed
if [ -r $@ ] && cmp -s $@ $@.tmp; then \
echo ' (unchanged)'; \
rm -f $@.tmp; \
else \
echo ' (updated)'; \
mv -f $@.tmp $@; \
fi
endef
FORCE: FORCE:
...@@ -121,7 +121,7 @@ $(export-objs:.o=.i) : export_flags := $(EXPORT_FLAGS) ...@@ -121,7 +121,7 @@ $(export-objs:.o=.i) : export_flags := $(EXPORT_FLAGS)
$(export-objs:.o=.s) : export_flags := $(EXPORT_FLAGS) $(export-objs:.o=.s) : export_flags := $(EXPORT_FLAGS)
$(export-objs:.o=.lst): export_flags := $(EXPORT_FLAGS) $(export-objs:.o=.lst): export_flags := $(EXPORT_FLAGS)
c_flags = $(CFLAGS) $(modkern_cflags) $(EXTRA_CFLAGS) $(CFLAGS_$(*F).o) -DKBUILD_BASENAME=$(subst $(comma),_,$(subst -,_,$(*F))) $(export_flags) c_flags = $(CFLAGS) $(NOSTDINC_FLAGS) $(modkern_cflags) $(EXTRA_CFLAGS) $(CFLAGS_$(*F).o) -DKBUILD_BASENAME=$(subst $(comma),_,$(subst -,_,$(*F))) $(export_flags)
quiet_cmd_cc_s_c = CC $(RELDIR)/$@ quiet_cmd_cc_s_c = CC $(RELDIR)/$@
cmd_cc_s_c = $(CC) $(c_flags) -S -o $@ $< cmd_cc_s_c = $(CC) $(c_flags) -S -o $@ $<
...@@ -159,7 +159,7 @@ $(real-objs-y:.o=.s): modkern_aflags := $(AFLAGS_KERNEL) ...@@ -159,7 +159,7 @@ $(real-objs-y:.o=.s): modkern_aflags := $(AFLAGS_KERNEL)
$(real-objs-m) : modkern_aflags := $(AFLAGS_MODULE) $(real-objs-m) : modkern_aflags := $(AFLAGS_MODULE)
$(real-objs-m:.o=.s): modkern_aflags := $(AFLAGS_MODULE) $(real-objs-m:.o=.s): modkern_aflags := $(AFLAGS_MODULE)
a_flags = $(AFLAGS) $(modkern_aflags) $(EXTRA_AFLAGS) $(AFLAGS_$(*F).o) a_flags = $(AFLAGS) $(NOSTDINC_FLAGS) $(modkern_aflags) $(EXTRA_AFLAGS) $(AFLAGS_$(*F).o)
quiet_cmd_as_s_S = CPP $(RELDIR)/$@ quiet_cmd_as_s_S = CPP $(RELDIR)/$@
cmd_as_s_S = $(CPP) $(a_flags) -o $@ $< cmd_as_s_S = $(CPP) $(a_flags) -o $@ $<
......
...@@ -4,10 +4,6 @@ ...@@ -4,10 +4,6 @@
EXTRA_AFLAGS := -ansi EXTRA_AFLAGS := -ansi
ifeq ($(CONFIG_SOLARIS_EMUL),m)
EXTRA_AFLAGS += $(CFLAGS_MODULE) # FIXME
endif
solaris-objs := entry64.o fs.o misc.o signal.o systbl.o socket.o \ solaris-objs := entry64.o fs.o misc.o signal.o systbl.o socket.o \
ioctl.o ipc.o socksys.o timod.o ioctl.o ipc.o socksys.o timod.o
......
...@@ -896,7 +896,8 @@ foreach $label (@label) { ...@@ -896,7 +896,8 @@ foreach $label (@label) {
open (OUTPUT, ">$output") || die "$0 : can't open $output for writing\n"; open (OUTPUT, ">$output") || die "$0 : can't open $output for writing\n";
open (OUTPUTU, ">$outputu") || die "$0 : can't open $outputu for writing\n"; open (OUTPUTU, ">$outputu") || die "$0 : can't open $outputu for writing\n";
print OUTPUT "/* DO NOT EDIT - Generated automatically by ".$0." */\n"; ($_ = $0) =~ s:.*/::;
print OUTPUT "/* DO NOT EDIT - Generated automatically by ".$_." */\n";
print OUTPUT "static u32 ".$prefix."SCRIPT[] = {\n"; print OUTPUT "static u32 ".$prefix."SCRIPT[] = {\n";
$instructions = 0; $instructions = 0;
for ($i = 0; $i < $#code; ) { for ($i = 0; $i < $#code; ) {
......
...@@ -22,4 +22,5 @@ $(TOPDIR)/include/linux/compile.h: ../include/linux/compile.h ; ...@@ -22,4 +22,5 @@ $(TOPDIR)/include/linux/compile.h: ../include/linux/compile.h ;
# actual file if its content has changed. # actual file if its content has changed.
../include/linux/compile.h: FORCE ../include/linux/compile.h: FORCE
@echo -n 'Generating $@'
@../scripts/mkcompile_h $@ "$(ARCH)" "$(CONFIG_SMP)" "$(CC) $(CFLAGS)" @../scripts/mkcompile_h $@ "$(ARCH)" "$(CONFIG_SMP)" "$(CC) $(CFLAGS)"
...@@ -48,6 +48,10 @@ ...@@ -48,6 +48,10 @@
# #
# 24 January 1999, Michael Elizabeth Chastain, <mec@shout.net> # 24 January 1999, Michael Elizabeth Chastain, <mec@shout.net>
# - Improve the exit message (Jeff Ronne). # - Improve the exit message (Jeff Ronne).
#
# 7 October 2000, Ghozlane Toumi, <gtoumi@messel.emse.fr>
# added switches for "random" , "all yes" and "all modules"
#
# #
# Make sure we're really running bash. # Make sure we're really running bash.
...@@ -75,6 +79,43 @@ function endmenu () { ...@@ -75,6 +79,43 @@ function endmenu () {
: :
} }
#
# returns a random number between 1 and $1
#
function rnd () {
rnd=$[ $RANDOM % $1 + 1 ]
}
#
# randomly chose a number in a config list (LIST_CONFIG_NAME)
# or in a range ( MIN_CONFIG_NAME MAX_CONFIG_NAME )
# ONLY if there is no forced default (and we are in an "auto" mode)
# we are limited by the range of values taken by "$RANDOM"
#
# rndval CONFIG_NAME
#
function rndval () {
[ "$AUTO" != "yes" -o -n "$old" ] && return
def_list=$(eval echo "\${LIST_$1}")
def_min=$(eval echo "\${MIN_$1}")
def_max=$(eval echo "\${MAX_$1}")
if [ -n "$def_list" ]; then
set -- $(echo $def_list | sed 's/,/ /g')
rnd $#
while [ $rnd -le $# ] ; do
def=$1
shift
done
return
fi
if [ -n "$def_min" -a -n "$def_max" ]; then
rnd $[ $def_max - $def_min ]
def=$[ $def_min + $rnd ]
fi
}
# #
# help prints the corresponding help text from Configure.help to stdout # help prints the corresponding help text from Configure.help to stdout
# #
...@@ -109,7 +150,11 @@ ${var}:\\ ...@@ -109,7 +150,11 @@ ${var}:\\
# readln prompt default oldval # readln prompt default oldval
# #
function readln () { function readln () {
if [ "$DEFAULT" = "-d" -a -n "$3" ]; then if [ "$AUTO" = "yes" ]; then
echo -n "$1"
ans=$2
echo $ans
elif [ "$DEFAULT" = "-d" -a -n "$3" ]; then
echo "$1" echo "$1"
ans=$2 ans=$2
else else
...@@ -169,6 +214,17 @@ function define_tristate () { ...@@ -169,6 +214,17 @@ function define_tristate () {
function bool () { function bool () {
old=$(eval echo "\${$2}") old=$(eval echo "\${$2}")
def=${old:-'n'} def=${old:-'n'}
if [ "$AUTO" = "yes" -a -z "$old" ]; then
if [ "$RND" = "-r" ]; then
rnd 2
case $rnd in
"1") def="y" ;;
"2") def="n" ;;
esac
else
def=$DEF_ANS;
fi
fi
case "$def" in case "$def" in
"y" | "m") defprompt="Y/n/?" "y" | "m") defprompt="Y/n/?"
def="y" def="y"
...@@ -200,6 +256,18 @@ function tristate () { ...@@ -200,6 +256,18 @@ function tristate () {
else else
old=$(eval echo "\${$2}") old=$(eval echo "\${$2}")
def=${old:-'n'} def=${old:-'n'}
if [ "$AUTO" = "yes" -a -z "$old" ]; then
if [ "$RND" = "-r" ]; then
rnd 3
case $rnd in
"1") def="y" ;;
"2") def="n" ;;
"3") def="m" ;;
esac
else
def=$DEF_ANS
fi
fi
case "$def" in case "$def" in
"y") defprompt="Y/m/n/?" "y") defprompt="Y/m/n/?"
;; ;;
...@@ -256,6 +324,17 @@ function dep_tristate () { ...@@ -256,6 +324,17 @@ function dep_tristate () {
if [ $need_module = 1 ]; then if [ $need_module = 1 ]; then
if [ "$CONFIG_MODULES" = "y" ]; then if [ "$CONFIG_MODULES" = "y" ]; then
if [ "$AUTO" = "yes" -a -z "$old" ]; then
if [ "$RND" = "-r" ]; then
rnd 2
case $rnd in
"1") def="m" ;;
"2") def="n" ;;
esac
else
def=$DEF_ANS
fi
fi
case "$def" in case "$def" in
"y" | "m") defprompt="M/n/?" "y" | "m") defprompt="M/n/?"
def="m" def="m"
...@@ -351,6 +430,7 @@ function int () { ...@@ -351,6 +430,7 @@ function int () {
else else
max=10000000 # !! max=10000000 # !!
fi fi
rndval $2
while :; do while :; do
readln "$1 ($2) [$def] " "$def" "$old" readln "$1 ($2) [$def] " "$def" "$old"
if expr \( \( $ans + 0 \) \>= $min \) \& \( $ans \<= $max \) >/dev/null 2>&1 ; then if expr \( \( $ans + 0 \) \>= $min \) \& \( $ans \<= $max \) >/dev/null 2>&1 ; then
...@@ -382,6 +462,7 @@ function hex () { ...@@ -382,6 +462,7 @@ function hex () {
old=$(eval echo "\${$2}") old=$(eval echo "\${$2}")
def=${old:-$3} def=${old:-$3}
def=${def#*[x,X]} def=${def#*[x,X]}
rndval $2
while :; do while :; do
readln "$1 ($2) [$def] " "$def" "$old" readln "$1 ($2) [$def] " "$def" "$old"
ans=${ans#*[x,X]} ans=${ans#*[x,X]}
...@@ -464,6 +545,15 @@ function choice () { ...@@ -464,6 +545,15 @@ function choice () {
shift; shift shift; shift
done done
if [ "$RND" = "-r" -a -z "$old" ] ; then
set -- $choices
rnd $#
while [ $rnd -le $# ] ; do
def=$1
shift ; shift
done
fi
val="" val=""
while [ -z "$val" ]; do while [ -z "$val" ]; do
ambg=n ambg=n
...@@ -512,6 +602,7 @@ function choice () { ...@@ -512,6 +602,7 @@ function choice () {
CONFIG=.tmpconfig CONFIG=.tmpconfig
CONFIG_H=.tmpconfig.h CONFIG_H=.tmpconfig.h
FORCE_DEFAULT=.force_default
trap "rm -f $CONFIG $CONFIG_H ; exit 1" 1 2 trap "rm -f $CONFIG $CONFIG_H ; exit 1" 1 2
# #
...@@ -532,23 +623,28 @@ if [ "$1" = "-d" ] ; then ...@@ -532,23 +623,28 @@ if [ "$1" = "-d" ] ; then
shift shift
fi fi
RND=""
DEF_ANS=""
AUTO=""
case "$1" in
-r) RND="-r" ; AUTO="yes" ; shift ;;
-y) DEF_ANS="y" ; AUTO="yes" ; shift ;;
-m) DEF_ANS="m" ; AUTO="yes" ; shift ;;
-n) DEF_ANS="n" ; AUTO="yes" ; shift ;;
esac
CONFIG_IN=./config.in CONFIG_IN=./config.in
if [ "$1" != "" ] ; then if [ "$1" != "" ] ; then
CONFIG_IN=$1 CONFIG_IN=$1
fi fi
DEFAULTS=.config for DEFAULTS in .config /lib/modules/`uname -r`/.config /etc/kernel-config /boot/config-`uname -r` arch/$ARCH/defconfig
if [ ! -f .config ]; then do
DEFAULTS=/etc/kernel-config [ -r $DEFAULTS ] && break
if [ ! -f $DEFAULTS ]; then done
DEFAULTS=/boot/config-`uname -r`
if [ ! -f $DEFAULTS ]; then
DEFAULTS=arch/$ARCH/defconfig
fi
fi
fi
if [ -f $DEFAULTS ]; then if [ "$AUTO" != "yes" ]; then
if [ -f $DEFAULTS ]; then
echo "#" echo "#"
echo "# Using defaults found in" $DEFAULTS echo "# Using defaults found in" $DEFAULTS
echo "#" echo "#"
...@@ -556,10 +652,28 @@ if [ -f $DEFAULTS ]; then ...@@ -556,10 +652,28 @@ if [ -f $DEFAULTS ]; then
sed -e 's/# \(CONFIG_[^ ]*\) is not.*/\1=n/' <$DEFAULTS >.config-is-not.$$ sed -e 's/# \(CONFIG_[^ ]*\) is not.*/\1=n/' <$DEFAULTS >.config-is-not.$$
. .config-is-not.$$ . .config-is-not.$$
rm .config-is-not.$$ rm .config-is-not.$$
else
echo "#"
echo "# No defaults found"
echo "#"
fi
else else
if [ -f $FORCE_DEFAULT ]; then
echo "#"
echo "# Forcing defaults found in $FORCE_DEFAULT"
echo "#"
sed -e '
s/# \(CONFIG_[^ ]*\) is not.*/\1=n/;
s/# range \(CONFIG_[^ ]*\) \([^ ][^ ]*\) \([^ ][^ ]*\)/MIN_\1=\2; MAX_\1=\3/;
s/# list \(CONFIG_[^ ]*\) \([^ ][^ ]*\)/LIST_\1=\2/
' <$FORCE_DEFAULT >.default_val.$$
. .default_val.$$
rm .default_val.$$
else
echo "#" echo "#"
echo "# No defaults found" echo "# No defaults found"
echo "#" echo "#"
fi
fi fi
. $CONFIG_IN . $CONFIG_IN
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
# The following temporary rule will make sure that people's # The following temporary rule will make sure that people's
# trees get updated to the right permissions, since patch(1) # trees get updated to the right permissions, since patch(1)
# can't do it # can't do it
CHMOD_FILES := docgen gen-all-syms kernel-doc mkcompile_h mkversion_h makelst CHMOD_FILES := docgen gen-all-syms kernel-doc mkcompile_h makelst
all: fixdep split-include $(CHMOD_FILES) all: fixdep split-include $(CHMOD_FILES)
......
...@@ -214,7 +214,7 @@ void use_config(char *m, int slen) ...@@ -214,7 +214,7 @@ void use_config(char *m, int slen)
if (*p == '_') if (*p == '_')
*p = '/'; *p = '/';
else else
*p = tolower(*p); *p = tolower((unsigned char)*p);
} }
printf(" $(wildcard %s/include/config/%s.h) \\\n", topdir, s); printf(" $(wildcard %s/include/config/%s.h) \\\n", topdir, s);
} }
......
...@@ -10,24 +10,32 @@ else ...@@ -10,24 +10,32 @@ else
echo 0 > ../.version echo 0 > ../.version
fi fi
UTS_VERSION="#$VERSION"
if [ -n "$SMP" ] ; then UTS_VERSION="$UTS_VERSION SMP"; fi
UTS_VERSION="$UTS_VERSION `LANG=C date`"
# Truncate to maximum length
UTS_LEN=64
UTS_TRUNCATE="sed -e s/\(.\{1,$UTS_LEN\}\).*/\1/"
# Generate a temporary compile.h # Generate a temporary compile.h
( echo /\* This file is auto generated, version $VERSION \*/ ( echo /\* This file is auto generated, version $VERSION \*/
echo \#define UTS_MACHINE \"$ARCH\" echo \#define UTS_MACHINE \"$ARCH\"
echo -n \#define UTS_VERSION \"\#$VERSION echo \#define UTS_VERSION \"`echo $UTS_VERSION | $UTS_TRUNCATE`\"
if [ -n "$SMP" ] ; then echo -n " SMP"; fi
echo ' '`date`'"'
echo \#define LINUX_COMPILE_TIME \"`date +%T`\" echo \#define LINUX_COMPILE_TIME \"`LANG=C date +%T`\"
echo \#define LINUX_COMPILE_BY \"`whoami`\" echo \#define LINUX_COMPILE_BY \"`whoami`\"
echo \#define LINUX_COMPILE_HOST \"`hostname`\" echo \#define LINUX_COMPILE_HOST \"`hostname | $UTS_TRUNCATE`\"
if [ -x /bin/dnsdomainname ]; then if [ -x /bin/dnsdomainname ]; then
echo \#define LINUX_COMPILE_DOMAIN \"`dnsdomainname`\" echo \#define LINUX_COMPILE_DOMAIN \"`dnsdomainname | $UTS_TRUNCATE`\"
elif [ -x /bin/domainname ]; then elif [ -x /bin/domainname ]; then
echo \#define LINUX_COMPILE_DOMAIN \"`domainname`\" echo \#define LINUX_COMPILE_DOMAIN \"`domainname | $UTS_TRUNCATE`\"
else else
echo \#define LINUX_COMPILE_DOMAIN echo \#define LINUX_COMPILE_DOMAIN
fi fi
...@@ -48,10 +56,10 @@ if [ -r $TARGET ] && \ ...@@ -48,10 +56,10 @@ if [ -r $TARGET ] && \
grep -v 'UTS_VERSION\|LINUX_COMPILE_TIME' $TARGET > .tmpver.1 && \ grep -v 'UTS_VERSION\|LINUX_COMPILE_TIME' $TARGET > .tmpver.1 && \
grep -v 'UTS_VERSION\|LINUX_COMPILE_TIME' .tmpcompile > .tmpver.2 && \ grep -v 'UTS_VERSION\|LINUX_COMPILE_TIME' .tmpcompile > .tmpver.2 && \
cmp -s .tmpver.1 .tmpver.2; then cmp -s .tmpver.1 .tmpver.2; then
echo $TARGET was not updated; echo ' (unchanged)'
rm -f .tmpcompile rm -f .tmpcompile
else else
echo $TARGET was updated echo ' (updated)'
mv -f .tmpcompile $TARGET mv -f .tmpcompile $TARGET
fi fi
rm -f .tmpver.1 .tmpver.2 rm -f .tmpver.1 .tmpver.2
TARGET=$1
KERNELRELEASE=$2
VERSION=$3
PATCHLEVEL=$4
SUBLEVEL=$5
# Generate a temporary version.h
( echo \#define UTS_RELEASE \"$KERNELRELEASE\"
echo \#define LINUX_VERSION_CODE `expr $VERSION \\* 65536 + $PATCHLEVEL \\* 256 + $SUBLEVEL`
echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))'
) > .tmpversion
# Only replace the real version.h if the new one is different
# in order to preserve the timestamp and avoid unnecessary
# recompilations.
if [ -r $TARGET ] && \
cmp -s $TARGET .tmpversion; then
echo $TARGET was not updated;
rm -f .tmpversion
else
echo $TARGET was updated;
mv -f .tmpversion $TARGET
fi
...@@ -74,12 +74,12 @@ static void syntax_error( const char * msg ) ...@@ -74,12 +74,12 @@ static void syntax_error( const char * msg )
/* /*
* Find index of a specyfic variable in the symbol table. * Find index of a specific variable in the symbol table.
* Create a new entry if it does not exist yet. * Create a new entry if it does not exist yet.
*/ */
#define VARTABLE_SIZE 4096 struct variable *vartable;
struct variable vartable[VARTABLE_SIZE];
int max_varnum = 0; int max_varnum = 0;
static int vartable_size = 0;
int get_varnum( char * name ) int get_varnum( char * name )
{ {
...@@ -88,8 +88,13 @@ int get_varnum( char * name ) ...@@ -88,8 +88,13 @@ int get_varnum( char * name )
for ( i = 1; i <= max_varnum; i++ ) for ( i = 1; i <= max_varnum; i++ )
if ( strcmp( vartable[i].name, name ) == 0 ) if ( strcmp( vartable[i].name, name ) == 0 )
return i; return i;
if (max_varnum > VARTABLE_SIZE-1) while (max_varnum+1 >= vartable_size) {
syntax_error( "Too many variables defined." ); vartable = realloc(vartable, (vartable_size += 1000)*sizeof(*vartable));
if (!vartable) {
fprintf(stderr, "tkparse realloc vartable failed\n");
exit(1);
}
}
vartable[++max_varnum].name = malloc( strlen( name )+1 ); vartable[++max_varnum].name = malloc( strlen( name )+1 );
strcpy( vartable[max_varnum].name, name ); strcpy( vartable[max_varnum].name, name );
return max_varnum; return max_varnum;
...@@ -818,5 +823,6 @@ int main( int argc, const char * argv [] ) ...@@ -818,5 +823,6 @@ int main( int argc, const char * argv [] )
do_source ( "-" ); do_source ( "-" );
fix_conditionals ( config_list ); fix_conditionals ( config_list );
dump_tk_script ( config_list ); dump_tk_script ( config_list );
free(vartable);
return 0; return 0;
} }
...@@ -115,7 +115,7 @@ struct variable ...@@ -115,7 +115,7 @@ struct variable
char global_written; char global_written;
}; };
extern struct variable vartable[]; extern struct variable *vartable;
extern int max_varnum; extern int max_varnum;
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment