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
PERL = perl
MODFLAGS = -DMODULE
CFLAGS_MODULE = $(MODFLAGS)
AFLAGS_MODULE =
AFLAGS_MODULE = $(MODFLAGS)
CFLAGS_KERNEL =
AFLAGS_KERNEL =
EXPORT_FLAGS =
NOSTDINC_FLAGS = -nostdinc -iwithprefix include
export VERSION PATCHLEVEL SUBLEVEL EXTRAVERSION KERNELRELEASE ARCH \
CONFIG_SHELL TOPDIR HPATH HOSTCC HOSTCFLAGS CROSS_COMPILE AS LD CC \
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 AFLAGS AFLAGS_KERNEL AFLAGS_MODULE
noconfig_targets := oldconfig xconfig menuconfig config clean mrproper \
distclean
noconfig_targets := xconfig menuconfig config oldconfig randconfig \
defconfig allyesconfig allnoconfig allmodconfig \
clean mrproper distclean
ifeq ($(filter $(noconfig_targets),$(MAKECMDGOALS)),)
......@@ -175,18 +177,14 @@ ifdef CONFIG_MODULES
EXPORT_FLAGS := -DEXPORT_SYMTAB
endif
INIT =init/init.o
CORE_FILES =kernel/kernel.o mm/mm.o fs/fs.o ipc/ipc.o
NETWORKS =net/network.o
LIBS =$(TOPDIR)/lib/lib.a
SUBDIRS =init kernel lib drivers mm fs net ipc sound
DRIVERS-y = drivers/built-in.o
DRIVERS-$(CONFIG_SOUND) += sound/sound.o
DRIVERS := $(DRIVERS-y)
# Link components for vmlinux
# ---------------------------------------------------------------------------
SUBDIRS := init kernel mm fs ipc lib drivers sound net
INIT := init/init.o
CORE_FILES := kernel/kernel.o mm/mm.o fs/fs.o ipc/ipc.o
LIBS := lib/lib.a
DRIVERS := drivers/built-in.o sound/sound.o
NETWORKS := net/network.o
include arch/$(ARCH)/Makefile
......@@ -300,8 +298,19 @@ include/linux/autoconf.h: .config
# version.h changes when $(KERNELRELEASE) etc change, as defined in
# this Makefile
uts_len := 64
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/
# ---------------------------------------------------------------------------
......@@ -339,6 +348,7 @@ ifdef CONFIG_MODVERSIONS
include/linux/modversions.h: scripts/fixdep prepare FORCE
@rm -rf .tmp_export-objs
@$(MAKE) $(patsubst %,_sfdep_%,$(SUBDIRS))
@echo -n 'Generating $@'
@( echo "#ifndef _LINUX_MODVERSIONS_H";\
echo "#define _LINUX_MODVERSIONS_H"; \
echo "#include <linux/modsetver.h>"; \
......@@ -346,15 +356,8 @@ include/linux/modversions.h: scripts/fixdep prepare FORCE
echo "#include <linux/$${f}>"; \
done; \
echo "#endif"; \
) > $@.tmp
@rm -rf .tmp_export-objs
@if [ -r $@ ] && cmp -s $@ $@.tmp; then \
echo $@ was not updated; \
rm -f $@.tmp; \
else \
echo $@ was updated; \
mv -f $@.tmp $@; \
fi
) > $@.tmp; \
$(update-if-changed)
$(patsubst %,_sfdep_%,$(SUBDIRS)): FORCE
@$(MAKE) -C $(patsubst _sfdep_%, %, $@) fastdep
......@@ -519,9 +522,6 @@ else # ifeq ($(filter $(noconfig_targets),$(MAKECMDGOALS)),)
.PHONY: oldconfig xconfig menuconfig config \
make_with_config
oldconfig:
$(CONFIG_SHELL) scripts/Configure -d arch/$(ARCH)/config.in
xconfig:
@$(MAKE) -C scripts kconfig.tk
wish -f scripts/kconfig.tk
......@@ -533,6 +533,24 @@ menuconfig:
config:
$(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
# user chose when calling make
......@@ -576,10 +594,6 @@ CLEAN_FILES += \
net/khttpd/times.h \
submenu*
# directories removed with 'make clean'
CLEAN_DIRS += \
modules
# files removed with 'make mrproper'
MRPROPER_FILES += \
include/linux/autoconf.h include/linux/version.h \
......@@ -617,7 +631,6 @@ clean: archclean
-name .\*.tmp -o -name .\*.d \) -type f -print \
| grep -v lxdialog/ | xargs rm -f
@rm -f $(CLEAN_FILES)
@rm -rf $(CLEAN_DIRS)
@$(MAKE) -C Documentation/DocBook clean
mrproper: clean archmrproper
......@@ -660,5 +673,15 @@ if_changed_rule = $(if $(strip $? \
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:
......@@ -121,7 +121,7 @@ $(export-objs:.o=.i) : export_flags := $(EXPORT_FLAGS)
$(export-objs:.o=.s) : 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)/$@
cmd_cc_s_c = $(CC) $(c_flags) -S -o $@ $<
......@@ -159,7 +159,7 @@ $(real-objs-y:.o=.s): modkern_aflags := $(AFLAGS_KERNEL)
$(real-objs-m) : 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)/$@
cmd_as_s_S = $(CPP) $(a_flags) -o $@ $<
......
......@@ -4,10 +4,6 @@
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 \
ioctl.o ipc.o socksys.o timod.o
......
......@@ -896,7 +896,8 @@ foreach $label (@label) {
open (OUTPUT, ">$output") || die "$0 : can't open $output 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";
$instructions = 0;
for ($i = 0; $i < $#code; ) {
......
......@@ -22,4 +22,5 @@ $(TOPDIR)/include/linux/compile.h: ../include/linux/compile.h ;
# actual file if its content has changed.
../include/linux/compile.h: FORCE
@echo -n 'Generating $@'
@../scripts/mkcompile_h $@ "$(ARCH)" "$(CONFIG_SMP)" "$(CC) $(CFLAGS)"
......@@ -48,6 +48,10 @@
#
# 24 January 1999, Michael Elizabeth Chastain, <mec@shout.net>
# - 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.
......@@ -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
#
......@@ -109,7 +150,11 @@ ${var}:\\
# readln prompt default oldval
#
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"
ans=$2
else
......@@ -169,6 +214,17 @@ function define_tristate () {
function bool () {
old=$(eval echo "\${$2}")
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
"y" | "m") defprompt="Y/n/?"
def="y"
......@@ -200,6 +256,18 @@ function tristate () {
else
old=$(eval echo "\${$2}")
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
"y") defprompt="Y/m/n/?"
;;
......@@ -256,6 +324,17 @@ function dep_tristate () {
if [ $need_module = 1 ]; 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
"y" | "m") defprompt="M/n/?"
def="m"
......@@ -351,6 +430,7 @@ function int () {
else
max=10000000 # !!
fi
rndval $2
while :; do
readln "$1 ($2) [$def] " "$def" "$old"
if expr \( \( $ans + 0 \) \>= $min \) \& \( $ans \<= $max \) >/dev/null 2>&1 ; then
......@@ -382,6 +462,7 @@ function hex () {
old=$(eval echo "\${$2}")
def=${old:-$3}
def=${def#*[x,X]}
rndval $2
while :; do
readln "$1 ($2) [$def] " "$def" "$old"
ans=${ans#*[x,X]}
......@@ -464,6 +545,15 @@ function choice () {
shift; shift
done
if [ "$RND" = "-r" -a -z "$old" ] ; then
set -- $choices
rnd $#
while [ $rnd -le $# ] ; do
def=$1
shift ; shift
done
fi
val=""
while [ -z "$val" ]; do
ambg=n
......@@ -512,6 +602,7 @@ function choice () {
CONFIG=.tmpconfig
CONFIG_H=.tmpconfig.h
FORCE_DEFAULT=.force_default
trap "rm -f $CONFIG $CONFIG_H ; exit 1" 1 2
#
......@@ -532,34 +623,57 @@ if [ "$1" = "-d" ] ; then
shift
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
if [ "$1" != "" ] ; then
CONFIG_IN=$1
fi
DEFAULTS=.config
if [ ! -f .config ]; then
DEFAULTS=/etc/kernel-config
if [ ! -f $DEFAULTS ]; then
DEFAULTS=/boot/config-`uname -r`
if [ ! -f $DEFAULTS ]; then
DEFAULTS=arch/$ARCH/defconfig
fi
for DEFAULTS in .config /lib/modules/`uname -r`/.config /etc/kernel-config /boot/config-`uname -r` arch/$ARCH/defconfig
do
[ -r $DEFAULTS ] && break
done
if [ "$AUTO" != "yes" ]; then
if [ -f $DEFAULTS ]; then
echo "#"
echo "# Using defaults found in" $DEFAULTS
echo "#"
. $DEFAULTS
sed -e 's/# \(CONFIG_[^ ]*\) is not.*/\1=n/' <$DEFAULTS >.config-is-not.$$
. .config-is-not.$$
rm .config-is-not.$$
else
echo "#"
echo "# No defaults found"
echo "#"
fi
fi
if [ -f $DEFAULTS ]; then
echo "#"
echo "# Using defaults found in" $DEFAULTS
echo "#"
. $DEFAULTS
sed -e 's/# \(CONFIG_[^ ]*\) is not.*/\1=n/' <$DEFAULTS >.config-is-not.$$
. .config-is-not.$$
rm .config-is-not.$$
else
echo "#"
echo "# No defaults found"
echo "#"
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 "# No defaults found"
echo "#"
fi
fi
. $CONFIG_IN
......
......@@ -5,7 +5,7 @@
# The following temporary rule will make sure that people's
# trees get updated to the right permissions, since patch(1)
# 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)
......
......@@ -214,7 +214,7 @@ void use_config(char *m, int slen)
if (*p == '_')
*p = '/';
else
*p = tolower(*p);
*p = tolower((unsigned char)*p);
}
printf(" $(wildcard %s/include/config/%s.h) \\\n", topdir, s);
}
......
......@@ -10,24 +10,32 @@ else
echo 0 > ../.version
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
( echo /\* This file is auto generated, version $VERSION \*/
echo \#define UTS_MACHINE \"$ARCH\"
echo -n \#define UTS_VERSION \"\#$VERSION
if [ -n "$SMP" ] ; then echo -n " SMP"; fi
echo ' '`date`'"'
echo \#define UTS_VERSION \"`echo $UTS_VERSION | $UTS_TRUNCATE`\"
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_HOST \"`hostname`\"
echo \#define LINUX_COMPILE_HOST \"`hostname | $UTS_TRUNCATE`\"
if [ -x /bin/dnsdomainname ]; then
echo \#define LINUX_COMPILE_DOMAIN \"`dnsdomainname`\"
echo \#define LINUX_COMPILE_DOMAIN \"`dnsdomainname | $UTS_TRUNCATE`\"
elif [ -x /bin/domainname ]; then
echo \#define LINUX_COMPILE_DOMAIN \"`domainname`\"
echo \#define LINUX_COMPILE_DOMAIN \"`domainname | $UTS_TRUNCATE`\"
else
echo \#define LINUX_COMPILE_DOMAIN
fi
......@@ -48,10 +56,10 @@ if [ -r $TARGET ] && \
grep -v 'UTS_VERSION\|LINUX_COMPILE_TIME' $TARGET > .tmpver.1 && \
grep -v 'UTS_VERSION\|LINUX_COMPILE_TIME' .tmpcompile > .tmpver.2 && \
cmp -s .tmpver.1 .tmpver.2; then
echo $TARGET was not updated;
echo ' (unchanged)'
rm -f .tmpcompile
else
echo $TARGET was updated
echo ' (updated)'
mv -f .tmpcompile $TARGET
fi
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 )
/*
* 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.
*/
#define VARTABLE_SIZE 4096
struct variable vartable[VARTABLE_SIZE];
struct variable *vartable;
int max_varnum = 0;
static int vartable_size = 0;
int get_varnum( char * name )
{
......@@ -88,8 +88,13 @@ int get_varnum( char * name )
for ( i = 1; i <= max_varnum; i++ )
if ( strcmp( vartable[i].name, name ) == 0 )
return i;
if (max_varnum > VARTABLE_SIZE-1)
syntax_error( "Too many variables defined." );
while (max_varnum+1 >= vartable_size) {
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 );
strcpy( vartable[max_varnum].name, name );
return max_varnum;
......@@ -818,5 +823,6 @@ int main( int argc, const char * argv [] )
do_source ( "-" );
fix_conditionals ( config_list );
dump_tk_script ( config_list );
free(vartable);
return 0;
}
......@@ -115,7 +115,7 @@ struct variable
char global_written;
};
extern struct variable vartable[];
extern struct variable *vartable;
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