From patchwork Wed Jul 1 23:21:43 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Lespiau, Damien" X-Patchwork-Id: 6707091 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 3CF059F38C for ; Wed, 1 Jul 2015 23:21:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 68762206B1 for ; Wed, 1 Jul 2015 23:21:54 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 733FC206BE for ; Wed, 1 Jul 2015 23:21:52 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DCF6E6EC02; Wed, 1 Jul 2015 16:21:51 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTP id AC1216EC03 for ; Wed, 1 Jul 2015 16:21:50 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga101.fm.intel.com with ESMTP; 01 Jul 2015 16:21:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,389,1432623600"; d="scan'208";a="756864322" Received: from oritm-mobl2.ger.corp.intel.com (HELO strange.ger.corp.intel.com) ([10.252.17.214]) by orsmga002.jf.intel.com with ESMTP; 01 Jul 2015 16:21:49 -0700 From: Damien Lespiau To: intel-gfx@lists.freedesktop.org Date: Thu, 2 Jul 2015 00:21:43 +0100 Message-Id: <1435792903-11552-4-git-send-email-damien.lespiau@intel.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1435792903-11552-1-git-send-email-damien.lespiau@intel.com> References: <1435792903-11552-1-git-send-email-damien.lespiau@intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH i-g-t 4/4] build: Add an option to not use the git hash in version X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When developing, it's quite annoying that the version changes every commit, causing the library to be rebuild and everything single binary re-linked. Add a config option to skip that. I remember Ville asking for this "feature" as well. Cc: Ville Syrjälä Signed-off-by: Damien Lespiau --- configure.ac | 7 +++++++ lib/Makefile.sources | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/configure.ac b/configure.ac index 4208f00..caa3f50 100644 --- a/configure.ac +++ b/configure.ac @@ -212,6 +212,13 @@ if test "x$enable_debug" = xyes; then AC_SUBST([DEBUG_CFLAGS]) fi +# prevent relinking the world on every commit for developpers +AC_ARG_ENABLE(skip-version, + AS_HELP_STRING([--enable-skip-version], + [Do not use git hash in version]), + [skip_version=$enableval], [skip_version=no]) +AM_CONDITIONAL(SKIP_VERSION, [test "x$skip_version" = xyes]) + # ----------------------------------------------------------------------------- # To build multithread code, gcc uses -pthread, Solaris Studio cc uses -mt diff --git a/lib/Makefile.sources b/lib/Makefile.sources index f8a1b92..2148684 100644 --- a/lib/Makefile.sources +++ b/lib/Makefile.sources @@ -60,6 +60,10 @@ libintel_tools_la_SOURCES = \ .PHONY: version.h.tmp +if SKIP_VERSION +$(IGT_LIB_PATH)/version.h.tmp: + @echo '#define IGT_GIT_SHA1 "SKIP"' >> $@ +else $(IGT_LIB_PATH)/version.h.tmp: @touch $@ @if test -d $(GPU_TOOLS_PATH)/.git; then \ @@ -73,6 +77,7 @@ $(IGT_LIB_PATH)/version.h.tmp: else \ echo '#define IGT_GIT_SHA1 "NOT-GIT"' ; \ fi >> $@ +endif # SKIP_VERSION $(IGT_LIB_PATH)/version.h: $(IGT_LIB_PATH)/version.h.tmp