Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2004:
[Freeciv-Dev] Re: (PR#4712) Version numbering proposal
Home

[Freeciv-Dev] Re: (PR#4712) Version numbering proposal

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: jdorje@xxxxxxxxxxxxxxxxxxxxx
Cc: jdwheeler42@xxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#4712) Version numbering proposal
From: "Marko Lindqvist" <marko.lindqvist@xxxxxxxxxxx>
Date: Fri, 20 Aug 2004 12:18:03 -0700
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=4712 >


  There is no reason not to use multiple parameters for macro call. Same 
syntax works for both m4 and C and those are only languages we need to 
worry about. This way version.in is a bit cleaner, IMHO.


  - Caz

diff -Nurd freeciv/Makefile.am freeciv/Makefile.am
--- freeciv/Makefile.am 2004-08-18 17:12:02.312500000 +0300
+++ freeciv/Makefile.am 2004-08-20 22:03:01.093750000 +0300
@@ -69,6 +69,7 @@
                m4/sdl-client.m4                \
                m4/sdl.m4                       \
                m4/sound.m4                     \
+               m4/version.m4                   \
                m4/vsnprintf.m4                 \
                m4/win32-client.m4              \
                m4/x.213                        \
@@ -79,3 +80,5 @@
                vms/imlib_config.h_vms          \
                vms/readme.vms                  \
                vms/vms_build.com
+
+noinst_HEADERS= version.in
diff -Nurd freeciv/configure.ac freeciv/configure.ac
--- freeciv/configure.ac        2004-08-18 17:11:33.421875000 +0300
+++ freeciv/configure.ac        2004-08-20 22:03:01.093750000 +0300
@@ -14,13 +14,7 @@
 
 dnl client/server should always have the same major and minor versions
 dnl different patch versions are compatible
-dnl These values must match in configure.*, common/version.h, and data/Freeciv.
-MAJOR_VERSION=1
-MINOR_VERSION=14
-PATCH_VERSION=99
-VERSION_LABEL="-devel"
-IS_DEVEL_VERSION=1
-IS_BETA_VERSION=0
+m4_include(version.in)
 
 VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}${VERSION_LABEL}
 
@@ -614,6 +608,8 @@
   CFLAGS="$EXTRA_GCC_DEBUG_CFLAGS $CFLAGS"
 fi
 
+AC_SUBST([CONFIGURE_DEPENDENCIES], ['$(top_srcdir)/version.in'])
+
 AC_CONFIG_FILES([Makefile
           data/Makefile 
          data/flags/Makefile
diff -Nurd freeciv/configure.in freeciv/configure.in
--- freeciv/configure.in        2004-08-18 17:11:33.437500000 +0300
+++ freeciv/configure.in        2004-08-20 22:03:01.109375000 +0300
@@ -13,13 +13,7 @@
 
 dnl client/server should always have the same major and minor versions
 dnl different patch versions are compatible
-dnl These values must match in configure.*, common/version.h, and data/Freeciv.
-MAJOR_VERSION=1
-MINOR_VERSION=14
-PATCH_VERSION=99
-VERSION_LABEL="-devel"
-IS_DEVEL_VERSION=1
-IS_BETA_VERSION=0
+m4_include(version.in)
 
 VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}${VERSION_LABEL}
 
@@ -609,6 +603,8 @@
   CFLAGS="$EXTRA_GCC_DEBUG_CFLAGS $CFLAGS"
 fi
 
+AC_SUBST([CONFIGURE_DEPENDENCIES], ['$(top_srcdir)/version.in'])
+
 AC_OUTPUT(Makefile
           data/Makefile 
          data/flags/Makefile
diff -Nurd freeciv/m4/version.m4 freeciv/m4/version.m4
--- freeciv/m4/version.m4       1970-01-01 02:00:00.000000000 +0200
+++ freeciv/m4/version.m4       2004-08-20 22:05:02.500000000 +0300
@@ -0,0 +1,19 @@
+#
+# These macros are used in version.in and they just set
+# version information to form understandable for configure.ac and
+# configure.in. Other systems define these macros differently
+# before reading version.in and thus get version information
+# in different form.
+# 
+
+AC_DEFUN([FREECIV_VERSION_COMMENT])
+
+AC_DEFUN([FREECIV_VERSION_INFO],
+[
+ MAJOR_VERSION="$1"
+ MINOR_VERSION="$2"
+ PATCH_VERSION="$3"
+ VERSION_LABEL="$4"
+])
+AC_DEFUN([FREECIV_DEVEL_VERSION], [IS_DEVEL_VERSION="$1"])
+AC_DEFUN([FREECIV_BETA_VERSION], [IS_BETA_VERSION="$1"])
diff -Nurd freeciv/version.in freeciv/version.in
--- freeciv/version.in  1970-01-01 02:00:00.000000000 +0200
+++ freeciv/version.in  2004-08-20 22:06:06.421875000 +0300
@@ -0,0 +1,17 @@
+FREECIV_VERSION_COMMENT("  Copyright (C) 2004 Freeciv team               ")
+
+FREECIV_VERSION_COMMENT("  Programming language independent version      ")
+FREECIV_VERSION_COMMENT("  definition for freeciv. Macros used here      ")
+FREECIV_VERSION_COMMENT("  are defined differently depending on          ")
+FREECIV_VERSION_COMMENT("  language used. Don't add comments             ")
+FREECIV_VERSION_COMMENT("  specific to some language into this file.     ")
+
+FREECIV_VERSION_COMMENT("  For now version information in data/Freeciv   ")
+FREECIV_VERSION_COMMENT("  and common/version.h                          ")
+FREECIV_VERSION_COMMENT("  must be updated manually when ever this file  ")
+FREECIV_VERSION_COMMENT("  changes.                                      ")
+
+FREECIV_VERSION_INFO(1,14,99,"-devel")
+
+FREECIV_DEVEL_VERSION(1)
+FREECIV_BETA_VERSION(0)

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