@@ -262,6 +262,7 @@ ODP_CFLAGS="$ODP_CFLAGS -Wmissing-declarations -Wold-style-definition -Wpointer-
ODP_CFLAGS="$ODP_CFLAGS -Wcast-align -Wnested-externs -Wcast-qual -Wformat-nonliteral"
ODP_CFLAGS="$ODP_CFLAGS -Wformat-security -Wundef -Wwrite-strings"
ODP_CFLAGS="$ODP_CFLAGS -std=c99"
+ODP_CFLAGS="$ODP_CFLAGS -DPLATFORM=${with_platform}"
##########################################################################
# Default include setup
@@ -11,3 +11,6 @@ VPATH = $(srcdir) $(builddir)
lib_LTLIBRARIES = $(LIB)/libodp.la
AM_LDFLAGS += -version-number '$(ODP_LIBSO_VERSION)'
+
+GIT_DESC !=$(top_builddir)/scripts/git_hash.sh
+AM_CFLAGS += "-DGIT_HASH=$(GIT_DESC)"
@@ -20,8 +20,18 @@ extern "C" {
#include <odp/version.h>
-#define ODP_VERSION_IMPL 0
-#define ODP_VERSION_IMPL_STR ODP_VERSION_TO_STR(ODP_VERSION_IMPL)
+#define ODP_VERSION_IMPL 0
+#define ODP_VERSION_IMPL_STR \
+ ODP_VERSION_TO_STR(PLATFORM) " " \
+ ODP_VERSION_TO_STR(ODP_VERSION_API_GENERATION) "." \
+ ODP_VERSION_TO_STR(ODP_VERSION_API_MAJOR) "." \
+ ODP_VERSION_TO_STR(ODP_VERSION_API_MINOR) "-" \
+ ODP_VERSION_TO_STR(ODP_VERSION_IMPL) " (v" \
+ ODP_VERSION_TO_STR(ODP_VERSION_API_GENERATION) "." \
+ ODP_VERSION_TO_STR(ODP_VERSION_API_MAJOR) "." \
+ ODP_VERSION_TO_STR(ODP_VERSION_API_MINOR) ") " \
+ __DATE__ " " __TIME__ " " \
+ ODP_VERSION_TO_STR(GIT_HASH)
const char *odp_version_impl_str(void)
{
new file mode 100755
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+repo=https://git.linaro.org/lng/odp.git
+hash=$(git describe | tr -d "\n")
+if git diff-index --name-only HEAD &>/dev/null ; then
+ dirty=-dirty
+fi
+
+echo -n "'${repo}' (${hash}${dirty})"
Signed-off-by: Mike Holmes <mike.holmes@linaro.org> --- configure.ac | 1 + platform/Makefile.inc | 3 +++ platform/linux-generic/odp_impl.c | 14 ++++++++++++-- scripts/git_hash.sh | 9 +++++++++ 4 files changed, 25 insertions(+), 2 deletions(-) create mode 100755 scripts/git_hash.sh