mirror of
https://github.com/OpenVPN/openvpn.git
synced 2024-11-23 09:43:45 +08:00
configure: Allow to detect git checkout if .git is not a directory
E.g. if you use openvpn as a git submodule, it can be a file that points to the parent's git directory. The changes to Makefile.am are not strictly required, they still work with that case, but I wanted to keep the usage consistent. Change-Id: I9b7a3df012e7606ddb04a944e3fa33247180e8dd Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com> Acked-by: Arne Schwabe <arne-openvpn@rfc2549.org> Acked-by: Yuriy Darnobyt <yura.uddr@gmail.com> Message-Id: <20240906172112.87148-1-frank@lichtenheld.com> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg29092.html Signed-off-by: Gert Doering <gert@greenie.muc.de>
This commit is contained in:
parent
233e10aeec
commit
dac076fe40
@ -75,9 +75,9 @@ dist_noinst_DATA = \
|
|||||||
README.wolfssl
|
README.wolfssl
|
||||||
|
|
||||||
config-version.h:
|
config-version.h:
|
||||||
@CONFIGURE_GIT_CHFILES="`GIT_DIR=\"$(top_srcdir)/.git\" $(GIT) diff-files --name-status -r --ignore-submodules --quiet -- || echo \"+\"`"; \
|
@CONFIGURE_GIT_CHFILES="`$(GIT) -C \"$(top_srcdir)\" diff-files --name-status -r --ignore-submodules --quiet -- || echo \"+\"`"; \
|
||||||
CONFIGURE_GIT_UNCOMMITTED="`GIT_DIR=\"$(top_srcdir)/.git\" $(GIT) diff-index --cached --quiet --ignore-submodules HEAD || echo \"*\"`"; \
|
CONFIGURE_GIT_UNCOMMITTED="`$(GIT) -C \"$(top_srcdir)\" diff-index --cached --quiet --ignore-submodules HEAD || echo \"*\"`"; \
|
||||||
CONFIGURE_GIT_REVISION="`GIT_DIR=\"$(top_srcdir)/.git\" $(GIT) rev-parse --symbolic-full-name HEAD | cut -d/ -f3-`/`GIT_DIR=\"$(top_srcdir)/.git\" $(GIT) rev-parse --short=16 HEAD`"; \
|
CONFIGURE_GIT_REVISION="`$(GIT) -C \"$(top_srcdir)\" rev-parse --symbolic-full-name HEAD | cut -d/ -f3-`/`$(GIT) -C \"$(top_srcdir)\" rev-parse --short=16 HEAD`"; \
|
||||||
echo "#define CONFIGURE_GIT_REVISION \"$${CONFIGURE_GIT_REVISION}\"" > config-version.h.tmp; \
|
echo "#define CONFIGURE_GIT_REVISION \"$${CONFIGURE_GIT_REVISION}\"" > config-version.h.tmp; \
|
||||||
echo "#define CONFIGURE_GIT_FLAGS \"$${CONFIGURE_GIT_CHFILES}$${CONFIGURE_GIT_UNCOMMITTED}\"" >> config-version.h.tmp
|
echo "#define CONFIGURE_GIT_FLAGS \"$${CONFIGURE_GIT_CHFILES}$${CONFIGURE_GIT_UNCOMMITTED}\"" >> config-version.h.tmp
|
||||||
|
|
||||||
|
@ -1308,9 +1308,11 @@ fi
|
|||||||
|
|
||||||
AC_MSG_CHECKING([git checkout])
|
AC_MSG_CHECKING([git checkout])
|
||||||
GIT_CHECKOUT="no"
|
GIT_CHECKOUT="no"
|
||||||
if test -n "${GIT}" -a -d "${srcdir}/.git"; then
|
if test -n "${GIT}"; then
|
||||||
AC_DEFINE([HAVE_CONFIG_VERSION_H], [1], [extra version available in config-version.h])
|
if ${GIT} -C "$srcdir" rev-parse --is-inside-work-tree >/dev/null 2>&1; then
|
||||||
GIT_CHECKOUT="yes"
|
AC_DEFINE([HAVE_CONFIG_VERSION_H], [1], [extra version available in config-version.h])
|
||||||
|
GIT_CHECKOUT="yes"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
AC_MSG_RESULT([${GIT_CHECKOUT}])
|
AC_MSG_RESULT([${GIT_CHECKOUT}])
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user