From patchwork Thu Jul 2 14:04:57 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lespiau, Damien" X-Patchwork-Id: 6709921 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 3A421C05AC for ; Thu, 2 Jul 2015 14:05:05 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 68B482070D for ; Thu, 2 Jul 2015 14:05:04 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 194A3206B1 for ; Thu, 2 Jul 2015 14:05:02 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7195089B99; Thu, 2 Jul 2015 07:05:00 -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 3283C89B99 for ; Thu, 2 Jul 2015 07:04:59 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga101.fm.intel.com with ESMTP; 02 Jul 2015 07:05:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,393,1432623600"; d="scan'208";a="757255389" Received: from nsafajoo-mobl.ger.corp.intel.com (HELO strange.ger.corp.intel.com) ([10.252.8.2]) by orsmga002.jf.intel.com with ESMTP; 02 Jul 2015 07:04:57 -0700 From: Damien Lespiau To: intel-gfx@lists.freedesktop.org Date: Thu, 2 Jul 2015 15:04:57 +0100 Message-Id: <1435845897-14001-1-git-send-email-damien.lespiau@intel.com> X-Mailer: git-send-email 2.1.0 Subject: [Intel-gfx] [PATCH i-g-t] build: Don't use automake's conditional in a Makefile.sources 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: , MIME-Version: 1.0 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 I just remembered that those Makefile.sources files where also included by the Android build system, so we can't use automake's conditionals in there. So, we want to use GNU make's one. Unfortunately, after all those years, GNU automake still doesn't do antying useful with GNU make's ifeq: lib/Makefile.sources:66: error: else without if automake will helpefully signal that the 'else' corresponding to the 'ifeq' doesn't have a corresponding 'if'. Well, yeah, thanks. Fortunately, we can work around this by cunningly inserting a space before 'ifeq', 'else' and 'endif' and fool automake's regex-based checks. Signed-off-by: Damien Lespiau --- configure.ac | 2 +- lib/Makefile.sources | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index a69a381..77b595b 100644 --- a/configure.ac +++ b/configure.ac @@ -217,7 +217,7 @@ AC_ARG_ENABLE(git-hash, AS_HELP_STRING([--disable-git-hash], [Do not use git hash in version]), [git_hash=$enableval], [git_hash=yes]) -AM_CONDITIONAL(SKIP_GIT_HASH, [test "x$git_hash" = xno]) +AC_SUBST(GIT_HASH, [$git_hash]) # ----------------------------------------------------------------------------- diff --git a/lib/Makefile.sources b/lib/Makefile.sources index a19ffd9..7f88b65 100644 --- a/lib/Makefile.sources +++ b/lib/Makefile.sources @@ -60,10 +60,11 @@ libintel_tools_la_SOURCES = \ .PHONY: version.h.tmp -if SKIP_GIT_HASH +# leaving a space here to work around automake's conditionals + ifeq ($(GIT_HASH),no) $(IGT_LIB_PATH)/version.h.tmp: @echo '#define IGT_GIT_SHA1 "git"' >> $@ -else + else $(IGT_LIB_PATH)/version.h.tmp: @touch $@ @if test -d $(GPU_TOOLS_PATH)/.git; then \ @@ -77,7 +78,7 @@ $(IGT_LIB_PATH)/version.h.tmp: else \ echo '#define IGT_GIT_SHA1 "NOT-GIT"' ; \ fi >> $@ -endif # SKIP_GIT_HASH + endif # GIT_HASH $(IGT_LIB_PATH)/version.h: $(IGT_LIB_PATH)/version.h.tmp