mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-24 05:24:23 +00:00
Add build_number to version string
This commit is contained in:
parent
c00e4bcaf6
commit
08b7ab1dd4
@ -31,6 +31,10 @@ GIT_VERSION := $(shell sh -c 'git describe --abbrev=4 --dirty')
|
||||
sgminer_CPPFLAGS += -DGIT_VERSION=\"$(GIT_VERSION)\"
|
||||
endif
|
||||
|
||||
if USE_BUILD_NUMBER
|
||||
sgminer_CPPFLAGS += -DBUILD_NUMBER=\"$(BUILD_NUMBER)\"
|
||||
endif
|
||||
|
||||
sgminer_SOURCES := sgminer.c
|
||||
sgminer_SOURCES += api.c
|
||||
sgminer_SOURCES += elist.h miner.h compat.h bench_block.h
|
||||
|
2
api.c
2
api.c
@ -1555,7 +1555,7 @@ static void apiversion(struct io_data *io_data, __maybe_unused SOCKETTYPE c, __m
|
||||
message(io_data, MSG_VERSION, 0, NULL, isjson);
|
||||
io_open = io_add(io_data, isjson ? COMSTR JSON_VERSION : _VERSION COMSTR);
|
||||
|
||||
root = api_add_string(root, "SGMiner", VERSION, false);
|
||||
root = api_add_string(root, "SGMiner", CGMINER_VERSION, false);
|
||||
root = api_add_const(root, "API", APIVERSION, false);
|
||||
|
||||
root = print_data(root, buf, isjson, false);
|
||||
|
@ -219,6 +219,13 @@ AC_ARG_ENABLE([git-version],
|
||||
[Disable use of git version in version string even if available]),
|
||||
[wantgitver=$enableval], [wantgitver=yes])
|
||||
|
||||
AC_ARG_WITH([build_number],
|
||||
[AC_HELP_STRING([--with-build-number], [Specify a build number.])],
|
||||
[BUILD_NUMBER="$withval"]
|
||||
)
|
||||
AC_SUBST([BUILD_NUMBER])
|
||||
AM_CONDITIONAL([USE_BUILD_NUMBER], [test x$BUILD_NUMBER != x])
|
||||
|
||||
curses="auto"
|
||||
|
||||
AC_ARG_WITH([curses],
|
||||
|
11
miner.h
11
miner.h
@ -3,6 +3,17 @@
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#ifdef GIT_VERSION
|
||||
#undef VERSION
|
||||
#define VERSION GIT_VERSION
|
||||
#endif
|
||||
|
||||
#ifdef BUILD_NUMBER
|
||||
#define CGMINER_VERSION VERSION "-" BUILD_NUMBER
|
||||
#else
|
||||
#define CGMINER_VERSION VERSION
|
||||
#endif
|
||||
|
||||
#include "algorithm.h"
|
||||
|
||||
#include <stdbool.h>
|
||||
|
@ -65,11 +65,6 @@ char *curly = ":D";
|
||||
#include <sys/wait.h>
|
||||
#endif
|
||||
|
||||
#ifdef GIT_VERSION
|
||||
#undef VERSION
|
||||
#define VERSION GIT_VERSION
|
||||
#endif
|
||||
|
||||
struct strategies strategies[] = {
|
||||
{ "Failover" },
|
||||
{ "Round Robin" },
|
||||
@ -2271,7 +2266,7 @@ static void curses_print_status(void)
|
||||
unsigned short int line = 0;
|
||||
|
||||
wattron(statuswin, A_BOLD);
|
||||
cg_mvwprintw(statuswin, line, 0, PACKAGE " " VERSION " - Started: %s", datestamp);
|
||||
cg_mvwprintw(statuswin, line, 0, PACKAGE " " CGMINER_VERSION " - Started: %s", datestamp);
|
||||
wattroff(statuswin, A_BOLD);
|
||||
|
||||
mvwhline(statuswin, ++line, 0, '-', 80);
|
||||
@ -8007,7 +8002,7 @@ int main(int argc, char *argv[])
|
||||
/* We use the getq mutex as the staged lock */
|
||||
stgd_lock = &getq->mutex;
|
||||
|
||||
snprintf(packagename, sizeof(packagename), "%s %s", PACKAGE, VERSION);
|
||||
snprintf(packagename, sizeof(packagename), "%s %s", PACKAGE, CGMINER_VERSION);
|
||||
|
||||
#ifndef WIN32
|
||||
signal(SIGPIPE, SIG_IGN);
|
||||
|
6
util.c
6
util.c
@ -1759,7 +1759,7 @@ static bool send_version(struct pool *pool, json_t *val)
|
||||
if (!id)
|
||||
return false;
|
||||
|
||||
sprintf(s, "{\"id\": %d, \"result\": \""PACKAGE"/"VERSION"\", \"error\": null}", id);
|
||||
sprintf(s, "{\"id\": %d, \"result\": \""PACKAGE"/"CGMINER_VERSION"\", \"error\": null}", id);
|
||||
if (!stratum_send(pool, s, strlen(s)))
|
||||
return false;
|
||||
|
||||
@ -2443,9 +2443,9 @@ resend:
|
||||
sprintf(s, "{\"id\": %d, \"method\": \"mining.subscribe\", \"params\": []}", swork_id++);
|
||||
} else {
|
||||
if (pool->sessionid)
|
||||
sprintf(s, "{\"id\": %d, \"method\": \"mining.subscribe\", \"params\": [\""PACKAGE"/"VERSION"\", \"%s\"]}", swork_id++, pool->sessionid);
|
||||
sprintf(s, "{\"id\": %d, \"method\": \"mining.subscribe\", \"params\": [\""PACKAGE"/"CGMINER_VERSION"\", \"%s\"]}", swork_id++, pool->sessionid);
|
||||
else
|
||||
sprintf(s, "{\"id\": %d, \"method\": \"mining.subscribe\", \"params\": [\""PACKAGE"/"VERSION"\"]}", swork_id++);
|
||||
sprintf(s, "{\"id\": %d, \"method\": \"mining.subscribe\", \"params\": [\""PACKAGE"/"CGMINER_VERSION"\"]}", swork_id++);
|
||||
}
|
||||
|
||||
if (__stratum_send(pool, s, strlen(s)) != SEND_OK) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user