aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/mkcompile_h
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/mkcompile_h')
-rwxr-xr-xscripts/mkcompile_h30
1 files changed, 14 insertions, 16 deletions
diff --git a/scripts/mkcompile_h b/scripts/mkcompile_h
index 50ad317a4bf9..f221ddf69080 100755
--- a/scripts/mkcompile_h
+++ b/scripts/mkcompile_h
@@ -42,6 +42,16 @@ if [ -z "$KBUILD_BUILD_TIMESTAMP" ]; then
42else 42else
43 TIMESTAMP=$KBUILD_BUILD_TIMESTAMP 43 TIMESTAMP=$KBUILD_BUILD_TIMESTAMP
44fi 44fi
45if test -z "$KBUILD_BUILD_USER"; then
46 LINUX_COMPILE_BY=$(whoami | sed 's/\\/\\\\/')
47else
48 LINUX_COMPILE_BY=$KBUILD_BUILD_USER
49fi
50if test -z "$KBUILD_BUILD_HOST"; then
51 LINUX_COMPILE_HOST=`hostname`
52else
53 LINUX_COMPILE_HOST=$KBUILD_BUILD_HOST
54fi
45 55
46UTS_VERSION="#$VERSION" 56UTS_VERSION="#$VERSION"
47CONFIG_FLAGS="" 57CONFIG_FLAGS=""
@@ -63,20 +73,8 @@ UTS_TRUNCATE="cut -b -$UTS_LEN"
63 73
64 echo \#define UTS_VERSION \"`echo $UTS_VERSION | $UTS_TRUNCATE`\" 74 echo \#define UTS_VERSION \"`echo $UTS_VERSION | $UTS_TRUNCATE`\"
65 75
66 echo \#define LINUX_COMPILE_TIME \"`date +%T`\" 76 echo \#define LINUX_COMPILE_BY \"`echo $LINUX_COMPILE_BY | $UTS_TRUNCATE`\"
67 echo \#define LINUX_COMPILE_BY \"`whoami`\" 77 echo \#define LINUX_COMPILE_HOST \"`echo $LINUX_COMPILE_HOST | $UTS_TRUNCATE`\"
68 echo \#define LINUX_COMPILE_HOST \"`hostname | $UTS_TRUNCATE`\"
69
70 domain=`dnsdomainname 2> /dev/null`
71 if [ -z "$domain" ]; then
72 domain=`domainname 2> /dev/null`
73 fi
74
75 if [ -n "$domain" ]; then
76 echo \#define LINUX_COMPILE_DOMAIN \"`echo $domain | $UTS_TRUNCATE`\"
77 else
78 echo \#define LINUX_COMPILE_DOMAIN
79 fi
80 78
81 echo \#define LINUX_COMPILER \"`$CC -v 2>&1 | tail -n 1`\" 79 echo \#define LINUX_COMPILER \"`$CC -v 2>&1 | tail -n 1`\"
82) > .tmpcompile 80) > .tmpcompile
@@ -91,8 +89,8 @@ UTS_TRUNCATE="cut -b -$UTS_LEN"
91# first line. 89# first line.
92 90
93if [ -r $TARGET ] && \ 91if [ -r $TARGET ] && \
94 grep -v 'UTS_VERSION\|LINUX_COMPILE_TIME' $TARGET > .tmpver.1 && \ 92 grep -v 'UTS_VERSION' $TARGET > .tmpver.1 && \
95 grep -v 'UTS_VERSION\|LINUX_COMPILE_TIME' .tmpcompile > .tmpver.2 && \ 93 grep -v 'UTS_VERSION' .tmpcompile > .tmpver.2 && \
96 cmp -s .tmpver.1 .tmpver.2; then 94 cmp -s .tmpver.1 .tmpver.2; then
97 rm -f .tmpcompile 95 rm -f .tmpcompile
98else 96else