* configure.ac: Define detailed version numbers.
authorMichael Starzinger <michi@complang.tuwien.ac.at>
Wed, 21 Oct 2009 12:06:31 +0000 (14:06 +0200)
committerMichael Starzinger <michi@complang.tuwien.ac.at>
Wed, 21 Oct 2009 12:06:31 +0000 (14:06 +0200)
* m4/version.m4: New file to define all kinds of version macros.

configure.ac
m4/version.m4 [new file with mode: 0644]

index 401f671fc1d02073ba2a914e4044b961d1a924b3..79441f89d03fcec1e91a15d26e86e8eda03a8aa8 100644 (file)
@@ -648,14 +648,9 @@ AZ_PYTHON_VERSION_ENSURE( [2.4] )
 AZ_PYTHON_CSPEC
 AZ_PYTHON_LSPEC
 
-
-dnl define some stuff required for --fullversion
-AC_DEFINE_UNQUOTED(VERSION_CONFIGURE_ARGS, "$ac_configure_args", [configure arguments])
-AC_DEFINE_UNQUOTED(VERSION_CC, "$CC", [CC used])
-AC_DEFINE_UNQUOTED(VERSION_CXX, "$CXX", [CXX used])
-AC_DEFINE_UNQUOTED(VERSION_CFLAGS, "$OPT_CFLAGS $ARCH_CFLAGS $CC_FLAGS $CPPFLAGS", [CFLAGS used])
-AC_DEFINE_UNQUOTED(VERSION_CXXFLAGS, "$OPT_CXXFLAGS $ARCH_CXXFLAGS $CXX_FLAGS $CPPFLAGS", [CXXFLAGS used])
-
+dnl Define version numbers.
+AC_VERSION_DETAIL
+AC_VERSION_CONFIG
 
 dnl Finally pass flags to Makefiles.
 CFLAGS="$OPT_CFLAGS"
diff --git a/m4/version.m4 b/m4/version.m4
new file mode 100644 (file)
index 0000000..ba7c0e4
--- /dev/null
@@ -0,0 +1,56 @@
+dnl m4/version.m4
+dnl
+dnl Copyright (C) 2009
+dnl CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
+dnl
+dnl This file is part of CACAO.
+dnl
+dnl This program is free software; you can redistribute it and/or
+dnl modify it under the terms of the GNU General Public License as
+dnl published by the Free Software Foundation; either version 2, or (at
+dnl your option) any later version.
+dnl
+dnl This program is distributed in the hope that it will be useful, but
+dnl WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+dnl General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public License
+dnl along with this program; if not, write to the Free Software
+dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+dnl 02110-1301, USA.
+
+
+dnl define detailed version numbers
+
+AC_DEFUN([AC_VERSION_DETAIL],[
+version="$PACKAGE_VERSION"
+if test x`echo "$version" | $SED -e 's/[[0-9a-z+]]*//g'` = "x..";
+then
+    major=`echo "$version" | $SED -e 's/\.[[0-9a-z.+]]*$//'`
+    minor=`echo "$version" | $SED -e 's/^[[0-9]]*\.//' -e 's/\.[[0-9a-z.+]]*$//'`
+    micro=`echo "$version" | $SED -e 's/^[[0-9]]*\.[[0-9]]*\.//' -e 's/[[a-z.+]]*$//'`
+    extra=`echo "$version" | $SED -e 's/^[[0-9]]*\.[[0-9]]*\.[[0-9]]*//'`
+else
+    major=`echo "$version" | $SED -e 's/\.[[0-9a-z.+]]*$//'`
+    minor=`echo "$version" | $SED -e 's/^[[0-9]]*\.//' -e 's/[[a-z.+]]*$//'`
+    micro=0
+    extra=`echo "$version" | $SED -e 's/^[[0-9]]*\.[[0-9]]*//'`
+fi
+
+AC_DEFINE_UNQUOTED(VERSION_MAJOR, $major, [major version number])
+AC_DEFINE_UNQUOTED(VERSION_MINOR, $minor, [minor version number])
+AC_DEFINE_UNQUOTED(VERSION_MICRO, $micro, [micro version number])
+AC_DEFINE_UNQUOTED(VERSION_EXTRA, "$extra", [extra version info])
+])
+
+
+dnl define some stuff required for -XX:+PrintConfig
+
+AC_DEFUN([AC_VERSION_CONFIG],[
+AC_DEFINE_UNQUOTED(VERSION_CONFIGURE_ARGS, "$ac_configure_args", [configure arguments])
+AC_DEFINE_UNQUOTED(VERSION_CC, "$CC", [CC used])
+AC_DEFINE_UNQUOTED(VERSION_CXX, "$CXX", [CXX used])
+AC_DEFINE_UNQUOTED(VERSION_CFLAGS, "$OPT_CFLAGS $ARCH_CFLAGS $CC_FLAGS $CPPFLAGS", [CFLAGS used])
+AC_DEFINE_UNQUOTED(VERSION_CXXFLAGS, "$OPT_CXXFLAGS $ARCH_CXXFLAGS $CXX_FLAGS $CPPFLAGS", [CXXFLAGS used])
+])