mirror of
https://github.com/GOSTSec/sgminer
synced 2025-02-01 01:14:22 +00:00
build: use git version if available.
Borrowed from Arch Linux pacman: https://projects.archlinux.org/pacman.git/tree/
This commit is contained in:
parent
76b79b2fb2
commit
f2f2bcedc7
@ -26,6 +26,11 @@ endif
|
||||
|
||||
sgminer_CPPFLAGS += $(ADL_CPPFLAGS)
|
||||
|
||||
if USE_GIT_VERSION
|
||||
GIT_VERSION := $(shell sh -c 'git describe --abbrev=4 --dirty')
|
||||
sgminer_CPPFLAGS += -DGIT_VERSION=\"$(GIT_VERSION)\"
|
||||
endif
|
||||
|
||||
sgminer_SOURCES := sgminer.c
|
||||
sgminer_SOURCES += api.c
|
||||
sgminer_SOURCES += elist.h miner.h compat.h bench_block.h
|
||||
|
22
configure.ac
22
configure.ac
@ -225,6 +225,11 @@ else
|
||||
DLOPEN_FLAGS=""
|
||||
fi
|
||||
|
||||
AC_ARG_ENABLE([git-version],
|
||||
AS_HELP_STRING([--disable-git-version],
|
||||
[Disable use of git version in version string even if available]),
|
||||
[wantgitver=$enableval], [wantgitver=yes])
|
||||
|
||||
curses="auto"
|
||||
|
||||
AC_ARG_WITH([curses],
|
||||
@ -287,6 +292,20 @@ else
|
||||
fi
|
||||
AC_SUBST(LIBCURL_LIBS)
|
||||
|
||||
# Enable or disable use of git version in version string
|
||||
AC_MSG_CHECKING(whether to use git version if available)
|
||||
if test "x$wantgitver" = "xyes" ; then
|
||||
AC_CHECK_PROGS([GIT], [git])
|
||||
AC_CHECK_FILE([.git/], hasgitdir=yes)
|
||||
usegitver=$ac_cv_file__git_
|
||||
if test $GIT -a "x$hasgitdir" = "xyes"; then
|
||||
AC_DEFINE([USE_GIT_VERSION], [1], [Use GIT version in version string])
|
||||
fi
|
||||
else
|
||||
AC_MSG_RESULT([no, disabled by configure])
|
||||
usegitver=no
|
||||
fi
|
||||
AM_CONDITIONAL(USE_GIT_VERSION, [test x$usegitver = xyes])
|
||||
|
||||
#check execv signature
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([
|
||||
@ -374,6 +393,8 @@ echo
|
||||
echo "Configuration Options Summary:"
|
||||
echo
|
||||
|
||||
echo " Use git version......: $usegitver"
|
||||
|
||||
if test "x$libcurl" != xno; then
|
||||
echo " libcurl(GBT+getwork).: Enabled: $LIBCURL_LIBS"
|
||||
else
|
||||
@ -382,7 +403,6 @@ fi
|
||||
|
||||
echo " curses.TUI...........: $cursesmsg"
|
||||
|
||||
|
||||
if test "x$opencl" != xno; then
|
||||
if test $found_opencl = 1; then
|
||||
echo " OpenCL...............: FOUND. GPU mining support enabled"
|
||||
|
@ -62,6 +62,11 @@ char *curly = ":D";
|
||||
#include <sys/wait.h>
|
||||
#endif
|
||||
|
||||
#ifdef GIT_VERSION
|
||||
#undef VERSION
|
||||
#define VERSION GIT_VERSION
|
||||
#endif
|
||||
|
||||
struct strategies strategies[] = {
|
||||
{ "Failover" },
|
||||
{ "Round Robin" },
|
||||
@ -2124,7 +2129,7 @@ static void curses_print_status(void)
|
||||
struct pool *pool = current_pool();
|
||||
|
||||
wattron(statuswin, A_BOLD);
|
||||
cg_mvwprintw(statuswin, 0, 0, PACKAGE " version " VERSION " - Started: %s", datestamp);
|
||||
cg_mvwprintw(statuswin, 0, 0, PACKAGE " " VERSION " - Started: %s", datestamp);
|
||||
wattroff(statuswin, A_BOLD);
|
||||
mvwhline(statuswin, 1, 0, '-', 80);
|
||||
cg_mvwprintw(statuswin, 2, 0, "%s", statusline);
|
||||
|
Loading…
x
Reference in New Issue
Block a user