From: Lasse Collin Date: Mon, 7 Apr 2025 14:38:32 +0000 (+0300) Subject: FIXME *** Build: Put git_commit_info.h.in in distribution tarballs X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7367c578cec9fb90119a9e3eb95c4bc93b80f0a2;p=thirdparty%2Fxz.git FIXME *** Build: Put git_commit_info.h.in in distribution tarballs Maybe not. --- diff --git a/Makefile.am b/Makefile.am index 2d3320c3..18a84fc4 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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" && \ diff --git a/build-aux/git_commit_info.sh b/build-aux/git_commit_info.sh index 2c09006a..8e97fa73 100644 --- a/build-aux/git_commit_info.sh +++ b/build-aux/git_commit_info.sh @@ -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 diff --git a/build-aux/license-check.sh b/build-aux/license-check.sh index e994233e..f5d99bb6 100644 --- a/build-aux/license-check.sh +++ b/build-aux/license-check.sh @@ -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.