mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-10 01:48:00 +00:00
Conditionalise the automake git-commit embedding.
This arranges that the mechanism from the previous commit automatically turns itself on and off depending on whether a .git directory even exists (so it won't try to do anything in distribution tarballs), and also arranges that it can be manually turned off by a configure option (in case someone who _is_ building from a git checkout finds it inconvenient for some reason I haven't thought of, which seems quite plausible to me).
This commit is contained in:
parent
be586d53b0
commit
19aefec3e8
6
Recipe
6
Recipe
@ -134,13 +134,15 @@
|
|||||||
# ------------------------------------------------------------
|
# ------------------------------------------------------------
|
||||||
# Additional text added verbatim to each individual Makefile.
|
# Additional text added verbatim to each individual Makefile.
|
||||||
|
|
||||||
!cflags am version -DSOURCE_COMMIT=\"`git rev-parse HEAD 2>/dev/null`\"
|
!cflags am version
|
||||||
!begin am
|
!begin am
|
||||||
|
if AUTO_GIT_COMMIT
|
||||||
BUILT_SOURCES = empty.h
|
BUILT_SOURCES = empty.h
|
||||||
CLEANFILES = empty.h
|
CLEANFILES = empty.h
|
||||||
|
libversion_a_CFLAGS += -DSOURCE_COMMIT=\"`git --git-dir=$(srcdir)/.git rev-parse HEAD 2>/dev/null`\"
|
||||||
empty.h: $(allsources)
|
empty.h: $(allsources)
|
||||||
echo '/* Empty file touched by automake makefile to force rebuild of version.o */' >$@
|
echo '/* Empty file touched by automake makefile to force rebuild of version.o */' >$@
|
||||||
|
endif
|
||||||
!end
|
!end
|
||||||
!begin >empty.h
|
!begin >empty.h
|
||||||
/* Empty file touched by automake makefile to force rebuild of version.o */
|
/* Empty file touched by automake makefile to force rebuild of version.o */
|
||||||
|
12
configure.ac
12
configure.ac
@ -42,6 +42,18 @@ AS_IF([test "x$setidtype" = "xsetgid"],
|
|||||||
AC_SUBST(SETID_CMD)
|
AC_SUBST(SETID_CMD)
|
||||||
AC_SUBST(SETID_MODE)
|
AC_SUBST(SETID_MODE)
|
||||||
|
|
||||||
|
AC_ARG_ENABLE([git-commit],
|
||||||
|
[AS_HELP_STRING([--disable-git-commit],
|
||||||
|
[disable embedding current git HEAD in binaries])],
|
||||||
|
[],
|
||||||
|
[if test -d "$srcdir/.git"; then
|
||||||
|
enable_git_commit=yes; else enable_git_commit=no; fi])
|
||||||
|
|
||||||
|
if test "x$enable_git_commit" = "xyes" -a ! -d "$srcdir/.git"; then
|
||||||
|
AC_ERROR([Cannot --enable-git-commit when source tree is not a git checkout])
|
||||||
|
fi
|
||||||
|
AM_CONDITIONAL(AUTO_GIT_COMMIT, [test "x$enable_git_commit" = "xyes"])
|
||||||
|
|
||||||
AC_ARG_WITH([gssapi],
|
AC_ARG_WITH([gssapi],
|
||||||
[AS_HELP_STRING([--without-gssapi],
|
[AS_HELP_STRING([--without-gssapi],
|
||||||
[disable GSSAPI support])],
|
[disable GSSAPI support])],
|
||||||
|
Loading…
Reference in New Issue
Block a user