diff options
Diffstat (limited to 'scripts/mkcompile_h')
-rwxr-xr-x | scripts/mkcompile_h | 30 |
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 | |||
42 | else | 42 | else |
43 | TIMESTAMP=$KBUILD_BUILD_TIMESTAMP | 43 | TIMESTAMP=$KBUILD_BUILD_TIMESTAMP |
44 | fi | 44 | fi |
45 | if test -z "$KBUILD_BUILD_USER"; then | ||
46 | LINUX_COMPILE_BY=$(whoami | sed 's/\\/\\\\/') | ||
47 | else | ||
48 | LINUX_COMPILE_BY=$KBUILD_BUILD_USER | ||
49 | fi | ||
50 | if test -z "$KBUILD_BUILD_HOST"; then | ||
51 | LINUX_COMPILE_HOST=`hostname` | ||
52 | else | ||
53 | LINUX_COMPILE_HOST=$KBUILD_BUILD_HOST | ||
54 | fi | ||
45 | 55 | ||
46 | UTS_VERSION="#$VERSION" | 56 | UTS_VERSION="#$VERSION" |
47 | CONFIG_FLAGS="" | 57 | CONFIG_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 | ||
93 | if [ -r $TARGET ] && \ | 91 | if [ -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 |
98 | else | 96 | else |