summaryrefslogtreecommitdiff
path: root/scripts/mkcompile_h
diff options
context:
space:
mode:
authorKai Germaschewski <kai@tp1.ruhr-uni-bochum.de>2002-05-11 05:28:43 -0500
committerKai Germaschewski <kai@tp1.ruhr-uni-bochum.de>2002-05-11 05:28:43 -0500
commit29f3df7eba8ddf91a55183f9967f76fbcc3ab742 (patch)
treebda308af00f06aad49d6de8804c4ef5c4aa973d8 /scripts/mkcompile_h
parent2c55f43015c706f084ee0ecd038fecc66a0562bd (diff)
Add scripts to generate include/linux/{version,compile}.h
Also, put the #define UTS_MACHINE ... from the command line into the header as well.
Diffstat (limited to 'scripts/mkcompile_h')
-rw-r--r--scripts/mkcompile_h29
1 files changed, 29 insertions, 0 deletions
diff --git a/scripts/mkcompile_h b/scripts/mkcompile_h
new file mode 100644
index 000000000000..df4c4884f980
--- /dev/null
+++ b/scripts/mkcompile_h
@@ -0,0 +1,29 @@
+TARGET=$1
+ARCH=$2
+SMP=$3
+CC=$4
+
+# Generate a temporary compile.h
+
+( echo \#define UTS_MACHINE \"$ARCH\"
+
+ echo -n \#define UTS_VERSION \"\#`cat .version`
+ if [ -n "$SMP" ] ; then echo -n " SMP"; fi
+ echo ' '`date`'"'
+
+ echo \#define LINUX_COMPILE_TIME \"`date +%T`\"
+ echo \#define LINUX_COMPILE_BY \"`whoami`\"
+ echo \#define LINUX_COMPILE_HOST \"`hostname`\"
+
+ if [ -x /bin/dnsdomainname ]; then
+ echo \#define LINUX_COMPILE_DOMAIN \"`dnsdomainname`\"
+ elif [ -x /bin/domainname ]; then
+ echo \#define LINUX_COMPILE_DOMAIN \"`domainname`\"
+ else
+ echo \#define LINUX_COMPILE_DOMAIN
+ fi
+
+ echo \#define LINUX_COMPILER \"`$CC -v 2>&1 | tail -1`\"
+) > .tmpcompile
+
+mv -f .tmpcompile $TARGET