build: refresh the git description whenever something is recompiled
This fixes https://savannah.gnu.org/bugs/?47962 reported by Cody Taylor.master
parent
6fda7a7057
commit
2ae490cd8f
|
@ -708,16 +708,16 @@ AM_CONDITIONAL(GROFF_HTML, test x$groff_html_support = xyes)
|
||||||
AC_CHECK_PROG(haveit, makeinfo, yes, no)
|
AC_CHECK_PROG(haveit, makeinfo, yes, no)
|
||||||
AM_CONDITIONAL(HAVE_MAKEINFO, test x$haveit = xyes)
|
AM_CONDITIONAL(HAVE_MAKEINFO, test x$haveit = xyes)
|
||||||
|
|
||||||
|
# Check whether this is a git repository.
|
||||||
AC_MSG_CHECKING([whether building from git])
|
AC_MSG_CHECKING([whether building from git])
|
||||||
if test -d .git ; then
|
if test -d .git ; then
|
||||||
AC_MSG_RESULT([yes])
|
AC_MSG_RESULT([yes])
|
||||||
AC_PATH_PROG([GIT], [git])
|
from_git=yes
|
||||||
REVISION=`($GIT rev-parse --is-inside-work-tree >/dev/null 2>&1) && ($GIT rev-parse --short HEAD)`
|
|
||||||
AC_SUBST(REVISION)
|
|
||||||
AC_DEFINE_UNQUOTED([REVISION],"${REVISION}","Setting REVISION in config.h.")
|
|
||||||
else
|
else
|
||||||
AC_MSG_RESULT([no])
|
AC_MSG_RESULT([no])
|
||||||
|
from_git=no
|
||||||
fi
|
fi
|
||||||
|
AM_CONDITIONAL(BUILDING_FROM_GIT, test x$from_git = xyes)
|
||||||
|
|
||||||
AC_CONFIG_FILES([
|
AC_CONFIG_FILES([
|
||||||
Makefile
|
Makefile
|
||||||
|
|
|
@ -1,5 +1,21 @@
|
||||||
AM_CPPFLAGS = -DLOCALEDIR=\"$(localedir)\" -DSYSCONFDIR=\"$(sysconfdir)\"
|
AM_CPPFLAGS = -DLOCALEDIR=\"$(localedir)\" -DSYSCONFDIR=\"$(sysconfdir)\"
|
||||||
|
|
||||||
|
if BUILDING_FROM_GIT
|
||||||
|
SOMETHING = "REVISION \"$(shell git describe --tags 2>/dev/null)\""
|
||||||
|
else
|
||||||
|
SOMETHING = "NOTHING \"from tarball\""
|
||||||
|
endif
|
||||||
|
|
||||||
|
nano.o: revision.h
|
||||||
|
winio.o: revision.h
|
||||||
|
|
||||||
|
revision.h: update_revision
|
||||||
|
@[ -f $@ ] || touch $@
|
||||||
|
@echo "#define $(SOMETHING)" | cmp -s $@ - || \
|
||||||
|
echo "#define $(SOMETHING)" > $@
|
||||||
|
|
||||||
|
.PHONY: update_revision
|
||||||
|
|
||||||
bin_PROGRAMS = nano
|
bin_PROGRAMS = nano
|
||||||
nano_SOURCES = browser.c \
|
nano_SOURCES = browser.c \
|
||||||
chars.c \
|
chars.c \
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
||||||
#include "proto.h"
|
#include "proto.h"
|
||||||
|
#include "revision.h"
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
@ -918,7 +919,7 @@ void usage(void)
|
||||||
void version(void)
|
void version(void)
|
||||||
{
|
{
|
||||||
#ifdef REVISION
|
#ifdef REVISION
|
||||||
printf(" nano from git, commit %s (after %s)\n", REVISION, VERSION);
|
printf(" nano from git, %s\n", REVISION);
|
||||||
#else
|
#else
|
||||||
printf(_(" nano, version %s\n"), VERSION);
|
printf(_(" nano, version %s\n"), VERSION);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -604,10 +604,4 @@ enum
|
||||||
/* The largest size_t number that doesn't have the high bit set. */
|
/* The largest size_t number that doesn't have the high bit set. */
|
||||||
#define HIGHEST_POSITIVE ((~(size_t)0) >> 1)
|
#define HIGHEST_POSITIVE ((~(size_t)0) >> 1)
|
||||||
|
|
||||||
#ifdef REVISION
|
|
||||||
#define BRANDING PACKAGE_VERSION"-git "REVISION
|
|
||||||
#else
|
|
||||||
#define BRANDING PACKAGE_STRING
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* !NANO_H */
|
#endif /* !NANO_H */
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
||||||
#include "proto.h"
|
#include "proto.h"
|
||||||
|
#include "revision.h"
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
@ -28,6 +29,12 @@
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
||||||
|
#ifdef REVISION
|
||||||
|
#define BRANDING REVISION
|
||||||
|
#else
|
||||||
|
#define BRANDING PACKAGE_STRING
|
||||||
|
#endif
|
||||||
|
|
||||||
static int *key_buffer = NULL;
|
static int *key_buffer = NULL;
|
||||||
/* The keystroke buffer, containing all the keystrokes we
|
/* The keystroke buffer, containing all the keystrokes we
|
||||||
* haven't handled yet at a given point. */
|
* haven't handled yet at a given point. */
|
||||||
|
|
Loading…
Reference in New Issue