Commit Graph

2121 Commits

Author SHA1 Message Date
nhmall
99ffd027ae remove NHAccess symset, github issue #638
Closes #638
2022-02-13 09:07:41 -05:00
PatR
a1bb10e8f6 unix command line
I wanted to be able to specify -windowtype:foo on the command line so
that I didn't have to use "NETHACKOPTIONS='windowtype:foo' nethack"
and it turned out that such an option already exists, as "-wfoo".
I either never knew about that or had completely forgotten it.  Anyway,
this makes specifying windowtype be more versatile.

"-wX11" still works; now "-w X11", "-windowtype=X11", "-windowtype:X11"
work too, with "--" variations of the latter too also supported.  The
long name can be truncated to any leading substring of "windowtype",
although it has to be at least "wi" for "--"; "--w" is rejected.

Also, any errors reported while processing the command line are
treated like config file processing errors rather than just delivered
with raw_printf().  On tty at least, they used to vanish when the
screen cleared to start the game, with no chance to read them.  Here's
an example from after this change.  It sets windowtype to tty and then
overrides that with X11.

|% ./nethack --w:Qt --win tty -wX11 -windowtype
|
|
| * Unknown option: --w:Qt.
| * Window type [nothing] not recognized.  Choices are:  tty, curses, X11, Qt.
|
|2 errors on command line.
|
|
|Hit return to continue:

This should probably be better integrated with argcheck() or vice
versa but the only change to that was a couple of formatting bits.

Anything that already worked should continue to work just the same,
aside from the improvement to the error feedback.
2022-02-12 11:42:17 -08:00
PatR
9b6d6d3133 apple pasteboard
Turning on -Wformat-noliteral for Mac triggered a new warning.
Blindly suppressing the warning would have silenced it but would
also have left a real bug in place.  The former format was passing
a string argument to %d format.

This converts the format to a literal with an additional argument
for the non-literal part.  It compiles cleanly but I don't know how
to test it, let alone force an error for it to report.
2022-02-11 14:43:01 -08:00
nhmall
246abbbf5c update tested versions of visual studio 2022-02-10 18:58:06 -05:00
Pasi Kallinen
1e90f89203 Chronicle of major events, and livelog
Log game events, such as entering a new dungeon level, breaking
a conduct, or killing a unique monster, in a new "Major events"
chronicle. The entries record the turn when the event happened.
The log can be viewed with #chronicle -command, and the entries
also show up in the end-of-game dump, if that is available.

This feature is on by default, but can be disabled by
defining NO_CHRONICLE compile-time option.

This also contains "live logging", writing the events as they
happen into a single livelog-file. This is mostly useful for
public servers. The livelog is off by default, and must be
compiled in with LIVELOG, and then turned on in sysconf.

Mostly this a version of livelogging from the Hardfought server,
with some changes.
2022-02-09 22:49:25 +02:00
nhmall
c2cb89cae9 vms bits to c99 2022-02-07 15:15:14 -05:00
nhmall
96c71660c6 fix two reported warnings with SERVER_ADMIN_MSG defined
Report stated a -Wformat-nonliteral at line 612,
and a -Wformat-security at line 614

I was only seeing the latter, so I added the former to the
flags in sys/unix/hints/include/compiler.370. Some compiler
versions have that warning on by default internally and others
don't. If the format string isn't a string literal, there's no
inteference with printf argument checking because that only
operates on string literals.
2022-02-07 09:16:31 -05:00
nhmall
19ff846645 prevent Windows back_buffer_flip() early on 2022-02-06 10:47:41 -05:00
nhmall
787d184570 some Makefile.mingw32 tweaking 2022-02-06 01:02:27 -05:00
nhmall
3d111a6825 change order of exe dependency in Makefile.mingw32 2022-02-05 21:51:50 -05:00
nhmall
8aa29f8a08 adjust Makefile.mingw32 for 3.7 date and time stamping
NetHack 3.7 stores timestamp information, as well as github
commit hashs information if available, internally by compiling
date.c. It is important to ensure that date.c is always
recompiled after any other NetHack source files are compiled.
2022-02-05 21:34:55 -05:00
nhmall
05f3e6efd3 update the dependencies in sys/windows/Makefile.msc
As usual for the visual studio nmake Makefile.msc, steal the generated
dependencies from the tail of sys/unix/Makefile.src, and adjust the text
to suit the Windows build.
2022-02-05 20:12:10 -05:00
PatR
f9f209bb49 Qt 5 vs Qt 6 revisited plus 'make depend' update
Rename the recently added timestamp file used to throw away old qt
'moc' files from moc.qt5 or moc.qt6 to Qt5.h-t or Qt6.h-t and use
that to also throw away old qt_*.o when switching from Qt 5 to Qt 6
or vice versa.  Temporarily the old names remain in Makefile.src's
'clean' target and in src/.gitignore but those will be removed soon.

Update 'make depend' to add the timestamp file to qt_*.o dependencies.
Have it generate rules to build qt_*.moc from ../win/Qt/qt_*.h instead
of using a template rule in hints/include/compiler.370.  So building
the Qt interface doesn't require use of that hints file anymore and
someone reading Makefile.src won't have to know about it, but using
those hints will make their life easier.

Simplify the Qt timestamp handling portion of compiler.370.  Only one
extra rule gets added when creating src/Makefile.

src/Makefile generated from sys/unix/Makefile.src that's been rebuilt
with 'make depend' got broken by uncommenting '#include "amiconf.h"'
in global.h.  That file isn't in include/ but every object file now
depended on it and make didn't know what to do about that.  Have
depend.awk treat it as a special case so that no object files depend
on it.  That means that actually modifying it won't trigger a rebuild;
anyone fiddling with that will have to always do 'make clean' or
'touch config.h-t' after changing it.  The alternative is to move it
from outdated/include/ back to include/.

In depend.awk, recent gawk complained that "\." wasn't a defined
escape sequence in regular expressions so it would be treated as ".".
That's exactly what is intended but change it to "[.]" to avoid the
warning.  Similarly for one instance each of "\#" and '\"'.  I also
tried changing "\/" to "[/]" even though that is a defined sequence
and doesn't trigger any warning.  gawk accepted it but the awk that
comes with OSX choked on it so I changed it back to "\/".
2022-02-05 04:15:51 -08:00
nhmall
2e3e53883f remove a workaround in Makefile.mingw32 2022-02-04 23:07:22 -05:00
nhmall
e795dd107e fix Makefile.mingw32 2022-02-04 20:26:05 -05:00
nhmall
0fba9cf896 .gitattributes for Xcode directory 2022-02-04 19:01:11 -05:00
nhmall
2f83190f8a macOS.370 Lua 2022-02-04 18:55:12 -05:00
nhmall
ee1eff538c Lua link on Jammy Jellyfish 2022-02-04 18:03:08 -05:00
PatR
5b28db5f23 more obsolete files: DECUS C's preprocessor
Get rid sys/share/cpp[123].shr, the pre-ANSI C preprocessor that was
included in the source distribution for use on systems with ancient
C compilers whose preprocessor that couldn't cope with nethack's large
number of macros.
2022-02-04 14:34:46 -08:00
nhmall
6af710bc97 provide a Makefile target to clean the Lua submodule 2022-02-04 17:11:09 -05:00
nhmall
a25259a97a more obsolete file references 2022-02-04 15:52:42 -05:00
nhkeni
1d210ed722 prevent ..files value from being pull from ..
This was creating extra nethack.ico entries in Files.
2022-02-04 15:11:04 -05:00
nhmall
b8489de8eb support use of git submodules with the Makefiles
git=1 when invoking make will use the submodule submodules/lua.

On windows, it will also use the submodule submodules/pdcurses.
2022-02-04 14:48:29 -05:00
nhmall
3db819478f update OS terminology used in some text references 2022-02-04 11:26:14 -05:00
PatR
bc6ca2b821 Qt 5 vs 6 'moc'
This is an attempt to address the issue of switching from Qt 5 to
Qt 6 or vice versa on Unix without running 'make spotless'.  Various
*.h files (but not all of them) in win/Qt/ are run through a program
called 'moc' to create new files *.moc that are included by *.cpp.
The problem is that the constructed files use the same names for Qt
5 or 6 but their contents apparently aren't compatible.  This adds
rules (specific to GNU make) that use a pair of timestamp files to
track which version of moc made src/*.moc and to destroy them when
switching Qt versions in order to force their re-creation.

As it stands, a hints file which includes hints/include/compiler.370
is now required in order to build the Qt interface with the Unix
Makefiles.  There's no change for platforms that don't use those and
I've no idea whether something comparable could be done for macOS
Xcode IDE.

The first time make is run with WANT_WIN_QT=1 after this is in place,
all the .moc files will be rebuilt and the subset of .cpp files which
include them will be recompiled.  After that, the .moc files will be
rebuilt as needed--and only as needed--just like any other constructed
files.
2022-02-01 13:50:12 -08:00
nhmall
bfb2a29f7a update .gitattributes for two windows folders 2022-01-29 18:16:07 -05:00
nhmall
fd792509da build doc updates and windows Makefile updates 2022-01-29 17:29:51 -05:00
nhkeni
1647125f89 rationalize extensions in doc directory
rename text files to have .txt extension, etc
    update references to changed filenames
2022-01-29 16:28:06 -05:00
nhmall
8c7137613b move a file that is no longer used to outdated 2022-01-29 15:00:50 -05:00
nhmall
893d11f7d5 mingw symbols follow-up 2022-01-29 14:06:52 -05:00
nhmall
721db76189 do away with symbols.template in windows
If the one provided in the zip/distribution is newer, replace
the one used by the game after renaming the current one to
symbols.save.

If the one used by the game is newer, do nothing with it.
2022-01-29 14:04:20 -05:00
nhmall
9b38353833 update for mingw build within CI 2022-01-29 13:58:38 -05:00
nhmall
4db0afe785 fix a comment typo 2022-01-29 09:36:09 -05:00
nhmall
c03f24ceb7 try to work around a mingw shortcoming within CI
The mingw-w64 version on the CI platform is older and
is missing a sought copy of winres.h.

This attempts to work around that by having the Makefile
create a temporary copy of winres.h in the win/win32 directory
which that windres.exe is already search in. The file is
then immediately removed after windres uses it.

The contents of the temporary winres.h match the contents
of that file that is distributed with the more up-to-date msys2
distribution of mingw-w64.

It won't be known if this workaround solves all the CI issues
with the mingw build until after it is committed and observed.
2022-01-29 09:20:29 -05:00
nhmall
c2024b8990 remove some outdated references to travis 2022-01-29 08:34:58 -05:00
nhmall
fdaf6ab328 comment bit 2022-01-28 09:31:30 -05:00
nhmall
a6a7af368f mingw rc and lua version 2022-01-28 00:08:02 -05:00
Feiyun Wang
96de8d58d6 Some improvements in Makefile.mingw32.depend
- Change $(cce) to output .d file prerequisite too, the same as .o
- Replace $(CLEAN_FILE) handling w/ "clean: cleandep", for more encapsulation
2022-01-27 18:34:50 -05:00
nhmall
8a26e01397 remove sys/windows/Makefile.gcc
It has been superseded by sys/windows/Makefile.mingw32
2022-01-27 18:34:23 -05:00
Feiyun Wang
2ba0ef0579 Add Makefile.mingw32 and Makefile.mingw32.depend 2022-01-27 18:33:52 -05:00
Feiyun Wang
1cb0260b1c Fix panic "Unexpected DpiAwareness state" in Windows 10 for mingw32 version. 2022-01-27 18:33:52 -05:00
Feiyun Wang
3de2b825b0 Fix mingw32 building errors. 2022-01-27 18:33:52 -05:00
Feiyun Wang
4b4070fb57 Remove DPI_AWARENESS stuff for mingw32 in win10.h 2022-01-27 18:33:52 -05:00
nhmall
5f0b52cf83 utilize the submodules for Windows build 2022-01-27 18:30:43 -05:00
nhmall
13ee03be1f support for build with current Lua version 5.4.4
On some platforms this may require:
       re-using a sys/unix/hints file to generate updated Makefiles
       make spotless
       make fetch-lua
2022-01-27 18:23:17 -05:00
nhmall
5928f8f70a windows date updates
Also remove reference to sys/windows/Makefile.gcc
2022-01-27 16:59:00 -05:00
nhmall
f4331a2d03 adjust build procedures for added file
Builds for:
   sys/msdos/Makefile.GCC - for local build on msdos itself (untested)
   sys/unix/NetHack.xcodeproj/project.pbxproj   - for Xcode build
   sys/windows/Makefile.gcc - for Windows build via Ming-w64 (untested)
   sys/windows/Makefile.msc - for visual studio nmake build
   sys/windows/vs/files.props for visual studio solution/project build
2022-01-20 10:37:53 -05:00
PatR
5f14f0ff57 options help one more time...
Move the help text for the 'O' command from the code into its own file
and allow that to be accessed from the '?' menu as well as by choosing
entry '?' in the 'O' menu.

sys/unix/Makefile.top has been updated to handle new 'optmenu', others
need to catch up.  The game will still build and run without the file
but asking for options menu help won't work until they do.
2022-01-19 14:22:21 -08:00
nhmall
dd28139a9e QT build warning
The reason that the QT6.2 build on Linux was getting a warning
on qt_main.cpp, but the QT6.2 build on macOS was not, was
because of a difference in compiler flags between clang++ and g++.

clang++ was using the
    -Wno-deprecated-declarations
and g++ wasn't, so add it.
2022-01-15 17:12:06 -05:00
nhmall
33cbcab6b3 tested Jan 11 visual studio updates 2022-01-13 21:45:05 -05:00