Commit Graph

642 Commits

Author SHA1 Message Date
nhmall
c6fab3aad8 windows and msdos Makefile support of the changes in this branch 2019-11-24 12:01:33 -05:00
nhmall
1e0c03b3f6 incremental improvements to cross-compiling support in NetHack 3.7
Some support of new code #defines to faciliate cross-compiling:

    OPTIONS_AT_RUNTIME    If this is defined, code to support obtaining
                          the compile time options and features is
                          included. If you define this, you'll also have
                          to compile sys/mdlib.c and link the resulting
                          object file into your game binary/executable.

    CROSSCOMPILE          Flags that this is a cross-compiled NetHack build,
                          where there are two stages:
                          1. makedefs and some other utilities are compiled
                          on the host platform and executed there to generate
                          some output files and header files needed by the
                          game.
                          2. the NetHack game files are compiled by a
                          cross-compiler to generate binary/executables for
                          a different platform than the one the build is
                          being run on. The executables produced for the
                          target platform may not be able to execute on the
                          build platform, except perhaps via a software
                          emulator.

                          The 2-stage process (1. host, 2.target) can be done
                          on the same platform to test the cross-compile
                          process. In that case, the host and target platforms
                          would be the same.

    CROSSCOMPILE_HOST     Separates/identifies code paths that should only be
                          be included in the compile on the host side, for
                          utilities that will be run on the host as part of
                          stage 1 to produce output files needed to build the
                          game. Examples are the code for makedefs, tile
                          conversion utilities, uudecode, dlb, etc.

    CROSSCOMPILE_TARGET   Separates/identifies code paths that should be
                          included on the build for the target platform
                          during stage 2, the cross-compiler stage. That
                          includes most of the pieces of the game itself
                          but the code is only flagged as such if it must
                          not execute on the host.

If you don't define any of those, things should build as before.
One follow-on change that is likely required is setting the new dependency
makedefs has on src/mdlib.c in Makefiles etc.

More information about the changes:

    makedefs

    - splinter off some of makedefs functionality into a separate file
      called src/mdlib.c.
        - src/mdlib.c, while included during the compile of makedefs.c
          for producing the makedefs utility, can also be compiled
          as a stand-alone object file for inclusion in the link step
          of your NetHack game build. The src/mdlib.c code can then
          deliver the same functionality that it provided to makedefs
          right to your NetHack game code at run-time.
          For example, do_runtime_info() will provide the caller with
          the features and options that were built into the game.
          Previously, that information was produced at build time on the
          host and stored in a dat file. Under a cross-compile situation,
          those values are highly suspect and might not even reflect the
          correct options and setting for the cross-compiled target
          platform's binary/executable. The compile of those values and
          the functionality to obtain them needs to move to the target
          cross-compiler stage of the build (stage 2).
        - date information on the target-side binary is produced from
          the cross-compiler preprocessor pre-defined macros __DATE__
          and __TIME__, as they reflect the actual compile time of the
          cross-compiled target and not host-side execution of a utility
          to produce them. The cross-compiler itself, through those
          pre-defined preprocessor macros, provides them to the target
          platform binary/executable. They reflect the actual build
          time of the target binary/executable (not values produced
          at the time the makefiles utility was built and the
          appropriate option selected to store them in a text file.)
        - most Makefiles should not require adding the new file
          src/mdlib.c because util/makedefs.c has a preprocessor
          include "../src/mdlib.c" to draw in its contents. As previously
          stated though, the Makefile dependency may be required:
		makedefs.o: ../util/makedefs.c ../src/mdlib.c
                                               ^^^^^^^^^^^^^^^
2019-11-22 22:35:48 -05:00
nhmall
c9e7182f43 Merge branch 'NetHack-3.6' 2019-11-22 07:46:42 -05:00
nhmall
c8af8e23c1 slash vs backslash Makefile bit 2019-11-22 07:45:43 -05:00
nhmall
fa4552e09e Merge branch 'NetHack-3.6' 2019-11-22 07:41:53 -05:00
nhmall
7af4797671 when decl.h changes, ensure windmain is rebuilt 2019-11-22 07:40:17 -05:00
nhmall
3545374e9c internal self-recover fix and bones name buffers 2019-11-21 23:41:11 -05:00
nhmall
4a8b9ee26c merge fix 2019-11-18 19:21:50 -05:00
nhmall
47fb8e5c0e Merge branch 'NetHack-3.6' 2019-11-18 19:20:55 -05:00
nhmall
893fa4efa8 update nhusage output on Windows 2019-11-18 19:20:03 -05:00
nhmall
cc5ecbcb56 Merge NetHack-3.6 2019-11-17 00:19:33 -05:00
nhmall
80b90f2b0f Merge branch 'NetHack-3.6' 2019-11-17 00:18:24 -05:00
nhmall
21e4595127 sysconf template for windows 2019-11-17 00:16:02 -05:00
nhmall
18f6af1466 Merge branch 'NetHack-3.6' 2019-11-16 18:27:50 -05:00
PatR
2a07924063 rename S_player_override to S_hero_override 2019-11-16 14:31:57 -08:00
nhmall
b7d16efd76 Makefile.msc updates post-Lua integration 2019-11-15 09:51:04 -05:00
nhmall
d2128968fa Merge branch 'NetHack-3.7' into paxed-lua-v2-merged 2019-11-14 19:50:20 -05:00
nhmall
9470138324 Merge branch 'NetHack-3.6' 2019-11-13 01:08:33 -05:00
nhmall
ec91626316 fix mingw Makefile.gcc for 3.7 and lua support 2019-11-12 12:42:42 -05:00
nhmall
2359a9820e prototype fix after Windows gcc complaint 2019-11-11 18:12:39 -05:00
nhmall
3bc26e6c65 Merge branch 'NetHack-3.7' into paxed-lua-v2-merged 2019-11-11 14:33:31 -05:00
nhmall
900a826e8e Merge branch 'NetHack-3.6' 2019-11-11 14:32:09 -05:00
nhmall
6dfbff9d4b --showpaths wasn't returning the paths if there was an error in a config file
Also,
Windows only: Introduces some environment variable substitution for paths
specified in a config file
2019-11-11 12:49:54 -05:00
nhmall
bc69fc65d2 Merge branch 'NetHack-3.6' into bart-test 2019-11-11 11:27:50 -05:00
nhmall
632c2efdcd Merge branch 'NetHack-3.7' into paxed-lua-v2-merged 2019-11-09 12:25:43 -05:00
nhmall
afec87a766 Merge branch 'NetHack-3.6' 2019-11-09 12:24:10 -05:00
nhmall
c566c01f8d add command line option --showpaths
Add
	--showpaths
early option to show where NetHack is expecting to find certain files
without starting up a game. It exits afterwards.

Windows sample (for illustration only, locations may differ for you):
    Variable playground locations:
        [hackdir   ]="C:\Users\JohnDoe\NetHack\3.6\"
        [leveldir  ]="C:\Users\JohnDoe\AppData\Local\NetHack\3.6\"
        [savedir   ]="C:\Users\JohnDoe\AppData\Local\NetHack\3.6\"
        [bonesdir  ]="C:\ProgramData\NetHack\3.6\"
        [datadir   ]="C:\personal\nhdev\363\test\binary\"
        [scoredir  ]="C:\ProgramData\NetHack\3.6\"
        [lockdir   ]="C:\ProgramData\NetHack\3.6\"
        [sysconfdir]="C:\ProgramData\NetHack\3.6\"
        [configdir ]="C:\Users\JohnDoe\NetHack\3.6\"
        [troubledir]="C:\Users\JohnDoe\NetHack\3.6\"
    Your system configuration file (in sysconfdir):
        "C:\Users\JohnDoe\NetHack\3.6\sysconf"
    Your system symbols file (in sysconfdir):
        "C:\Users\JohnDoe\NetHack\3.6\symbols"
    Your personal configuration file (in configdir):
        "C:\Users\JohnDoe\NetHack\3.6\.nethackrc"

Linux (for illustration only, locations may differ for you):
    Your system configuration file:
        "/home/johndoe/nh/install/games/lib/nethackdir/sysconf"
    Your system symbols file:
        "/home/johndoe/nh/install/games/lib/nethackdir/symbols"
    Your personal configuration file:
        "/home/johndoe/.nethackrc"
2019-11-09 10:57:25 -05:00
nhmall
2709a395be more makefile.msc 2019-11-08 18:01:53 -05:00
nhmall
71be3f8163 some Makefile.msc macro shenanigans 2019-11-08 17:49:07 -05:00
nhmall
293082079c suppress a warning in one lua file build 2019-11-07 12:06:40 -05:00
nhmall
fecf930ac0 Makefile updates 2019-11-06 19:47:37 -05:00
nhmall
4053e38af1 Merge branch 'NetHack-3.7' into paxed-lua-v2-merged 2019-11-06 16:53:23 -05:00
nhmall
c675b234d8 Merge branch 'NetHack-3.6' 2019-11-06 16:52:25 -05:00
nhmall
e3b69ccc43 buffer size 2019-11-06 16:51:47 -05:00
nhmall
dc0c95c521 Merge branch 'NetHack-3.7' into paxed-lua-v2-merged 2019-11-06 16:49:33 -05:00
nhmall
0494152aea Merge branch 'NetHack-3.6' 2019-11-06 16:45:43 -05:00
nhmall
88f1d2f365 don't hardcode the version id in windmain 2019-11-06 16:44:25 -05:00
nhmall
223c31af0c some build fix-ups 2019-11-06 13:43:27 -05:00
nhmall
bcb627100b Merge branch 'paxed-lua-merged3' into paxed-lua-v2-merged 2019-11-06 12:56:21 -05:00
Pasi Kallinen
fd55d9118e Use lua for special level files
Game is playable, and should compile on linux and Windows.
Assumes you have a lua 5.3 library available.

Removes level compiler and associated files.
Replaces special level des-files with lua scripts.
Exposes some NetHack internals to lua:
 - des-table with commands to create special levels
 - nh-table with NetHack core commands
 - nhc-table with some constants
 - u-table with some player-specific data (u-struct)
 - selection userdata

Adds some rudimentary tests.

Adds new extended command #wizloadlua to run a specific script,
and #wizloaddes to run a specific level-creation script.

nhlib.lua is loaded for every lua script.

Download and untar lua:
  mkdir lib
  cd lib
  curl -R -O http://www.lua.org/ftp/lua-5.3.5.tar.gz
  tar zxf lua-5.3.5.tar.gz

Then make nethack normally.
2019-11-06 18:43:20 +02:00
nhmall
29002ccf0b No PDCurses right out-of-the-box; requires an edit 2019-11-06 17:25:44 +02:00
nhmall
0c7e740b44 update Windows Makefiles to support TRAVIS CI builds 2019-11-06 17:25:44 +02:00
nhmall
be94808d67 build fix for Windows if pdcurses is included after recent changes
cursmain.o : error LNK2001: unresolved external symbol _erase_char
cursmesg.o : error LNK2001: unresolved external symbol _erase_char
cursmain.o : error LNK2001: unresolved external symbol _kill_char
cursmesg.o : error LNK2001: unresolved external symbol _kill_char
2019-11-06 17:25:44 +02:00
Bart House
d4ff00cd40 Updated windows directory paths to latest iteration of design. 2019-11-04 19:34:03 -08:00
nhmall
f07bf610b8 Merge branch 'NetHack-3.6' 2019-11-04 01:18:24 -05:00
Bart House
6b88a19365 Added new map_mode tiles_fit_to_screen for Windows NetHackW.exe 2019-11-03 17:59:39 -08:00
Bart House
7c5a2adfa5 Lock TROUBLEPREFIX after parsing sysconf. 2019-11-03 14:07:11 -08:00
Bart House
da85259782 Fixes to template files . 2019-11-03 14:06:49 -08:00
Bart House
f0707fee6e More tweaks to how windows deals with directory paths. 2019-11-03 13:31:17 -08:00
nhmall
ffec86b244 Merge branch 'NetHack-3.6' 2019-11-02 22:53:46 -04:00