All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] configure.ac: Resolve GIT_* even if repository is a submodule
@ 2021-04-20  7:52 Niklas Söderlund
  0 siblings, 0 replies; only message in thread
From: Niklas Söderlund @ 2021-04-20  7:52 UTC (permalink / raw)
  To: Hans Verkuil; +Cc: linux-media, Niklas Söderlund

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 <niklas.soderlund@ragnatech.se>
---
* 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"
-- 
2.31.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-04-20  7:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-20  7:52 [PATCH v2] configure.ac: Resolve GIT_* even if repository is a submodule Niklas Söderlund

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.