Commit Graph

411 Commits

Author SHA1 Message Date
nhmall
5ac71e66d5 sync linux.2020 topology with macOS.2020 2021-12-30 18:05:45 -05:00
nhmall
92879378ba remove qt-specifc hints file 2021-12-30 16:27:02 -05:00
nhmall
3cb78eaefc macOS homebrew Qt5 build fix
I had to revert this line in order to build on macOS Monterey.
2021-12-30 15:36:59 -05:00
nhmall
b633bf46f9 qt6 support follow-up
encompass Qt6 support in the common hints file macOS.2020 instead
of a separate macOS.2020-qt6, which had already diverged and would
likely be a maintenance headache.

From the Makefile perspective:
WANT_WIN_QT=1 will default to Qt5
WANT_WIN_QT5=1 will assume Qt5
WANT_WIN_QT6=1 will assume Qt6

You must have the appropriate Qt installed, of course.
I expect some additional fine-tuning will be needed as this gets
tried out.
2021-12-30 15:11:49 -05:00
Ray Chason
1f7541e496 Changes for Qt 6 on MacOS 2021-12-30 10:56:06 -08:00
Dexter Castor Döpping
07715c3bad Place libnh targets in $(TARGETPFX) 2021-12-15 22:59:22 +01:00
Dexter Castor Döpping
967dcbccf4 Fix build failing for libnh when using TARGETPFX
Compiling with WANT_LIBNH=1 and TARGETPFX=(...) failed because ioctl.o
could not be found.

This is because the targets are specified with the $(TARGETPFX) but the
libnh targets consumed these targets without the $(TARGETPFX).
2021-12-15 22:59:22 +01:00
PatR
5224d85ad3 compile-time format checking
We've had a few pull requests fixing format/argument mismatches
lately.  I did't notice when PRINTF_F(format_index,first_arg_index)
attribute use and the checking gcc and clang do with it got removed,
but that was very useful.  Putting it back triggers a whole bunch
of "format string is not literal" warnings, but that's because
'-Wformat-nonliteral' was explicitly added to the *.2020 hints.
Checking pline/You/&c arguments in the cases where the format is a
literal is more valuable than the complaints for sprintf being fed
a generated format, so reinstate PRINTF_F usage and turn off the
check for non-literal format strings.
2021-11-26 21:50:44 -08:00
nhmall
c6f5b41e51 move compiler override note above the autodetection 2021-10-23 12:30:02 -04:00
nhmall
b44b5e35a8 re-enable -Wunreachable-code under clang
whitelist the valid cases showing up

If an earlier version of clang is showing more cases (particularly
if they don't make sense), the re-enabling of the warning in
sys/unix/hints/include/compiler.2020 can be made clang-version
specific instead. I had no way to test earlier versions.
2021-10-22 12:27:10 -04:00
PatR
013f3770d1 hints/macOS.2020 - remote duplicate -DDLB 2021-10-04 19:43:04 -07:00
nhmall
f785026006 remove test bit 2021-08-21 22:51:39 -04:00
nhmall
1c270ea31b build issue without DLB defined 2021-08-21 22:47:55 -04:00
nhmall
9bb96322a8 compile NetHack-3.7 without makedefs-generated .h files
This evolves and hopefully eases the game-build requirements by
removing game-compile dependencies on any header files generated
by the makedefs utility, including:

date.h dependency and its inclusion is removed and comparable functionality
is produced at runtime via new file src/date.c.

pm.h dependency and its inclusion is removed and comparable functionality is
produced by moving the monster definitions from monst.c into new header
file called monsters.h and altering them slightly. The former pm.h header
file #define PM_ values are now replaced with appropriate emitted enum
entries during the compiler preprocessing.

onames.h dependency and	its inclusion is removed and comparable functionality
is produced by moving the object definitions from objects.c into new header
file called objects.h and altering them slightly. The former onames.h header
file #define values are now replaced with appropriate emitted enum entries
during the compiler preprocessing.

artilist.h has been slightly altered, and the former onames.h artifact-related
header file #define ART_ values are now replaced with appropriate emitted enum
entries during the compiler preprocessing.

makedefs can still produce date.h (makedefs -v), pm.h (makedefs -p), and
onames.h (makedefs -o) for reference purposes. They won't be used during
the compiler.

The other uses for makedefs remain. They are used to prepare external
file content that the game utilizes, not prerequisite code for the
compile:
    makedefs -d    (database)
    makedefs -r    (rumors)
    makedefs -h    (oracles)
    makedefs -s    (epitaphs, engravings, bogusmons)

date.c

Pull the code for date/time stamping from mdlib.c into date.c.
Set date.o to be dependent on source files, header files, and .o files
so that date.o is rebuilt from date.c when any of those changes, thus
ensuring an accurate date/time stamp. It also includes git sha
functionality formerly done by makedefs writing #define directives
into include/date.h. For unix it passes the git info on
the compile line for date.c (via sys/unix/hints/linux.2020, macOS.2020)

nethack --dumpenums (optional, but on by default)

Allow developer to obtain some internal enum values from NetHack
without having to resort to an external utility such as
makedefs.

Uncomment #define NODUMPENUMS in config.h to disable this.

The updates to sys/windows/Makefile.gcc have not been tested yet.
2021-08-21 07:59:18 -04:00
nhmall
e69808987e support for build with current Lua version 5.4.3
On some platforms this may require:
	make spotless
	make fetch-lua

I did attempt to force a reminder message about the latter to
Makefile.top this time, and hope that works correctly for everyone.
2021-06-02 19:12:47 -04:00
nhmall
30bb6525b2 add -Wdeprecated-copy if clang and clang >= 9 2021-02-05 16:28:09 -05:00
nhmall
d344e61da1 typo fix 2021-02-05 10:03:18 -05:00
nhmall
5003a0578c sync some macOS hints changes to linux hints 2021-02-05 09:51:07 -05:00
nhmall
769b8877fc separate the C compiler flags and C++ compiler flags where needed 2021-02-05 09:45:03 -05:00
nhmall
f8785792bd potential fix for the macOS issue encountered
Some build flags were unintentionally overlooked in a previous change
2021-02-05 09:38:35 -05:00
nhmall
b14c47132f more cross-compile warning bits
maximize warnings for NetHack sources
minimize warnings for Lua and pdcurses which we won't be changing
2021-02-04 19:42:07 -05:00
nhmall
c87b556f42 more msdos cross-compile pdcurses warning suppression 2021-02-04 18:53:18 -05:00
nhmall
fd970e58a2 warnings in cross-compile of pdcurses are not desired 2021-02-04 18:41:07 -05:00
nhmall
5e93fd06c0 ensure build with old linux-qt5 hints 2021-02-03 13:46:13 -05:00
nhmall
8b21a170fb clear a number of Qt build warnings on linux related to compiler flags
option ‘-Wimplicit’ is valid for C/ObjC but not for C++
option ‘-Wimplicit-function-declaration’ is valid for C/ObjC but not for C++
option ‘-Wimplicit-int’ is valid for C/ObjC but not for C++
option ‘-Wmissing-prototypes’ is valid for C/ObjC but not for C++
option ‘-Wmissing-parameter-type’ is valid for C/ObjC but not for C++
option ‘-Wold-style-definition’ is valid for C/ObjC but not for C++
option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
2021-02-03 13:18:43 -05:00
nhmall
5b1d668c44 enable -Wformat-nonliteral for linux and equivalent for windows compilers
Whitelist all the verified existing triggers:
makedefs.c: In function ‘name_file’
attrib.c: one compiler balks at a ? b : c for fmtstring
cmd.c: In function ‘extcmd_via_menu’
cmd.c: In function ‘wiz_levltyp_legend’
do.c: In function ‘goto_level’
do_name.c: In function ‘coord_desc’
dungeon.c: In function ‘overview_stats’
eat.c:  one compiler balks at a ? b : c for fmtstring
end.c:  one compiler balks at a ? b : c for fmtstring
engrave.c: In function ‘engr_stats’
hack:c one compiler balks at a ? b : c for fmtstring
hacklib.c: one compiler balks at a ? b : c for fmtstring
insight.c: one compiler balks at a ? b : c for fmtstring
invent.c: In function ‘let_to_name’
light.c: In function ‘light_stats’
mhitm.c: In function ‘missmm’
options.c: In function ‘handler_symset’
options.c: In function ‘basic_menu_colors’
options.c: In function ‘optfn_o_autopickup_exceptions’
options.c: In function ‘optfn_o_menu_colors’
options.c: In function ‘optfn_o_message_types’
options.c: In function ‘optfn_o_status_cond’
options.c: In function ‘optfn_o_status_hilites’
options.c: In function ‘doset’
options.c: In function ‘doset_add_menu’
options.c: In function ‘show_menu_controls’
options.c: In function ‘handle_add_list_remove’
pager.c: In function ‘do_supplemental_info’
pager.c: In function ‘dohelp’
region.c: In function ‘region_stats’
rumors.c: sscanf usage
sounds.c: In function ‘domonnoise’
spell.c: In function ‘dospellmenu’
timeout.c: In function ‘timer_stats’
topten.c: In function ‘outentry’, fscanf, sscanf, fprintf usage
windows.c: In function ‘genl_status_update’
zap.c: one compiler balks at a ? b : c for fmtstring
win/curses/cursstat.c: In function ‘curses_status_update’
win/tty/wintty.c: In function ‘tty_status_update’
win/win32/mswproc.c: In function ‘mswin_status_update’
2021-02-02 19:03:12 -05:00
nhmall
e2a3368837 remove Amiga cross-compile bits 2021-01-31 07:57:28 -05:00
nhmall
f963c5aca7 switch source tree from k&r to c99 2021-01-26 21:06:16 -05:00
nhmall
18a4a41b15 compiler settings alignment between macOS.2020 and linux.2020
get the warning flags on linux and macOS into better alignment

move the compiler flags into hints/include/compiler.2020 so that
maintenance changes can be made there and take effect for both
linux and macOS

this will likely trigger some initial new code warnings to be
investigated on either or both platforms
2021-01-22 16:05:30 -05:00
nhmall
1d94e65e45 finish mapglyph() removal 2021-01-02 09:22:53 -05:00
nhmall
affb60dd97 support for build with current Lua version 5.4.2
This may require
    	make spotless
    	make fetch-lua
for some platforms.
2020-12-11 09:20:26 -05:00
Pasi Kallinen
971ea03b9e Remove accidental compile warning flags 2020-12-10 22:14:07 +02:00
Pasi Kallinen
eb1fb93d06 Mark unused parameters 2020-12-10 22:08:32 +02:00
nhmall
9ea45d7a1f remove some trailing whitespace 2020-11-25 07:23:23 -05:00
nhmall
75c66d2881 Merge branch 'wasm-bug-fixes-2' of https://github.com/apowers313/NetHack into wasm-bug-fixes-2 2020-11-18 08:18:16 -05:00
Adam Powers
8c06dccd92 allow repeated running 2020-11-17 21:06:58 -08:00
nhmall
f965d187b8 support for build with current Lua version 5.4.1
This may require
	make spotless
	make fetch-lua
for some platforms.
2020-11-15 11:08:10 -05:00
Adam Powers
b43b035321 fix wasm runtime errors 2020-10-19 13:22:02 -07:00
Adam Powers
6863730b63 remove wasm 2020-10-19 13:21:40 -07:00
Adam Powers
5e5324c25b fix build flags 2020-10-19 11:55:04 -07:00
Adam Powers
6598b3d2d0 wasm requires HACKDIR for embedded files 2020-10-19 11:54:42 -07:00
nhmall
d9395dcd23 more integration suggestion adoption 2020-10-11 13:42:12 -04:00
nhmall
6806c30a59 adopt some integration suggestions
sys/lib -> sys/libnh
sys/lib/libnethackmain.c -> sys/libnh/libnhmain.c
libnethack.a -> libnh.a
2020-10-11 13:33:51 -04:00
nhmall
0adb64e384 get this working: "make wasm" 2020-10-11 10:51:46 -04:00
nhmall
d4e97cc650 libnethackmain.c includes date.h 2020-10-11 09:43:15 -04:00
nhmall
75f852f277 cross-compiles need not build host native lua library
Because some Makefile.top dependencies triggered the build
of the host native lua library, the cross-compiles were
building it needlessly.

Make it a make variable so that it can be overridden by
cross-compile recipes in sys/unix/hints/include/cross-*.2020
2020-10-11 09:08:27 -04:00
nhmall
3e39984877 more wasm dependency order tinkering 2020-10-09 09:18:51 -04:00
nhmall
139b138b78 follow-up bit
make variable had changed in PRE but not in POST
2020-10-09 09:05:56 -04:00
nhmall
a09a41f9a3 more wasm build
This issue
https://github.com/NetHack/NetHack/issues/398
reported some issues with the wasm build. Attempt to resolve
some of those.
2020-10-09 08:54:36 -04:00
nhmall
5dcc328759 be more consistent with CROSS_TO_target macro names for cross-compiles
-DCROSS_TO_MSDOS	msdos cross-compile (djgpp cross-compiler)
-DCROSS_TO_AMIGA	Amiga cross-compile
-DCROSS_TO_WASM		wasm cross-compile (emscripten)
2020-10-08 13:49:24 -04:00