X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=scripts%2Fmkcompile_h;h=a8740df07b09fc1b08c603620bc1ccaaf783199e;hb=27b92bdbd589cf3f59244bf5e848e7be254a2e4c;hp=8d118d1819508cf9a14d252086a89108cb8f4e0d;hpb=1da177e4c3f41524e886b7f1b8a0c1fc7321cac2;p=linux-2.6 diff --git a/scripts/mkcompile_h b/scripts/mkcompile_h index 8d118d1819..a8740df07b 100755 --- a/scripts/mkcompile_h +++ b/scripts/mkcompile_h @@ -1,7 +1,8 @@ TARGET=$1 ARCH=$2 SMP=$3 -CC=$4 +PREEMPT=$4 +CC=$5 # If compile.h exists already and we don't own autoconf.h # (i.e. we're not the same user who did make *config), don't @@ -17,17 +18,32 @@ fi # Do not expand names set -f -if [ -r .version ]; then - VERSION=`cat .version` +# Fix the language to get consistent output +LC_ALL=C +export LC_ALL + +if [ -z "$KBUILD_BUILD_VERSION" ]; then + if [ -r .version ]; then + VERSION=`cat .version` + else + VERSION=0 + echo 0 > .version + fi else - VERSION=0 - echo 0 > .version + VERSION=$KBUILD_BUILD_VERSION fi +if [ -z "$KBUILD_BUILD_TIMESTAMP" ]; then + TIMESTAMP=`date` +else + TIMESTAMP=$KBUILD_BUILD_TIMESTAMP +fi UTS_VERSION="#$VERSION" -if [ -n "$SMP" ] ; then UTS_VERSION="$UTS_VERSION SMP"; fi -UTS_VERSION="$UTS_VERSION `LC_ALL=C LANG=C date`" +CONFIG_FLAGS="" +if [ -n "$SMP" ] ; then CONFIG_FLAGS="SMP"; fi +if [ -n "$PREEMPT" ] ; then CONFIG_FLAGS="$CONFIG_FLAGS PREEMPT"; fi +UTS_VERSION="$UTS_VERSION $CONFIG_FLAGS $TIMESTAMP" # Truncate to maximum length @@ -37,12 +53,13 @@ UTS_TRUNCATE="sed -e s/\(.\{1,$UTS_LEN\}\).*/\1/" # Generate a temporary compile.h ( echo /\* This file is auto generated, version $VERSION \*/ - + if [ -n "$CONFIG_FLAGS" ] ; then echo "/* $CONFIG_FLAGS */"; fi + echo \#define UTS_MACHINE \"$ARCH\" echo \#define UTS_VERSION \"`echo $UTS_VERSION | $UTS_TRUNCATE`\" - echo \#define LINUX_COMPILE_TIME \"`LC_ALL=C LANG=C date +%T`\" + echo \#define LINUX_COMPILE_TIME \"`date +%T`\" echo \#define LINUX_COMPILE_BY \"`whoami`\" echo \#define LINUX_COMPILE_HOST \"`hostname | $UTS_TRUNCATE`\"