Browse Source

Remove all use of N2N_VERSION_SHORT in favor of PACKAGE_VERSION

pull/889/head
Hamish Coleman 3 years ago
parent
commit
00a2bdc307
  1. 8
      CMakeLists.txt
  2. 2
      src/n2n.c
  3. 2
      src/sn_utils.c

8
CMakeLists.txt

@ -9,9 +9,9 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
execute_process(
COMMAND cat VERSION
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
OUTPUT_VARIABLE N2N_VERSION
OUTPUT_VARIABLE PACKAGE_VERSION
)
string(STRIP "${N2N_VERSION}" N2N_VERSION)
string(STRIP "${PACKAGE_VERSION}" PACKAGE_VERSION)
set(N2N_OSNAME ${CMAKE_SYSTEM_NAME})
execute_process(
COMMAND git status
@ -37,8 +37,8 @@ MESSAGE(STATUS "Build from git rev: ${N2N_VERSION}")
endif (GIT_ERROR_CODE EQUAL 0)
add_definitions(-DCMAKE_BUILD)
add_definitions(-DPACKAGE_VERSION="${N2N_VERSION}" -DPACKAGE_OSNAME="${N2N_OSNAME}")
add_definitions(-DN2N_VERSION="${N2N_VERSION}" -DN2N_OSNAME="${N2N_OSNAME}")
add_definitions(-DPACKAGE_OSNAME="${N2N_OSNAME}")
add_definitions(-DPACKAGE_VERSION="${PACKAGE_VERSION}" -DN2N_OSNAME="${N2N_OSNAME}")
# Build information

2
src/n2n.c

@ -590,7 +590,7 @@ void print_n2n_version () {
printf("Welcome to n2n v.%s for %s\n"
"Built on %s\n"
"Copyright 2007-2021 - ntop.org and contributors\n\n",
N2N_VERSION, PACKAGE_OSNAME, PACKAGE_BUILDDATE);
PACKAGE_VERSION, PACKAGE_OSNAME, PACKAGE_BUILDDATE);
}
/* *********************************************** */

2
src/sn_utils.c

@ -741,7 +741,7 @@ int sn_init_defaults (n2n_sn_t *sss) {
memset(sss, 0, sizeof(n2n_sn_t));
strncpy(sss->version, N2N_VERSION, sizeof(n2n_version_t));
strncpy(sss->version, PACKAGE_VERSION, sizeof(n2n_version_t));
sss->version[sizeof(n2n_version_t) - 1] = '\0';
sss->daemon = 1; /* By defult run as a daemon. */
sss->lport = N2N_SN_LPORT_DEFAULT;

Loading…
Cancel
Save