Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


Merge branch 'devel' of ssh://palacios@newskysaw.cs.northwestern.edu/home/palacios...
[palacios.git] / scripts / mkcompile_h
1 TARGET=$1
2 ARCH=$2
3 CC=$3
4
5 # If compile.h exists already and we don't own autoconf.h
6 # (i.e. we're not the same user who did make *config), don't
7 # modify compile.h
8 # So "sudo make install" won't change the "compiled by <user>"
9 # do "compiled by root"
10
11 if [ -r $TARGET -a ! -O palacios/include/autoconf.h ]; then
12   echo "  SKIPPED $TARGET"
13   exit 0
14 fi
15
16 # Do not expand names
17 set -f
18
19 if [ -r .version ]; then
20   VERSION=`cat .version`
21 else
22   VERSION=0
23   echo 0 > .version
24 fi
25
26
27 UTS_VERSION="#$VERSION"
28 CONFIG_FLAGS=""
29 #if [ -n "$SMP" ] ; then CONFIG_FLAGS="SMP"; fi
30 #if [ -n "$PREEMPT" ] ; then CONFIG_FLAGS="$CONFIG_FLAGS PREEMPT"; fi
31 UTS_VERSION="$UTS_VERSION $CONFIG_FLAGS `LC_ALL=C LANG=C date`"
32
33 # Truncate to maximum length
34
35 UTS_LEN=64
36 UTS_TRUNCATE="sed -e s/\(.\{1,$UTS_LEN\}\).*/\1/"
37
38 # Generate a temporary compile.h
39
40 ( echo /\* This file is auto generated, version $VERSION \*/
41   if [ -n "$CONFIG_FLAGS" ] ; then echo "/* $CONFIG_FLAGS */"; fi
42   
43   echo \#define UTS_MACHINE \"$ARCH\"
44
45   echo \#define UTS_VERSION \"`echo $UTS_VERSION | $UTS_TRUNCATE`\"
46
47   echo \#define LWK_COMPILE_TIME \"`LC_ALL=C LANG=C date +%T`\"
48   echo \#define LWK_COMPILE_BY \"`whoami`\"
49   echo \#define LWK_COMPILE_HOST \"`hostname | $UTS_TRUNCATE`\"
50
51   if [ -x /bin/dnsdomainname ]; then
52     echo \#define LWK_COMPILE_DOMAIN \"`dnsdomainname | $UTS_TRUNCATE`\"
53   elif [ -x /bin/domainname ]; then
54     echo \#define LWK_COMPILE_DOMAIN \"`domainname | $UTS_TRUNCATE`\"
55   else
56     echo \#define LWK_COMPILE_DOMAIN
57   fi
58
59   echo \#define LWK_COMPILER \"`$CC -v 2>&1 | tail -n 1`\"
60 ) > .tmpcompile
61
62 # Only replace the real compile.h if the new one is different,
63 # in order to preserve the timestamp and avoid unnecessary
64 # recompilations.
65 # We don't consider the file changed if only the date/time changed.
66 # A kernel config change will increase the generation number, thus
67 # causing compile.h to be updated (including date/time) due to the 
68 # changed comment in the
69 # first line.
70
71 if [ -r $TARGET ] && \
72       grep -v 'UTS_VERSION\|LWK_COMPILE_TIME' $TARGET > .tmpver.1 && \
73       grep -v 'UTS_VERSION\|LWK_COMPILE_TIME' .tmpcompile > .tmpver.2 && \
74       cmp -s .tmpver.1 .tmpver.2; then
75    rm -f .tmpcompile
76 else
77    echo "  UPD     $TARGET"
78    mv -f .tmpcompile $TARGET
79 fi
80 rm -f .tmpver.1 .tmpver.2