Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/external/bsd/ntp For MKREPRO, instead of using __DATE__ and ...
details: https://anonhg.NetBSD.org/src/rev/cc9b74e23a42
branches: trunk
changeset: 325995:cc9b74e23a42
user: apb <apb%NetBSD.org@localhost>
date: Wed Jan 15 14:40:30 2014 +0000
description:
For MKREPRO, instead of using __DATE__ and __TIME__
in ntp_calendar.c::ntpcal_get_build_date(), use a date/time
extracted from the importdate file.
diffstat:
external/bsd/ntp/dist/libntp/ntp_calendar.c | 6 +++++-
external/bsd/ntp/lib/libntp/Makefile | 18 +++++++++++++++++-
2 files changed, 22 insertions(+), 2 deletions(-)
diffs (51 lines):
diff -r 50848ea04500 -r cc9b74e23a42 external/bsd/ntp/dist/libntp/ntp_calendar.c
--- a/external/bsd/ntp/dist/libntp/ntp_calendar.c Wed Jan 15 14:27:49 2014 +0000
+++ b/external/bsd/ntp/dist/libntp/ntp_calendar.c Wed Jan 15 14:40:30 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ntp_calendar.c,v 1.2 2013/12/28 03:20:13 christos Exp $ */
+/* $NetBSD: ntp_calendar.c,v 1.3 2014/01/15 14:40:30 apb Exp $ */
/*
* ntp_calendar.c - calendar and helper functions
@@ -155,7 +155,11 @@
* problem.
*
*/
+#ifdef MKREPRO_DATE
+ static const char build[] = MKREPRO_TIME "/" MKREPRO_DATE;
+#else
static const char build[] = __TIME__ "/" __DATE__;
+#endif
static const char mlist[] = "JanFebMarAprMayJunJulAugSepOctNovDec";
char monstr[4];
const char * cp;
diff -r 50848ea04500 -r cc9b74e23a42 external/bsd/ntp/lib/libntp/Makefile
--- a/external/bsd/ntp/lib/libntp/Makefile Wed Jan 15 14:27:49 2014 +0000
+++ b/external/bsd/ntp/lib/libntp/Makefile Wed Jan 15 14:40:30 2014 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.7 2014/01/02 21:38:38 joerg Exp $
+# $NetBSD: Makefile,v 1.8 2014/01/15 14:40:30 apb Exp $
LIBISPRIVATE=yes
@@ -79,4 +79,20 @@
COPTS.msyslog.c+= -Wno-error=format-nonliteral
+# For MKREPRO, avoid using __DATE__ and __TIME__.
+# Instead, use the date and time from ${IMPORTDATE_FILE}.
+#
+# The file should contain one line, like this:
+# Fri Dec 27 19:28:17 EST 2013 (import)
+#
+.if ${MKREPRO} == "yes"
+IMPORTDATE_FILE := ${.PARSEDIR}/../../importdate
+MKREPRO_DATE != ${TOOL_AWK} '{printf "%3s %2d %4d", $2, $3, $6}' \
+ <${IMPORTDATE_FILE} # "Mmm DD YYYY"
+MKREPRO_TIME != ${TOOL_AWK} '{print $4}' \
+ <${IMPORTDATE_FILE} # "HH:MM:SS"
+CPPFLAGS.ntp_calendar.c += -DMKREPRO_DATE=\"${MKREPRO_DATE:Q}\"
+CPPFLAGS.ntp_calendar.c += -DMKREPRO_TIME=\"${MKREPRO_TIME:Q}\"
+.endif
+
.include <bsd.lib.mk>
Home |
Main Index |
Thread Index |
Old Index