1
0
Fork 0

Put the commit ID in the version string

Finally, we are able to identify the builds more accurately. Now we check
if commit-id (cogito tool) is available and pass the output to vernum.c
compilation which then exports it as a build_id string.

The first line of --version is now a bit long, we should probably move the
build date to a second indented line or something.
This commit is contained in:
Jonas Fonseca 2005-09-17 14:45:59 +02:00 committed by Jonas Fonseca
parent e8a17b97db
commit 9921e58aba
6 changed files with 12 additions and 1 deletions

View File

@ -42,6 +42,7 @@ BUILD_INCLUDED_LIBINTL = @BUILD_INCLUDED_LIBINTL@
CATALOGS = @CATALOGS@
CATOBJEXT = @CATOBJEXT@
CC = @CC@
COMMIT_ID = @COMMIT_ID@
CONFDIR = @CONFDIR@
CONFIG_NLS = @CONFIG_NLS@
DATADIRNAME = @DATADIRNAME@

View File

@ -34,6 +34,8 @@ AC_PROG_AWK
AC_PATH_PROGS(AWK, "$AWK")
AC_PROG_RANLIB
AC_PATH_PROGS(COMMIT_ID, "commit-id")
CONFIG_ASCIIDOC="no"
CONFIG_POD2HTML="no"
CONFIG_XMLTO="no"

View File

@ -83,6 +83,11 @@ ELINKSLIBS = \
$(INTLLIBS) \
util/libutil.a
# Get the GIT HEAD ID if possible
ifdef COMMIT_ID
INCLUDES += -DBUILD_ID="\"$$($(COMMIT_ID) 2> /dev/null)\""
endif
OBJS = vernum.o
vernum.o: FORCE
FORCE:

View File

@ -75,6 +75,8 @@ get_dyn_full_version(struct terminal *term, int more)
if (!init_string(&string)) return NULL;
add_format_to_string(&string, "ELinks %s", VERSION_STRING);
if (*build_id)
add_format_to_string(&string, " (%s)", build_id);
if (more) {
add_to_string(&string, "\n");
add_format_to_string(&string, _("Built on %s %s", term),

View File

@ -11,3 +11,4 @@
unsigned char *build_date = __DATE__;
unsigned char *build_time = __TIME__;
unsigned char *build_id = BUILD_ID;

View File

@ -3,6 +3,6 @@
#ifndef EL__VERNUM_H
#define EL__VERNUM_H
extern unsigned char *build_date, *build_time;
extern unsigned char *build_date, *build_time, *build_id;
#endif /* EL__VERNUM_H */