[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH v2 2/8] xen: introduce XEN_COMPILE_POSIX_TIME



We need the POSIX time to properly fill the TimeDateStamp field in the PE 
header.

Additionally, realign the variables assignment in xen/Makefile to increase 
readability.

Signed-off-by: Daniel Kiper <daniel.kiper@xxxxxxxxxx>
---
v2 - suggestions/fixes:
   - derive XEN_COMPILE_POSIX_TIME from XEN_BUILD_DATE
     (suggested by Jan Beulich),
   - echo 0 if date command does not work
     (suggested by Konrad Rzeszutek Wilk),
   - improve commit message
     (suggested by Konrad Rzeszutek Wilk).
---
 xen/Makefile                 |   14 ++++++++------
 xen/include/xen/compile.h.in |    1 +
 2 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/xen/Makefile b/xen/Makefile
index aa82641..1bed339 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -6,12 +6,13 @@ export XEN_EXTRAVERSION ?= -rc$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 
-export XEN_WHOAMI      ?= $(USER)
-export XEN_DOMAIN      ?= $(shell ([ -x /bin/dnsdomainname ] && 
/bin/dnsdomainname) || ([ -x /bin/domainname ] && /bin/domainname || echo 
[unknown]))
-export XEN_BUILD_DATE  ?= $(shell LC_ALL=C date)
-export XEN_BUILD_TIME  ?= $(shell LC_ALL=C date -d '$(XEN_BUILD_DATE)' +%T)
-export XEN_BUILD_HOST  ?= $(shell hostname)
-export XEN_CONFIG_EXPERT ?= n
+export XEN_WHOAMI              ?= $(USER)
+export XEN_DOMAIN              ?= $(shell ([ -x /bin/dnsdomainname ] && 
/bin/dnsdomainname) || ([ -x /bin/domainname ] && /bin/domainname || echo 
[unknown]))
+export XEN_BUILD_DATE          ?= $(shell LC_ALL=C date)
+export XEN_BUILD_TIME          ?= $(shell LC_ALL=C date -d '$(XEN_BUILD_DATE)' 
+%T)
+export XEN_BUILD_POSIX_TIME    ?= $(shell LC_ALL=C date -d '$(XEN_BUILD_DATE)' 
+%s || echo 0)
+export XEN_BUILD_HOST          ?= $(shell hostname)
+export XEN_CONFIG_EXPERT       ?= n
 
 export BASEDIR := $(CURDIR)
 export XEN_ROOT := $(BASEDIR)/..
@@ -164,6 +165,7 @@ delete-unfresh-files:
 include/xen/compile.h: include/xen/compile.h.in .banner
        @sed -e 's/@@date@@/$(XEN_BUILD_DATE)/g' \
            -e 's/@@time@@/$(XEN_BUILD_TIME)/g' \
+           -e 's/@@posix_time@@/$(XEN_BUILD_POSIX_TIME)/g' \
            -e 's/@@whoami@@/$(XEN_WHOAMI)/g' \
            -e 's/@@domain@@/$(XEN_DOMAIN)/g' \
            -e 's/@@hostname@@/$(XEN_BUILD_HOST)/g' \
diff --git a/xen/include/xen/compile.h.in b/xen/include/xen/compile.h.in
index 440ecb2..b2ae6f9 100644
--- a/xen/include/xen/compile.h.in
+++ b/xen/include/xen/compile.h.in
@@ -1,5 +1,6 @@
 #define XEN_COMPILE_DATE       "@@date@@"
 #define XEN_COMPILE_TIME       "@@time@@"
+#define XEN_COMPILE_POSIX_TIME @@posix_time@@
 #define XEN_COMPILE_BY         "@@whoami@@"
 #define XEN_COMPILE_DOMAIN     "@@domain@@"
 #define XEN_COMPILE_HOST       "@@hostname@@"
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.