diff mbox

odp version script

Message ID 1418298088-14187-1-git-send-email-maxim.uvarov@linaro.org
State New
Headers show

Commit Message

Maxim Uvarov Dec. 11, 2014, 11:41 a.m. UTC
Update odp version in one place (C code), and use it for doxygen also.

Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
---
 configure.ac           | 2 +-
 doc/doxygen.cfg        | 2 +-
 m4/ax_prog_doxygen.m4  | 4 ++--
 scripts/odp_version.sh | 7 +++++++
 4 files changed, 11 insertions(+), 4 deletions(-)
 create mode 100755 scripts/odp_version.sh
diff mbox

Patch

diff --git a/configure.ac b/configure.ac
index 2f27261..8dbad4b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,5 +1,5 @@ 
 AC_PREREQ([2.5])
-AC_INIT([OpenDataPlane], [0.4.0], [lng-odp@lists.linaro.org])
+AC_INIT([OpenDataPlane], m4_esyscmd(./scripts/odp_version.sh), [lng-odp@lists.linaro.org])
 AM_INIT_AUTOMAKE([subdir-objects])
 AC_CONFIG_SRCDIR([helper/config.h.in])
 AM_CONFIG_HEADER([helper/config.h])
diff --git a/doc/doxygen.cfg b/doc/doxygen.cfg
index 03bcc20..1d1dcb6 100644
--- a/doc/doxygen.cfg
+++ b/doc/doxygen.cfg
@@ -1,5 +1,5 @@ 
 PROJECT_NAME = "API Reference Manual"
-PROJECT_NUMBER = 0.4.0
+PROJECT_NUMBER = $(DOC_VERSION)
 PROJECT_LOGO = $(SRCDIR)/doc/images/ODP-Logo-HQ.png
 QUIET = YES
 OUTPUT_DIRECTORY = $(DOCDIR)
diff --git a/m4/ax_prog_doxygen.m4 b/m4/ax_prog_doxygen.m4
index aa4acc2..f2ed62f 100644
--- a/m4/ax_prog_doxygen.m4
+++ b/m4/ax_prog_doxygen.m4
@@ -1,4 +1,4 @@ 
-# ===========================================================================
+
 #      http://www.gnu.org/software/autoconf-archive/ax_prog_doxygen.html
 # ===========================================================================
 #
@@ -407,7 +407,7 @@  AC_SUBST([DX_DOCDIR], [ifelse([$3], [], doxygen-doc, [$3])])
 DX_ENV_APPEND(SRCDIR, $srcdir)
 DX_ENV_APPEND(PROJECT, $DX_PROJECT)
 DX_ENV_APPEND(DOCDIR, $DX_DOCDIR)
-DX_ENV_APPEND(VERSION, $PACKAGE_VERSION)
+DX_ENV_APPEND(DOC_VERSION, $VERSION)
 
 # Doxygen itself:
 DX_ARG_ABLE(doc, [generate any doxygen documentation],
diff --git a/scripts/odp_version.sh b/scripts/odp_version.sh
new file mode 100755
index 0000000..357f017
--- /dev/null
+++ b/scripts/odp_version.sh
@@ -0,0 +1,7 @@ 
+#!/bin/bash
+
+GEN=`grep "define ODP_VERSION_API_GENERATION" platform/linux-generic/include/api/odp_version.h| cut -d ' ' -f 3`
+MAJ=`grep "define ODP_VERSION_API_MAJOR" platform/linux-generic/include/api/odp_version.h| cut -d ' ' -f 3`
+MIN=`grep "define ODP_VERSION_API_MINOR" platform/linux-generic/include/api/odp_version.h| cut -d ' ' -f 3`
+
+echo -n $GEN.$MAJ.$MIN