Commit Graph

152 Commits

Author SHA1 Message Date
nhmall
36983e6889 more msdos cross-compile fixes
undefined reference to g.variables if certain parts of
drawing.c are included in host-side utilities, so
surround the offending code in
->  #if !defined(CROSSCOMPILE) || defined(CROSSCOMPILE_TARGET)
2019-11-26 00:02:38 -05:00
nhmall
7fcccdf5c6 linux-hosted msdos cross-compiler updates 2019-11-25 22:47:54 -05:00
nhmall
f10e4218c6 msdos now has its own sysconf as the sys/winnt/sysconf.template had incompatible entries 2019-11-25 00:17:16 -05:00
nhmall
2bf7731e12 remove a debugging line from msdos-cross-compile.sh 2019-11-24 13:44:53 -05:00
nhmall
c1dd898df6 use curl which is always available on osx rather than wget 2019-11-24 13:37:22 -05:00
nhmall
a9f33df64a more support in cross-compile for the changes in this branch 2019-11-24 12:23:00 -05:00
nhmall
c6fab3aad8 windows and msdos Makefile support of the changes in this branch 2019-11-24 12:01:33 -05:00
nhmall
8bc171ec50 more sys/msdos/Makefile?.cross updates 2019-11-23 18:57:17 -05:00
Pasi Kallinen
3afbcb76f5 Minor msdos cross compile improvements 2019-11-23 23:40:25 +02:00
nhmall
69136fbb98 more cross-compile djgpp build tweaks 2019-11-23 12:19:33 -05:00
nhmall
95c1ccd716 another cross-compile script bit 2019-11-23 10:20:18 -05:00
nhmall
ad6ef85177 Merge branch 'NetHack-3.7' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.7 2019-11-23 10:15:05 -05:00
nhmall
308ebea68e add some msdos files to .gitignore, produce zip 2019-11-23 10:13:10 -05:00
nhmall
89b315be47 Makefile?.cross bits 2019-11-23 08:49:55 -05:00
nhmall
11678e72f2 fix an error with msdos cross-compiler NetHack packaging 2019-11-23 01:30:54 -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
d2128968fa Merge branch 'NetHack-3.7' into paxed-lua-v2-merged 2019-11-14 19:50:20 -05:00
nhmall
6c97b0f9a1 Merge branch 'NetHack-3.6' 2019-11-14 19:48:57 -05:00
nhmall
e0fbd52359 header issues so just remove them for now on msdos *.cross Makefiles 2019-11-14 19:18:49 -05:00
nhmall
61a8ad35f5 more minor msdos Makefile bits 2019-11-14 19:17:44 -05:00
nhmall
6ea483242e some msdos cross-compile additional notes and a clarification 2019-11-14 19:12:14 -05:00
nhmall
8e7888d631 introduce msdos build support for cross-compiling on other platforms 2019-11-14 14:10:56 -05:00
nhmall
fecf930ac0 Makefile updates 2019-11-06 19:47:37 -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
a7e3129919 Merge branch 'NetHack-3.6' 2019-11-05 11:02:24 -05:00
Ray Chason
59c6425f4c Deal with FreeDOS bugs when building pdcurses.a 2019-11-04 22:26:47 -05:00
nhmall
fe1b2d6e82 Merge branch 'NetHack-3.6' 2019-10-06 09:16:23 -04:00
PatR
0d76f68f2c tty xputc()
Another part of github issue 227.  Casting a function pointer when
passing it to another function is iffy when lying about the return
type.  tputs() expects a routine which returns int, so give it one.
Other xputc() usage is equivalent to putchar(), so define xputc()
with the same function signature as that has.

The tputs() declarations in system.h should probably be changed
(third argument is a function which takes an int rather than
unspecified parameters) but I've left them alone.  I made that change
to tputs() in sys/share/tclib.c though.

NT and MSDOS changes are untested.  tclib.c compiles ok with clang-
as-gcc on OSX but hasn't been tested with the port that uses it (VMS).
2019-10-05 16:49:34 -07:00
nhmall
2f882c0320 Merge branch 'NetHack-3.6' 2019-09-13 00:58:05 -04:00
Ray Chason
d5104c622f Use faster method to write to VGA 2019-09-12 23:04:15 -04:00
nhmall
865b301f0d another STATIC_VAR bit in sys/msdos 2019-07-14 17:34:47 -04:00
nhmall
2ae6d72765 remove STATIC_DCL, STATIC_OVL, STATIC_VAR, STATIC_PTR from sys/msdos 2019-07-14 17:26:52 -04:00
nhmall
efbe179f64 fix the msdos build for NetHack-3.7 2019-07-02 22:05:36 -04:00
nhmall
e6efc2a81b Merge branch 'NetHack-3.6' 2019-07-02 14:07:26 -04:00
nhmall
ad88205229 a bit that crept in from elsewhere 2019-07-02 14:06:14 -04:00
nhmall
1ac321eadc test and adjust for curses with msdos 2019-07-02 14:01:44 -04:00
Pasi Kallinen
217671e00f Remove built-in speaker support
The changes to amiga, mac and msdos builds are untested.
2019-05-11 11:10:00 +03:00
nhmall
abfd80d3d7 Merge branch 'NetHack-3.6.2' 2019-04-02 12:25:16 -04:00
PatR
add4d4d724 untested build fix for term_attr_fixup()
modified:
  sys/mac/mttymain.c
  sys/msdos/video.c
  sys/winnt/nttty.c
2019-04-02 07:38:57 -07:00
nhmall
fd410148c5 Merge branch 'NetHack-3.6.2' 2019-01-29 07:27:56 -05:00
nhmall
0a430cab11 every platform provides sys_random_seed() and SYS_RANDOM_SEED goes away 2019-01-28 10:32:57 +01:00
Bart House
e5e906dc3b Changes needed in various ports due to globals changes. 2018-12-24 14:47:51 -08:00
nhmall
a0b53ee391 merge 2018-11-11 10:29:52 -05:00
keni
0e51afc7cd update Files attributes with priorities and %s substitution 2018-05-31 21:42:06 -04:00
keni
9858f69fa8 update .gitattributes files for auto-generation of Files 2018-05-29 19:28:26 -04:00
nhmall
e41c80e5eb missed one 2018-05-25 18:57:41 -04:00
nhmall
6c9aa091cd guidebk.txt over guideboo.txt 2018-05-25 18:52:26 -04:00
Ray Chason
2357cb3fc2 Work around quirky FreeDOS behavior 2018-05-23 21:44:20 -04:00
keni
11f1983253 update .gitattributes files for substitution and copyright headers 2018-04-25 14:52:43 -04:00