]> git.ipfire.org Git - thirdparty/xz.git/commitdiff
FIXME *** Build: Put git_commit_info.h.in in distribution tarballs vcs_commit_info
authorLasse Collin <lasse.collin@tukaani.org>
Mon, 7 Apr 2025 14:38:32 +0000 (17:38 +0300)
committerLasse Collin <lasse.collin@tukaani.org>
Mon, 7 Apr 2025 14:38:32 +0000 (17:38 +0300)
Maybe not.

Makefile.am
build-aux/git_commit_info.sh
build-aux/license-check.sh

index 2d3320c372ae89c65e9d91f998580f3702c4c396..18a84fc40479f960f2a8739f744bef19d1710731 100644 (file)
@@ -95,6 +95,8 @@ dist-hook:
                ( cd "$(srcdir)" && git log --pretty=medium --date=iso --stat \
                        b69da6d4bb6bb11fc0cf066920791990d2b22a06^..HEAD ) \
                        > "$(distdir)/ChangeLog"; \
+               $(SHELL) "$(srcdir)/build-aux/git_commit_info.sh" "$(srcdir)" \
+                       > "$(distdir)/git_commit_info.h.in"; \
        fi
        if type groff > /dev/null 2>&1; then \
                dest="$(distdir)/doc/man" && \
index 2c09006a90b10a32df1c2032ee9e7e4842aedd88..8e97fa73eed717cb61ad360d8158fe6a38a268d1 100644 (file)
@@ -7,6 +7,9 @@
 # Git repository commit information to be included in --version messages
 # and such places. "make clean" or the equivalent should remove the file.
 #
+# If the Git repository or the git tool aren't available but the source
+# directory contains git_commit_info.h.in, use its contents as is.
+#
 # $1 = path to source tree (default is current directory)
 # $2 = path/to/git_commit_info.h to create or update;
 #      if not provided, print to standard output
@@ -22,17 +25,19 @@ set -e
 SRCDIR=${1:-.}
 FILE=$2
 
-COMMIT=
 if test -d "$SRCDIR/.git" && type git > /dev/null 2>&1
 then
        # Abbreviated commit ID could look prettier, but web search engines
        # won't find anything with those.
        COMMIT=`git -C "$SRCDIR" log -n1 --pretty='%cs %H'`
-       COMMIT=" ($COMMIT)"
+       NEW="#define GIT_COMMIT_INFO \" ($COMMIT)\""
+elif test -f "$SRCDIR/git_commit_info.h.in"
+then
+       NEW=`cat "$SRCDIR/git_commit_info.h.in"`
+else
+       NEW='#define GIT_COMMIT_INFO ""'
 fi
 
-NEW="#define GIT_COMMIT_INFO \"$COMMIT\""
-
 # If no target file was provided, print the result to standard output.
 if test -z "$FILE"
 then
index e994233ec7e45195ffeaa0bb323c32ef9252ecf1..f5d99bb64e71b59348f7d0616e89bce9de6d60d6 100644 (file)
@@ -78,7 +78,8 @@ PAT_TARBALL_IGNORE='^(m4/)?[^/]*\.m4$
 ^ABOUT-NLS$
 ^build-aux/(config\..*|ltmain\.sh|[^.]*)$
 ^config\.h\.in$
-^configure$'
+^configure$
+^git_commit_info\.h\.in$'
 
 
 # Go to the top source dir.