From patchwork Tue Apr 20 07:52:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Niklas_S=C3=B6derlund?= X-Patchwork-Id: 12213499 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 72C34C433ED for ; Tue, 20 Apr 2021 07:52:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 34CE06101E for ; Tue, 20 Apr 2021 07:52:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229593AbhDTHwt (ORCPT ); Tue, 20 Apr 2021 03:52:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48112 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229475AbhDTHwp (ORCPT ); Tue, 20 Apr 2021 03:52:45 -0400 Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com [IPv6:2a00:1450:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C21C0C06174A for ; Tue, 20 Apr 2021 00:52:12 -0700 (PDT) Received: by mail-ej1-x629.google.com with SMTP id r9so56825356ejj.3 for ; Tue, 20 Apr 2021 00:52:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ragnatech-se.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=EUHYtqVAAFSxrHPv0XZjl0Nrq6XPonfIdz/I+Iq0zxQ=; b=Lco6PQ6VYBsMakn8d39C4ByoHvDf+toUxvxfQ3QrymkEcYlw5daW0gdiTl+XESxyf7 +bxxQMlDrbG4Vly6ZB/Xxx9gG/MtYg16sg70H4MvvBelgSXM0fFWNTcnPvnGNF2ZBEdz b7HEpwLqKfQE9SUVXwteft9pXMrUvsOksXYKA9Qj2UHfoFWsZ5u6nNLQC57UXsJCoO1F Ge3QKYMOWoKIfoMTbUTkEqLwsrI1ZU3rOwml2GCUvCfPXY4wKC/HI9Rkn+BveBUI7X/a HbMP8SYqQlkmoqNXfhCSIRG1M4drFTZbwke26YeE+Fa+Ur403UMcoy9/753k5L/8NNTf 0QfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=EUHYtqVAAFSxrHPv0XZjl0Nrq6XPonfIdz/I+Iq0zxQ=; b=BPU5Lb5BHNMWQHTtqpHQVJ6KC9ZS7rYupaziM0igo7LvIV3hoRAiAgvN2gdiLk2UCv 85mcQ8EEBBCW9e3aFgMXh96EBBz7j8V+0OfDI3mmiLeO4gvc7RfKTF56dvr9vElHLrui 9IrHNljbDfpo2Er72eJDAlStDG2E5wB61ZncWId51/34Xue74d7WHBeOYiaqXhD82oTP eydjnmR/dnZT/PvYfeG6lI85D2K8fRIuJ7gqh7XprOfLLphN/zFbIccIh9L/OMk78M8T 2ueWxnBJLvTtGwKilvvs4OX/5B4qp7Yo64KMEX8X5gKkVpwl+vrn6jbEbkOjnRrvIIBQ oeSw== X-Gm-Message-State: AOAM530qNjnNx01joDCV6euB2FvNKPBtDwNkZmuTgO3R+luYI9kqNZAy e+KqaJQdhRginwZhmrdpxA8jyQ== X-Google-Smtp-Source: ABdhPJwq9hDmR7yzvknWESFHRnQ2egamWft9ttfK7kATozjO8WBdsXxJhBTWTUjYhzv7NmpHtjKcSg== X-Received: by 2002:a17:907:6e1:: with SMTP id yh1mr26334142ejb.486.1618905131511; Tue, 20 Apr 2021 00:52:11 -0700 (PDT) Received: from bismarck.berto.se (p54ac5521.dip0.t-ipconnect.de. [84.172.85.33]) by smtp.googlemail.com with ESMTPSA id w1sm15267481edt.89.2021.04.20.00.52.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Apr 2021 00:52:11 -0700 (PDT) From: =?utf-8?q?Niklas_S=C3=B6derlund?= To: Hans Verkuil Cc: linux-media@vger.kernel.org, =?utf-8?q?Niklas_S=C3=B6derlund?= Subject: [PATCH v2] configure.ac: Resolve GIT_* even if repository is a submodule Date: Tue, 20 Apr 2021 09:52:05 +0200 Message-Id: <20210420075205.1072315-1-niklas.soderlund@ragnatech.se> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org If the v4l-utils repository is a git submodule the $(top_srcdir)/.git is a file and not a directory. Update the shell checks to allow the test to pass in both cases. Signed-off-by: Niklas Söderlund --- * Changes since v1 - Add fix for GIT_COMMIT_CNT and GIT_COMMIT_DATE. --- configure.ac | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index f144a50d034fbda0..8710ab4531162d03 100644 --- a/configure.ac +++ b/configure.ac @@ -588,13 +588,13 @@ fi CPPFLAGS="-I\$(top_srcdir)/lib/include -Wall -Wpointer-arith -D_GNU_SOURCE $CPPFLAGS" # Obtain git SHA of HEAD -AC_SUBST(GIT_SHA, ["-DGIT_SHA=\$(shell if test -d \$(top_srcdir)/.git ; then git -C \$(top_srcdir) rev-parse --short=12 HEAD ; fi)"]) +AC_SUBST(GIT_SHA, ["-DGIT_SHA=\$(shell if test -e \$(top_srcdir)/.git ; then git -C \$(top_srcdir) rev-parse --short=12 HEAD ; fi)"]) # Obtain git commit count of HEAD -AC_SUBST(GIT_COMMIT_CNT, ["-DGIT_COMMIT_CNT=\$(shell if test -d \$(top_srcdir)/.git ; then printf '-'; git -C \$(top_srcdir) rev-list --count HEAD ; fi)"]) +AC_SUBST(GIT_COMMIT_CNT, ["-DGIT_COMMIT_CNT=\$(shell if test -e \$(top_srcdir)/.git ; then printf '-'; git -C \$(top_srcdir) rev-list --count HEAD ; fi)"]) # Obtain git commit date of HEAD -AC_SUBST(GIT_COMMIT_DATE, ["-DGIT_COMMIT_DATE=\$(shell if test -d \$(top_srcdir)/.git ; then printf '\"'; TZ=UTC git -C \$(top_srcdir) show --quiet --date='format-local:%F %T\"' --format=\"%cd\"; fi)"]) +AC_SUBST(GIT_COMMIT_DATE, ["-DGIT_COMMIT_DATE=\$(shell if test -e \$(top_srcdir)/.git ; then printf '\"'; TZ=UTC git -C \$(top_srcdir) show --quiet --date='format-local:%F %T\"' --format=\"%cd\"; fi)"]) AM_COND_IF([WITH_LIBDVBV5], [USE_LIBDVBV5="yes"], [USE_LIBDVBV5="no"]) AM_COND_IF([WITH_DVBV5_REMOTE], [USE_DVBV5_REMOTE="yes"