From 2673530d3d5d315978652fb897f9966cdbc1aa5c Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Mon, 17 Oct 2022 11:43:27 -1000 Subject: [PATCH] SCP: makefile: Extend SHOW VERSION output to include build OS version This is only displayed when the build OS version is different from the running OS version. --- makefile | 3 ++- scp.c | 9 ++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/makefile b/makefile index f2e42d2e..d6a59be0 100644 --- a/makefile +++ b/makefile @@ -349,6 +349,7 @@ ifeq (${WIN32},) #*nix Environments (&& cygwin) $(shell git log -1 --pretty="SIM_GIT_COMMIT_ID %H$(GIT_EXTRA_FILES)%nSIM_GIT_COMMIT_TIME $(isodate)" >.git-commit-id) endif endif + SIM_BUILD_OS_VERSION= -DSIM_BUILD_OS_VERSION="$(shell uname -a)" LTO_EXCLUDE_VERSIONS = PCAPLIB = pcap ifeq (agcc,$(findstring agcc,${GCC})) # Android target build? @@ -1352,7 +1353,7 @@ ifneq ($(DONT_USE_READER_THREAD),) endif CC_OUTSPEC = -o $@ -CC := ${GCC} ${CC_STD} -U__STRICT_ANSI__ ${CFLAGS_G} ${CFLAGS_O} ${CFLAGS_GIT} ${CFLAGS_I} -DSIM_COMPILER="${COMPILER_NAME}" -DSIM_BUILD_TOOL=simh-makefile -I . ${OS_CCDEFS} ${ROMS_OPT} +CC := ${GCC} ${CC_STD} -U__STRICT_ANSI__ ${CFLAGS_G} ${CFLAGS_O} ${CFLAGS_GIT} ${CFLAGS_I} -DSIM_COMPILER="${COMPILER_NAME}" $(SIM_BUILD_OS_VERSION) -DSIM_BUILD_TOOL=simh-makefile -I . ${OS_CCDEFS} ${ROMS_OPT} ifneq (,${SIM_VERSION_MODE}) CC += -DSIM_VERSION_MODE="${SIM_VERSION_MODE}" endif diff --git a/scp.c b/scp.c index 70227eac..6be1336a 100644 --- a/scp.c +++ b/scp.c @@ -6950,6 +6950,9 @@ if (flag) { char tarversion[PATH_MAX+1] = ""; char curlversion[PATH_MAX+1] = ""; FILE *f; +#if defined(SIM_BUILD_OS_VERSION) + char buildosversion[2*PATH_MAX+1] = S_xstr(SIM_BUILD_OS_VERSION); +#endif if ((f = popen ("uname -a", "r"))) { memset (osversion, 0, sizeof (osversion)); @@ -6960,7 +6963,11 @@ if (flag) { } while (osversion[0] == '\0'); pclose (f); } - fprintf (st, "\n OS: %s", osversion); +#if defined(SIM_BUILD_OS_VERSION) + if (strcmp(osversion, buildosversion) != 0) + fprintf (st, "\n Building OS: %s", buildosversion); +#endif + fprintf (st, "\n Running OS: %s", osversion); if ((f = popen ("uname", "r"))) { memset (os_type, 0, sizeof (os_type)); do {