From patchwork Thu May 7 12:38:06 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Holmes X-Patchwork-Id: 48111 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f72.google.com (mail-wg0-f72.google.com [74.125.82.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5592520553 for ; Thu, 7 May 2015 12:38:20 +0000 (UTC) Received: by wghm4 with SMTP id m4sf12426621wgh.2 for ; Thu, 07 May 2015 05:38:19 -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=Cr9sGE8XOcaqyipWyxoRwlX0h4PjoR5QgpEb9+6d2yE=; b=Xt1/lhiRSkT9rqFFzO6XOm1gG5IXQfGo6L+aA4KZOPJ5coluWDCMpAUiv8nKZfVd21 7m6CG5OlT+LhT2wE83gwMkpJOgN/0t0d7kpBxpCLU+Nc+Ob54xoMl2nkRoca1aChK0c5 wBa06JZCaukEcEgYlI5ox+ub6UZ2lOkt3OkVUxt85OyTyr9EabVachz3QiNXwwb5VdC5 QEsLd8QozqZMgb+3PwqaLiQpLLQ8qh68pxkF67sw6TUVD5lmp8ujMuNxrm5W6WKtiLCf 6KESshJ+qfGXRn5o7Yx+z0WxvZbsDSm8o0YnMhUZc2+R3cUwFrms1laT8QUs9r5yM2hU Ijtw== X-Gm-Message-State: ALoCoQls9gVYujXYpqfiLthSUGCVp/DetnWFpyUdmVJ8nLz1fm8uCgqehu07mYf2IO9/7uSIGqBE X-Received: by 10.180.11.101 with SMTP id p5mr1991732wib.3.1431002299656; Thu, 07 May 2015 05:38:19 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.27.102 with SMTP id s6ls192926lag.73.gmail; Thu, 07 May 2015 05:38:19 -0700 (PDT) X-Received: by 10.112.171.68 with SMTP id as4mr2943193lbc.64.1431002299492; Thu, 07 May 2015 05:38:19 -0700 (PDT) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com. [209.85.215.54]) by mx.google.com with ESMTPS id eu8si1199216lbc.171.2015.05.07.05.38.19 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 May 2015 05:38:19 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.54 as permitted sender) client-ip=209.85.215.54; Received: by lagv1 with SMTP id v1so29481986lag.3 for ; Thu, 07 May 2015 05:38:19 -0700 (PDT) X-Received: by 10.112.140.231 with SMTP id rj7mr2845466lbb.76.1431002299335; Thu, 07 May 2015 05:38:19 -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 l1csp3415947lbt; Thu, 7 May 2015 05:38:18 -0700 (PDT) X-Received: by 10.229.54.196 with SMTP id r4mr4874856qcg.15.1431002297934; Thu, 07 May 2015 05:38:17 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id i77si1854775qhc.0.2015.05.07.05.38.17; Thu, 07 May 2015 05:38:17 -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 C54D661FE8; Thu, 7 May 2015 12:38:16 +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_H2, 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 1E49961F50; Thu, 7 May 2015 12:38:15 +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 2090F61FE4; Thu, 7 May 2015 12:38:13 +0000 (UTC) Received: from mail-qk0-f175.google.com (mail-qk0-f175.google.com [209.85.220.175]) by lists.linaro.org (Postfix) with ESMTPS id 55CD961F50 for ; Thu, 7 May 2015 12:38:12 +0000 (UTC) Received: by qku63 with SMTP id 63so25943969qku.3 for ; Thu, 07 May 2015 05:38:12 -0700 (PDT) X-Received: by 10.140.92.165 with SMTP id b34mr4521925qge.13.1431002291989; Thu, 07 May 2015 05:38:11 -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 g184sm1308165qhc.6.2015.05.07.05.38.11 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 07 May 2015 05:38:11 -0700 (PDT) From: Mike Holmes To: lng-odp@lists.linaro.org Date: Thu, 7 May 2015 08:38:06 -0400 Message-Id: <1431002286-27030-1-git-send-email-mike.holmes@linaro.org> X-Mailer: git-send-email 2.1.4 X-Topics: patch Subject: [lng-odp] [PATCH v2] 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.54 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 --- V2 Reduce the number fo files touched. platform/Makefile.inc | 4 ++++ platform/linux-generic/odp_impl.c | 14 ++++++++++++-- scripts/git_hash.sh | 9 +++++++++ 3 files changed, 25 insertions(+), 2 deletions(-) create mode 100755 scripts/git_hash.sh diff --git a/platform/Makefile.inc b/platform/Makefile.inc index 9e73fc4..4000d64 100644 --- a/platform/Makefile.inc +++ b/platform/Makefile.inc @@ -11,3 +11,7 @@ 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)" +AM_CFLAGS += -DPLATFORM=${with_platform} 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})"