version-etc: work also with AM_INIT_AUTOMAKE's no-define option
authorAndy Wingo <wingo@pobox.com>
Sun, 22 Nov 2009 08:47:12 +0000 (09:47 +0100)
committerJim Meyering <meyering@redhat.com>
Wed, 25 Nov 2009 09:30:17 +0000 (10:30 +0100)
* lib/version-etc.c [!defined PACKAGE]: Define to PACKAGE_TARNAME.

ChangeLog
lib/version-etc.c

index f6737ff..fcdf307 100644 (file)
--- 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.
index bf67c37..d76aa7c 100644 (file)
 #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