From f00b56b34a1d43c6cc3e7489fdde4f284d776420 Mon Sep 17 00:00:00 2001 From: Arun Persaud Date: Sun, 12 Jul 2009 10:53:50 -0700 Subject: [PATCH] fixed autoconf problem with VERSION/PATCHLEVEL variables xboard used it's own version of PRODUCT, VERSION and PATCHLEVEL variables. Switched to PACKAGE_STRING provided by autoconf --- backend.c | 15 ++++++--------- configure.ac | 18 ++---------------- winboard/config.h | 18 ++++++++++++++++-- winboard/winboard.c | 2 +- xboard.c | 6 +++--- 5 files changed, 28 insertions(+), 31 deletions(-) diff --git a/backend.c b/backend.c index 84e4051..1df8adb 100644 --- a/backend.c +++ b/backend.c @@ -821,9 +821,8 @@ InitBackEnd1() #endif if (appData.noChessProgram) { - programVersion = (char*) malloc(5 + strlen(PRODUCT) + strlen(VERSION) - + strlen(PATCHLEVEL)); - sprintf(programVersion, "%s %s.%s", PRODUCT, VERSION, PATCHLEVEL); + programVersion = (char*) malloc(5 + strlen(PACKAGE_STRING)); + sprintf(programVersion, "%s", PACKAGE_STRING); } else { #if 0 char *p, *q; @@ -831,15 +830,13 @@ InitBackEnd1() while (*q != ' ' && *q != NULLCHAR) q++; p = q; while (p > first.program && *(p-1) != '/' && *(p-1) != '\\') p--; /* [HGM] backslash added */ - programVersion = (char*) malloc(8 + strlen(PRODUCT) + strlen(VERSION) - + strlen(PATCHLEVEL) + (q - p)); - sprintf(programVersion, "%s %s.%s + ", PRODUCT, VERSION, PATCHLEVEL); + programVersion = (char*) malloc(8 + strlen(PACKAGE_STRING + (q - p)); + sprintf(programVersion, "%s + ", PACKAGE_STRING); strncat(programVersion, p, q - p); #else /* [HGM] tidy: use tidy name, in stead of full pathname (which was probably a bug due to / vs \ ) */ - programVersion = (char*) malloc(8 + strlen(PRODUCT) + strlen(VERSION) - + strlen(PATCHLEVEL) + strlen(first.tidy)); - sprintf(programVersion, "%s %s.%s + %s", PRODUCT, VERSION, PATCHLEVEL, first.tidy); + programVersion = (char*) malloc(8 + strlen(PACKAGE_STRING) + strlen(first.tidy)); + sprintf(programVersion, "%s + %s", PACKAGE_STRING, first.tidy); #endif } diff --git a/configure.ac b/configure.ac index c7bf530..ece1356 100644 --- a/configure.ac +++ b/configure.ac @@ -27,11 +27,7 @@ dnl| it portable to sites and systems other than your own), and run autoconf dnl| to regenerate configure. Then submit your changes to be folded into dnl| the standard version of xboard. -dnl| need to change these here and in AC_INIT -PRODUCT=xboard -VERSION=4.4 -PATCHLEVEL=0j - +dnl| define second argument as VERSION.PATCHLEVEL. e.g. 4.4.0j AC_INIT([xboard],[4.4.0j],[bug-xboard@gnu.org]) AM_INIT_AUTOMAKE @@ -46,8 +42,6 @@ AH_TEMPLATE([HAVE_RANDOM],[template]) AH_TEMPLATE([HAVE_SYS_SOCKET_H],[template]) AH_TEMPLATE([IBMRTAIX],[template]) AH_TEMPLATE([LAST_PTY_LETTER],[template]) -AH_TEMPLATE([PATCHLEVEL],[template]) -AH_TEMPLATE([PRODUCT],[template]) AH_TEMPLATE([PTY_ITERATION],[template]) AH_TEMPLATE([PTY_NAME_SPRINTF],[template]) AH_TEMPLATE([PTY_OPEN],[template]) @@ -56,7 +50,6 @@ AH_TEMPLATE([REMOTE_SHELL],[template]) AH_TEMPLATE([RTU],[template]) AH_TEMPLATE([UNIPLUS],[template]) AH_TEMPLATE([USE_PTYS],[template]) -AH_TEMPLATE([VERSION],[template]) AH_TEMPLATE([X_WCHAR],[template]) AH_TEMPLATE([ATTENTION],[template]) AH_TEMPLATE([DEFINED_SYS_ERRLIST],[template]) @@ -116,7 +109,7 @@ AC_CHECK_LIB(seq, getpseudotty) AC_PATH_XTRA if test -n "$no_x" ; then - echo $PRODUCT requires the X Window System header files and libraries! + echo $PACKAGE requires the X Window System header files and libraries! echo They were not found on your system. See FAQ topic C.2. echo configure failed exit 1 @@ -408,13 +401,6 @@ AC_ARG_ENABLE(sigint, fi], [AC_DEFINE(ATTENTION, 1)]) -AC_DEFINE_UNQUOTED(PRODUCT, "$PRODUCT") -AC_DEFINE_UNQUOTED(VERSION, "$VERSION") -AC_DEFINE_UNQUOTED(PATCHLEVEL, "$PATCHLEVEL") -AC_SUBST(PRODUCT) -AC_SUBST(VERSION) -AC_SUBST(PATCHLEVEL) - AC_CONFIG_FILES([Makefile cmail]) AC_CONFIG_COMMANDS([test-stamp-h],[test -z "$CONFIG_HEADERS" || date > stamp-h]) AC_CONFIG_COMMANDS([chmod-cmail],[chmod 755 cmail]) diff --git a/winboard/config.h b/winboard/config.h index b1a8f72..eff2f2d 100644 --- a/winboard/config.h +++ b/winboard/config.h @@ -36,9 +36,23 @@ #define LAST_PTY_LETTER 'q' -#define PATCHLEVEL "0j" +/* Name of package */ +#define PACKAGE "WinBoard" -#define PRODUCT "WinBoard" +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "bug-xboard@gnu.org" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "WinBoard" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "WinBoard 4.4.0j" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "winboard" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "4.4.0j" #define PTY_ITERATION diff --git a/winboard/winboard.c b/winboard/winboard.c index 275368e..6bdcf3a 100644 --- a/winboard/winboard.c +++ b/winboard/winboard.c @@ -2295,7 +2295,7 @@ SaveSettings(char* name) return; } fprintf(f, ";\n"); - fprintf(f, "; %s %s.%s Save Settings file\n", PRODUCT, VERSION, PATCHLEVEL); + fprintf(f, "; %s Save Settings file\n", PACKAGE_STRING); fprintf(f, ";\n"); fprintf(f, "; You can edit the values of options that are already set in this file,\n"); fprintf(f, "; but if you add other options, the next Save Settings will not save them.\n"); diff --git a/xboard.c b/xboard.c index 1675b79..6c5666e 100644 --- a/xboard.c +++ b/xboard.c @@ -2386,8 +2386,8 @@ main(argc, argv) #ifdef ENABLE_NLS XtSetLanguageProc(NULL, NULL, NULL); - bindtextdomain(PRODUCT, LOCALEDIR); - textdomain(PRODUCT); + bindtextdomain(PACKAGE, LOCALEDIR); + textdomain(PACKAGE); #endif shellWidget = @@ -7542,7 +7542,7 @@ void AboutProc(w, event, prms, nprms) "Copyright 1991 Digital Equipment Corporation", "Enhancements Copyright 1992-2009 Free Software Foundation", "Enhancements Copyright 2005 Alessandro Scotti", - PRODUCT, " is free software and carries NO WARRANTY;", + PACKAGE, " is free software and carries NO WARRANTY;", "see the file COPYING for more information."); ErrorPopUp(_("About XBoard"), buf, FALSE); } -- 1.7.0.4