[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 7/8] make copyright year pseudo dynamic
From: |
Sami Kerola |
Subject: |
[PATCH 7/8] make copyright year pseudo dynamic |
Date: |
Wed, 9 Oct 2013 20:20:16 +0100 |
configure.ac: Add macro to determine what year is it, and add the value
to config.h.
hello.c: Use copyright year from config.h.
---
configure.ac | 4 ++++
src/hello.c | 4 ++--
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/configure.ac b/configure.ac
index f33d65a..95b316d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -31,6 +31,10 @@ dnl keep everything together.
gl_EARLY
gl_INIT
+dnl Copyright will apply as long as these sources are in use, e.g., are
+dnl being compiled, which is reasoable year to claim the copyright.
+AC_DEFINE([COPYRIGHT_YEAR], [m4_esyscmd([date +%Y])], [year in copyright
message])
+
dnl GNU help2man creates man pages from --help output; in many cases, this
dnl is sufficient, and obviates the need to maintain man pages separately.
dnl However, this means invoking executables, which we generally cannot do
diff --git a/src/hello.c b/src/hello.c
index c4b98ba..8ecdf7b 100644
--- a/src/hello.c
+++ b/src/hello.c
@@ -200,8 +200,8 @@ print_version (void)
as done here, to avoid having to retranslate the message when a new
year comes around. */
printf (_("\
-Copyright (C) %s Free Software Foundation, Inc.\n\
+Copyright (C) %d Free Software Foundation, Inc.\n\
License GPLv3+: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>\n\
This is free software: you are free to change and redistribute it.\n\
-There is NO WARRANTY, to the extent permitted by law.\n"), "2011");
+There is NO WARRANTY, to the extent permitted by law.\n"), COPYRIGHT_YEAR);
}
--
1.8.2.3
- [PATCH 1/8] allow user message to use new-generation greeting format, Sami Kerola, 2013/10/09
- [PATCH 2/8] bootstrap: update from gnulib, Sami Kerola, 2013/10/09
- [PATCH 4/8] clean up configure.ac syntax, Sami Kerola, 2013/10/09
- [PATCH 3/8] reuse AM_INIT_AUTOMAKE bug-email address, Sami Kerola, 2013/10/09
- [PATCH 5/8] use PACKAGE_NAME from config.h, Sami Kerola, 2013/10/09
- [PATCH 6/8] re-indent to match with gnu coding style, Sami Kerola, 2013/10/09
- [PATCH 7/8] make copyright year pseudo dynamic,
Sami Kerola <=
- [PATCH 8/8] make hello unicode aware, Sami Kerola, 2013/10/09