From: PatR Date: Fri, 18 May 2018 23:57:44 +0000 (-0700) Subject: commit test for renamed branch X-Git-Tag: NetHack-3.6.2_Released~255^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5c6245c312f1f6c67aa7552228050bc98e653c69;p=nethack commit test for renamed branch Locally I've committed to NetHack-3.6.0 and haven't yet pulled from upstream to get the branch rename. I expect this commit to be rejected but it could conceivably go through to the new name. --- diff --git a/doc/fixes36.2 b/doc/fixes36.2 index 4547d4273..518b76483 100644 --- a/doc/fixes36.2 +++ b/doc/fixes36.2 @@ -40,6 +40,12 @@ windows-tty: Use nhraykey by default if the players keyboard layout is windows-tty: We now support changing altkeyhandler in game windows: Added ntassert() mechanism for Windows based port use tty: significant optimizations for performance and per field rendering +unix: Makefile.src and Makefile.utl inadvertently relied on a 'gnu make' + extension when using $(VERBOSEMAKE) to reduce build-time feedback; + replace with $(QUIETCC) which operates the same but defaults to + verbose so doesn't use '$<' for multi-prerequisite targets unless + specifically requested; use 'make QUIETCC=1 ' to get the + 3.6.1 behavior back General New Features diff --git a/sys/unix/Makefile.src b/sys/unix/Makefile.src index 47af438b4..98c80a2fd 100644 --- a/sys/unix/Makefile.src +++ b/sys/unix/Makefile.src @@ -1,5 +1,5 @@ # NetHack Makefile. -# NetHack 3.6 Makefile.src $NHDT-Date: 1524689449 2018/04/25 20:50:49 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.54 $ +# NetHack 3.6 Makefile.src $NHDT-Date: 1526687360 2018/05/18 23:49:20 $ $NHDT-Branch: NetHack-3.6.2 $:$NHDT-Revision: 1.55 $ # Copyright (c) 2018 by Pasi Kallinen # NetHack may be freely redistributed. See license for details. @@ -343,7 +343,13 @@ AWK = nawk # will proceed without it GITINFO=1 -#VERBOSEMAKE = 1 +# if you change this to 1, feedback while building will omit -Dthis -Wthat +# -Isomewhere so that each file being compiled is listed on one short line; +# it requires support for '$<' in rules with more than one prerequisite +# (rather than just in suffix default rule), such as is implemented by +# gnu make and others which have picked up its extensions; +# allowed values are 0, 1, and empty (which behaves like 0) +QUIETCC=0 # ---------------------------------------- # @@ -353,7 +359,7 @@ GITINFO=1 # {unixconf.h, pcconf.h, tosconf.h}, and possibly system.h # Verbosity definitions, begin -# Set VERBOSEMAKE=1 to output more stuff. +# Set QUIETCC=1 above to output less feedback while building. # CC and CXX obey verbosity, LD and LINK don't. # AT is @ when not verbose, empty otherwise ACTUAL_CC := $(CC) @@ -361,23 +367,25 @@ ACTUAL_CXX := $(CXX) ACTUAL_LD := $(LD) ACTUAL_LINK := $(LINK) -CC_V0 = @echo "[CC] $<"; $(ACTUAL_CC) +CC_V0 = $(ACTUAL_CC) CC_V = $(CC_V0) -CC_V1 = $(ACTUAL_CC) -CC = $(CC_V$(VERBOSEMAKE)) +CC_V1 = @echo "[CC] $<"; $(ACTUAL_CC) +CC = $(CC_V$(QUIETCC)) -CXX_V0 = @echo "[CXX] $<"; $(ACTUAL_CXX) +CXX_V0 = $(ACTUAL_CXX) CXX_V = $(CXX_V0) -CXX_V1 = $(ACTUAL_CXX) -CXX = $(CXX_V$(VERBOSEMAKE)) +CXX_V1 = @echo "[CXX] $<"; $(ACTUAL_CXX) +CXX = $(CXX_V$(QUIETCC)) +# LD and LINK might be based on invoking CC and may not be able to substitute +# for QUIETCC, so feedback from them is handled differently (via $AT) LD = $(ACTUAL_LD) LINK = $(ACTUAL_LINK) -AT_V0 := @ +AT_V0 := AT_V := $(AT_V0) -AT_V1 := -AT = $(AT_V$(VERBOSEMAKE)) +AT_V1 := @ +AT = $(AT_V$(QUIETCC)) # Verbosity, end MAKEDEFS = ../util/makedefs diff --git a/sys/unix/Makefile.utl b/sys/unix/Makefile.utl index 9119cef82..78deeb23e 100644 --- a/sys/unix/Makefile.utl +++ b/sys/unix/Makefile.utl @@ -1,5 +1,5 @@ # Makefile for NetHack's utility programs. -# NetHack 3.6 Makefile.utl $NHDT-Date: 1524689449 2018/04/25 20:50:49 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.35 $ +# NetHack 3.6 Makefile.utl $NHDT-Date: 1526687364 2018/05/18 23:49:24 $ $NHDT-Branch: NetHack-3.6.2 $:$NHDT-Revision: 1.36 $ # Copyright (c) 2018 by Robert Patrick Rankin # NetHack may be freely redistributed. See license for details. @@ -127,34 +127,50 @@ LEXYYC = lex.yy.c # LEXYYC = lexyy.c +# if you change this to 1, feedback while building will omit -Dthis -Wthat +# -Isomewhere so that each file being compiled is listed on one short line; +# it requires support for '$<' in rules with more than one prerequisite +# (rather than just in suffix default rule), such as is implemented by +# gnu make and others which have picked up its extensions; +# allowed values are 0, 1, and empty (which behaves like 0) +QUIETCC=0 + +# TODO? the link/load commands below are handled differently from the ones +# in Makefile.src; these use '$(CC) $(LFLAGS)' and ought to be changed to use +# $(LD) or $(LINK) as appropriate [quiet mode echoes a misleading $< value] # ---------------------------------------- # # Nothing below this line should have to be changed. # Verbosity definitions, begin +# Set QUIETCC=1 above to output less feedback while building. +# CC and CXX obey verbosity, LD and LINK don't. +# AT is @ when not verbose, empty otherwise ACTUAL_CC := $(CC) ACTUAL_CXX := $(CXX) ACTUAL_LD := $(LD) ACTUAL_LINK := $(LINK) -CC_V0 = @echo "[CC] $<"; $(ACTUAL_CC) +CC_V0 = $(ACTUAL_CC) CC_V = $(CC_V0) -CC_V1 = $(ACTUAL_CC) -CC = $(CC_V$(VERBOSEMAKE)) +CC_V1 = @echo "[CC] $<"; $(ACTUAL_CC) +CC = $(CC_V$(QUIETCC)) -CXX_V0 = @echo "[CXX] $<"; $(ACTUAL_CXX) +CXX_V0 = $(ACTUAL_CXX) CXX_V = $(CXX_V0) -CXX_V1 = $(ACTUAL_CXX) -CXX = $(CXX_V$(VERBOSEMAKE)) +CXX_V1 = @echo "[CXX] $<"; $(ACTUAL_CXX) +CXX = $(CXX_V$(QUIETCC)) +# LD and LINK might be based on invoking CC and may not be able to substitute +# for QUIETCC, so feedback from them is handled differently (via $AT) LD = $(ACTUAL_LD) LINK = $(ACTUAL_LINK) -AT_V0 := @ +AT_V0 := AT_V := $(AT_V0) -AT_V1 := -AT = V$(AT_$(VERBOSEMAKE)) +AT_V1 := @ +AT = $(AT_V$(QUIETCC)) # Verbosity, end # timestamps for primary header files, matching src/Makefile diff --git a/sys/unix/unixmain.c.diff b/sys/unix/unixmain.c.diff new file mode 100644 index 000000000..caf6d7cb2 --- /dev/null +++ b/sys/unix/unixmain.c.diff @@ -0,0 +1,83 @@ +diff --git a/sys/unix/unixmain.c b/sys/unix/unixmain.c +index c1069144..1d51de1b 100644 +--- a/sys/unix/unixmain.c ++++ b/sys/unix/unixmain.c +@@ -44,6 +44,39 @@ static void NDECL(wd_message); + static boolean wiz_error_flag = FALSE; + static struct passwd *NDECL(get_unix_pw); + ++#if defined(__APPLE__) /* a much more convoluted version of this ++ * code used to be inline within main() */ ++static void FDECL(osx_finder, (const char *)); ++ ++/* special hack to change working directory to a resource fork when running ++ from 'Finder' on MacOSX (recognized via "/" as current dir) --sam */ ++static void ++osx_finder(arg0) ++const char *arg0; ++{ ++ /* #define MAC_PATH_VALUE ".app/Contents/MacOS/" */ ++ char mac_cwd[1024], *mac_path, *p; ++ ++ /* ++ * If current working directory is "/", switch to same directory ++ * as nethack. [This overrides !CHDIR config.] ++ */ ++ getcwd(mac_cwd, 1024); ++ if (*arg0 == '/' && !strcmp(mac_cwd, "/")) { ++ /* copy executable path/name into modifiable buffer ++ [we know there's a path since the value starts with '/'] */ ++ mac_path = dupstr(arg0); ++ /* strip off the name portion, leaving path */ ++ p = rindex(mac_path, '/'); ++ *(p + 1) = '\0'; ++ /* change working directory */ ++ chdir(mac_path); ++ /* done */ ++ free((genericptr_t) mac_path); ++ } ++} ++#endif /* __APPLE__ */ ++ + int + main(argc, argv) + int argc; +@@ -57,37 +90,8 @@ char *argv[]; + boolean resuming = FALSE; /* assume new game */ + + sys_early_init(); +- + #if defined(__APPLE__) +- { +-/* special hack to change working directory to a resource fork when +- running from finder --sam */ +-#define MAC_PATH_VALUE ".app/Contents/MacOS/" +- char mac_cwd[1024], *mac_exe = argv[0], *mac_tmp; +- int arg0_len = strlen(mac_exe), mac_tmp_len, mac_lhs_len = 0; +- getcwd(mac_cwd, 1024); +- if (mac_exe[0] == '/' && !strcmp(mac_cwd, "/")) { +- if ((mac_exe = strrchr(mac_exe, '/'))) +- mac_exe++; +- else +- mac_exe = argv[0]; +- mac_tmp_len = (strlen(mac_exe) * 2) + strlen(MAC_PATH_VALUE); +- if (mac_tmp_len <= arg0_len) { +- mac_tmp = malloc(mac_tmp_len + 1); +- sprintf(mac_tmp, "%s%s%s", mac_exe, MAC_PATH_VALUE, mac_exe); +- if (!strcmp(argv[0] + (arg0_len - mac_tmp_len), mac_tmp)) { +- mac_lhs_len = +- (arg0_len - mac_tmp_len) + strlen(mac_exe) + 5; +- if (mac_lhs_len > mac_tmp_len - 1) +- mac_tmp = realloc(mac_tmp, mac_lhs_len); +- strncpy(mac_tmp, argv[0], mac_lhs_len); +- mac_tmp[mac_lhs_len] = '\0'; +- chdir(mac_tmp); +- } +- free(mac_tmp); +- } +- } +- } ++ osx_finder(argv[0]); + #endif + + hname = argv[0];