From patchwork Wed May 6 20:52:39 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Holmes X-Patchwork-Id: 48072 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f70.google.com (mail-la0-f70.google.com [209.85.215.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 03AA32121F for ; Wed, 6 May 2015 20:53:41 +0000 (UTC) Received: by layy10 with SMTP id y10sf7073789lay.0 for ; Wed, 06 May 2015 13:53:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:delivered-to:from:to:date :message-id:subject:precedence:list-id:list-unsubscribe:list-archive :list-post:list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=yVMMTilUaadMUtPc60L9rYM57KgA++hw6//yLQn0YN4=; b=P5CbpRf+YeYaD87iJy81e1FAWbVM9mkto3zjRnRytRadoThnE23Z1Uz+JQi8hBt+bF DSvJtozfxJTMUJWg1+qRHtwdvjaP8STOudk4kuYxig+OOyTBCUeEUyxWKxDG4S7rZVTj DAXbq3VfuM4OEIGnq7BiPuKrzbwodGNI7hiSulTrf/zo3+PYCR8DZS0OhJTkbGxFB8x8 wW1Kc0FxTZewe8v3KH0R6Dyiqo9EOV/C5xbrVMCep/PV2J66Ogkx7xELHlf5Inq8eBEo hVsCFyCsFIDR7jjzT1NgdR8cDpXBGGp4sALId8fR+mAlv/cwCXWJuZ0cS4Qn1abb0CAF 9rXg== X-Gm-Message-State: ALoCoQnteFokMcxEYNj/uv5Y7cFWN7HhLp/RlWrcO93Inp7FlbKUD8qdfHZleKGX36XvkRbuzxOw X-Received: by 10.180.216.12 with SMTP id om12mr184732wic.1.1430945620927; Wed, 06 May 2015 13:53:40 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.239.130 with SMTP id vs2ls96517lac.97.gmail; Wed, 06 May 2015 13:53:40 -0700 (PDT) X-Received: by 10.152.28.34 with SMTP id y2mr499542lag.14.1430945620762; Wed, 06 May 2015 13:53:40 -0700 (PDT) Received: from mail-la0-f45.google.com (mail-la0-f45.google.com. [209.85.215.45]) by mx.google.com with ESMTPS id ay8si15436938lbc.111.2015.05.06.13.53.40 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 06 May 2015 13:53:40 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.45 as permitted sender) client-ip=209.85.215.45; Received: by layy10 with SMTP id y10so16565763lay.0 for ; Wed, 06 May 2015 13:53:40 -0700 (PDT) X-Received: by 10.152.87.204 with SMTP id ba12mr445347lab.35.1430945620562; Wed, 06 May 2015 13:53:40 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.67.65 with SMTP id l1csp3075522lbt; Wed, 6 May 2015 13:53:39 -0700 (PDT) X-Received: by 10.55.15.163 with SMTP id 35mr1473053qkp.96.1430945618823; Wed, 06 May 2015 13:53:38 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id i60si5089403qgf.41.2015.05.06.13.53.37; Wed, 06 May 2015 13:53:38 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Received: by lists.linaro.org (Postfix, from userid 109) id C448961F51; Wed, 6 May 2015 20:53:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from ip-10-142-244-252.ec2.internal (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 263C161822; Wed, 6 May 2015 20:53:36 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id D45E561C82; Wed, 6 May 2015 20:53:33 +0000 (UTC) Received: from mail-qc0-f182.google.com (mail-qc0-f182.google.com [209.85.216.182]) by lists.linaro.org (Postfix) with ESMTPS id AD78261822 for ; Wed, 6 May 2015 20:53:32 +0000 (UTC) Received: by qcbgu10 with SMTP id gu10so11362902qcb.2 for ; Wed, 06 May 2015 13:53:32 -0700 (PDT) X-Received: by 10.140.80.170 with SMTP id c39mr849906qgd.55.1430945612459; Wed, 06 May 2015 13:53:32 -0700 (PDT) Received: from mike-desktop.?.holmesfamily.ws (c-98-221-136-245.hsd1.nj.comcast.net. [98.221.136.245]) by mx.google.com with ESMTPSA id q105sm1961976qgq.11.2015.05.06.13.53.31 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 06 May 2015 13:53:31 -0700 (PDT) From: Mike Holmes To: lng-odp@lists.linaro.org Date: Wed, 6 May 2015 16:52:39 -0400 Message-Id: <1430945559-4596-1-git-send-email-mike.holmes@linaro.org> X-Mailer: git-send-email 2.1.4 X-Topics: patch Subject: [lng-odp] [PATCH] linux-generic/odp_impl: add implementation version details X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: mike.holmes@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.45 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Signed-off-by: Mike Holmes --- 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 diff --git a/configure.ac b/configure.ac index d20bad2..9038761 100644 --- a/configure.ac +++ b/configure.ac @@ -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 diff --git a/platform/Makefile.inc b/platform/Makefile.inc index 9e73fc4..b05c2bc 100644 --- a/platform/Makefile.inc +++ b/platform/Makefile.inc @@ -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)" diff --git a/platform/linux-generic/odp_impl.c b/platform/linux-generic/odp_impl.c index ca3224d..46d0e40 100644 --- a/platform/linux-generic/odp_impl.c +++ b/platform/linux-generic/odp_impl.c @@ -20,8 +20,18 @@ extern "C" { #include -#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) { diff --git a/scripts/git_hash.sh b/scripts/git_hash.sh new file mode 100755 index 0000000..c9f1faf --- /dev/null +++ b/scripts/git_hash.sh @@ -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})"