changeset 12350:2ea8aa487297

version-etc: work also with AM_INIT_AUTOMAKE's no-define option * lib/version-etc.c [!defined PACKAGE]: Define to PACKAGE_TARNAME.
author Andy Wingo <wingo@pobox.com>
date Sun, 22 Nov 2009 09:47:12 +0100
parents cf64c2030590
children 0b80ccdc9aa4
files ChangeLog lib/version-etc.c
diffstat 2 files changed, 11 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-11-22  Andy Wingo  <wingo@pobox.com>
+
+	version-etc: work also with AM_INIT_AUTOMAKE's no-define option
+	* lib/version-etc.c [!defined PACKAGE]: Define to PACKAGE_TARNAME.
+
 2009-11-24  Bruno Haible  <bruno@clisp.org>
 
 	doc: Most *_l functions exist in MacOS X 10.5.
--- a/lib/version-etc.c
+++ b/lib/version-etc.c
@@ -32,6 +32,12 @@
 #include "gettext.h"
 #define _(msgid) gettext (msgid)
 
+/* If you use AM_INIT_AUTOMAKE's no-define option,
+   PACKAGE is not defined.  Use PACKAGE_TARNAME instead.  */
+#if ! defined PACKAGE && defined PACKAGE_TARNAME
+# define PACKAGE PACKAGE_TARNAME
+#endif
+
 enum { COPYRIGHT_YEAR = 2009 };
 
 /* The three functions below display the --version information the