1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00

Use git tools instead of cogito for getting the build ID

The build ID now includes both last tagged version, commit generation
since last tagged version, as well as the leading characters of the
commit ID and a flag for dirty working tree.
(cherry picked from commit c2a0d3b969)
This commit is contained in:
Jonas Fonseca 2008-01-22 13:21:29 +01:00 committed by Kalle Olavi Niemitalo
parent bb6d319867
commit 705acfa05a
3 changed files with 6 additions and 4 deletions

View File

@ -54,7 +54,7 @@ ASCIIDOC_FLAGS = @ASCIIDOC_FLAGS@
AWK = @AWK@ AWK = @AWK@
CATALOGS = @CATALOGS@ CATALOGS = @CATALOGS@
CC = @CC@ CC = @CC@
CG_COMMIT_ID = @CG_COMMIT_ID@ GIT = @GIT@
CONFDIR = @CONFDIR@ CONFDIR = @CONFDIR@
DOXYGEN = @DOXYGEN@ DOXYGEN = @DOXYGEN@
GLIBC21 = @GLIBC21@ GLIBC21 = @GLIBC21@

View File

@ -61,7 +61,7 @@ AC_PATH_PROGS(AWK, "$AWK")
AC_PROG_RANLIB AC_PROG_RANLIB
AC_PROG_INSTALL AC_PROG_INSTALL
AC_PATH_PROGS(CG_COMMIT_ID, "cg-commit-id") AC_PATH_PROGS(GIT, "git")
AC_PATH_PROGS(SPARSE, "sparse") AC_PATH_PROGS(SPARSE, "sparse")
CONFIG_ASCIIDOC="no" CONFIG_ASCIIDOC="no"

View File

@ -28,8 +28,10 @@ SUBDIRS = \
viewer viewer
# Get the GIT HEAD ID if possible # Get the GIT HEAD ID if possible
ifdef CG_COMMIT_ID ifdef GIT
BUILD_ID=$(shell GIT_DIR=$(top_srcdir)/.git $(CG_COMMIT_ID) 2> /dev/null) GITDESC = $(shell $(GIT) --git-dir=$(top_srcdir)/.git describe 2>/dev/null)
WTDIRTY = $(shell $(GIT) --git-dir=$(top_srcdir)/.git diff-index HEAD 2>/dev/null)
BUILD_ID = $(subst elinks-,,$(GITDESC))$(if $(WTDIRTY),-dirty)
endif endif
INCLUDES += -DBUILD_ID="\"$(BUILD_ID)\"" INCLUDES += -DBUILD_ID="\"$(BUILD_ID)\""