bug-hello
[Top][All Lists]
Advanced

[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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]