Commit Graph

1891 Commits

Author SHA1 Message Date
Adam Powers
c91ec0068f update to new build system 2020-10-19 11:49:34 -07:00
Adam Powers
69264684bd fix build path 2020-10-19 11:47:56 -07:00
Adam Powers
8fcc02fb81 fix stash merge conflict 2020-10-19 11:45:22 -07:00
nhmall
4c933fbf3c recognize visual studio 2019 16.7.6 in sys/winnt/Makefile.msc 2020-10-15 09:38:52 -04: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
eaa8b99eea follow-up bit
remove an unnecessary dependency for top Makefile wasm
2020-10-11 09:16:23 -04:00
nhmall
efdf4f8979 Merge branch 'NetHack-3.7' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.7 2020-10-11 09:12:02 -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
Bart House
bb04a9b041 Support both VS 2017 and VS 2019 without making changes to project files.
Renamed 'vs2017' folder to 'vs'.
2020-10-10 15:15:59 -07:00
Bart House
848f37207d Add text mentioning that LUA sources must be copied into tree. 2020-10-10 14:17:58 -07:00
PatR
d20394c4bc unix/Makefile.utl
Replace use of $(LINK) with $(CLINK) or $(CXXLINK) as warranted.
When the Qt interface is enabled, the utility programs were all
(except dlb) being linked with C++ support.  That didn't cause
any problems, just looked wrong.  Link them as C instead of C++.
Two actually do need C++ support (and still have it) but both
are dead:  'tile2beos' because the source file doesn't exist (not
even in 'outdated'), 'tileedit' because it won't build with Qt5.
I didn't bother with QUIETCC support for them.

There were still a couple of references to dgn_comp (for the lint
target; just in the name of a macro, not its value); remove those.
2020-10-09 08:45:03 -07: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
de80dd2437 cross-compile fix-up 2020-10-09 08:52:46 -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
nhmall
724e5fba25 adding ; was inappropriate for BUILDMORE list of dependencies 2020-10-06 02:26:40 -04:00
nhmall
a8d31910ec target lua build was missing -c on cross-compile 2020-10-06 02:01:30 -04:00
nhmall
dc47c46314 more wasm cross-compiling follow-up 2020-10-06 01:47:19 -04:00
nhmall
ac493aa455 placement of libnethack targets required adjusting
From -PRE to -POST section
2020-10-04 21:12:03 -04:00
nhmall
d8961b0067 updates for LIBNH build 2020-10-04 20:48:09 -04:00
nhmall
7bf5172f2e unixmain and libnethackmain diverged in the updated PR
put unixmain back the way it was, now that libnethackmain is in the tree after all.
2020-10-04 20:14:45 -04:00
nhmall
c3683eaa9b Merge branch 'libnethack2' into NetHack-3.7 2020-10-04 20:13:35 -04:00
nhmall
15c1cb648d integrate updates made to PR earlier on Oct 4 2020-10-04 20:05:29 -04:00
nhmall
751d5ef76c Merge branch 'libnethack' of https://github.com/apowers313/NetHack into libnethack2 2020-10-04 19:51:37 -04:00
PatR
49ef50fc54 Makefile.src: avoid extra feedback while linking
Recently added cross-compile stuff had resulted in an extra line
of feedback when linking:  'true;'.  Suppress that.

Also, I think 'AWK=nawk' was needed for Solaris or maybe even
SunOS.  Switch 'make depend' to use ordinary awk by default since
most systems have Posix-compliant awk these days and OSX doesn't
have nawk.
2020-10-04 16:34:59 -07:00
Adam Powers
ac4649e63f add globals, constants, and helpers 2020-10-04 14:03:04 -07:00
nhmall
de0195191b update original documentation for pr385
Changes to be committed:
	modified:   sys/lib/README.md
2020-10-04 15:19:58 -04:00
nhmall
b41b897565 remove two unneeded files 2020-10-04 14:51:10 -04:00
Adam Powers
dc2d757399 libnethack pr385
roll parts of pr385 into source tree

This does not take the PR as is.

Unlike the PR, this streamlines and minimizes the integration somewhat:

- use hints/include mechanism instead of creating alternative
  Makefile.dat, Makefile.src, Makefile.top, Makefile.utl in sys/lib;
  those would have been a maintenance nightmare.

- don't have alternative mkmkfile.sh and setup.sh in sys/lib.

- sys/lib/libnethackmain.c differed from sys/unix/unixmain.c by
  very little, so just place a small bit of conditional code at the
  top of sys/unix/unixmain.c instead.

- changed the conditional code bits from __EMSCRIPTEN__ to
  CROSS_TO_WASM.

- You should be able to build the wasm result by:
    cd sys/unix ; sh setup.sh hints/linux.2020 ; cd ../..
    make fetch-lua    (<-one time)
    make WANT_LIBNH all

- You should be able to build LIBNBH by:
    cd sys/unix ; sh setup.sh hints/linux.2020 ; cd ../..
    make fetch-lua    (<-one time)
    make CROSS_TO_WASM=1 all

As it is currently coded, winshim.c requires C99.
2020-10-04 14:46:32 -04:00
nhmall
ef6978ec51 update sys/winnt/console.rc 2020-10-02 16:01:04 -04:00
nhmall
1261aedd45 more recover and cross-compiling 2020-10-01 10:04:05 -04:00
nhmall
92902fd128 make sure recover utily is built for the CROSSCOMPILE target 2020-09-30 21:45:45 -04:00
nhmall
1ff5b519c8 reinstate one $(CROSSCOMPILE_TARGET) in sys/winnt/Makefile.msc
It was removed but shouldn't have been.
2020-09-29 15:13:52 -04:00
nhmall
945d10cfbc cross-compile update
Update the cross-compiling doc at the top.

Remove sys/msdos/Makefile1.cross, sys/msdos/Makefile2.cross, and
sys/msdos/msdos-cross-compile.sh as they are no longer required.

Remove occurrences of CROSSCOMPILE_HOST as the host-side of a
cross-compile can be determined from:
    defined(CROSSCOMPILE) && !defined(CROSSCOMPILE_TARGET)
without the additional macro.
2020-09-29 15:01:37 -04:00
nhmall
5e9303f9df msdos cross-compile follow-up bits
add missing make rule for ../win/share files to cross-pre.2020

adjust .travis.yml to use the new approach for building msdos target
2020-09-29 09:41:31 -04:00
nhmall
4b58cfd201 follow-up bit
break into TARGETDIR and TARGETPFX
2020-09-28 18:19:20 -04:00
nhmall
cb223271cb add cross-compile recipe for amiga
Disclaimer: This is a minimal recipe, just to get someone else
started if they have a desire to get a full cross-compile of
NetHack-3.7 going for the Amiga. Some NetHack code bitrot was
corrected, and it does seem able to compile the game itself
to a point. See caveats below.

- If you want to obtain the cross-compiler and tools/libs for Amiga
         https://github.com/bebbo/amiga-gcc

  To our knowledge, a pre-built copy isn't available, so you have to
  obtain the source via git and build it on your system.

  The build prerequisite packages for Ubuntu are easily obtained:

    sudo apt install make wget git gcc g++ lhasa libgmp-dev \
        libmpfr-dev libmpc-dev flex bison gettext texinfo ncurses-dev \
        autoconf rsync

  The build prerequisite packages for macOS are apparently easily
  obtained via homebrew, but that was not tested:

    brew install bash wget make lhasa gmp mpfr libmpc flex gettext \
    texinfo gcc make autoconf

  After installing the prerequite packages and the cross-compiler
  it was a straightforward build:

        git clone https://github.com/bebbo/amiga-gcc.git
        cd amiga-gcc
        make update
    [Note that you may have to take ownership of the files in the
     bebbo repo via chown before succesfully carrying out the next
     steps]
        make clean
        make clean-prefix
        date; make all -j3 >&b.log; date
  The compiler pieces are installed in /opt/amiga by default which
  was satisfactory for our initial attempt, but if you want you can
  alter the prefix before you build if you want. That is all
  spelled out on the page at: https://github.com/bebbo/amiga-gcc

  The Amiga cross-compile can then be carried out by specifying
  CROSS_TO_AMIGA=1 on the make command line.

  For example:
       make CROSS_TO_AMIGA=1 all
       make CROSS_TO_AMIGA=1 package

You can explicitly include tty and curses support if desired, otherwise
you'll end up with a tty-only cross-compile build. The SDL1 pdcurses
support has not been tested.

       make WANT_WIN_TTY=1 WANT_WIN_CURSES=1 CROSS_TO_AMIGA=1 all

Also note that building the amiga targets using the make command
above, does not preclude you from building local linux or macOS
targets as well. Just drop the CROSS_TO_AMIGA=1 from the make
command line.

The cross-compiler hints additions are enclosed inside ifdef sections
and won't interfere with the non-cross-compile build in that case.

CAVEATS: The original NetHack Amiga build steps included the source for
some utilities that were built and executed on the amiga: txt2iff and
xpm2iff as part of the NetHack build procedure on amiga. Those did not
compile out-of-the-box on the linux host. They will either have to be:
    - ported to build and run on the linux or macOS cross-compile host

   or

    - their functionality will have to be rolled into amiga NetHack
      itself and executed on the target Amiga the first time the game
      is run, perhaps.

Good luck amiga aficionados, perhaps you'll be able to take this
initial effort forward and get NetHack-3.7 available on the amiga or
amiga-emulator. Let us know if you do, and we can roll changes in
if you provide them.
2020-09-28 17:30:22 -04:00
nhmall
14b532bf10 add cross-compile recipe for msdos
- If you want to obtain the djgpp cross-compiler and tools/libs for MSDOS,
which is available for linux and macOS, you can use the following script
to obtain it:

       sh sys/msdos/fetch-cross-compiler.sh

That script won't install anything, it is just file fetches. It will
store the cross-compiler in subfolders of lib and the hints files are
configured to find it appropriately there.

Note: Both the fetch and the msdos cross-compile package target require
unzip and zip to be available on your host build system.

Cross-compiler bits:
       https://github.com/andrewwutw/build-djgpp
   and the pre-built binary for your platform from:
       https://github.com/andrewwutw/build-djgpp/releases/download/v3.0/
   and a DOS-extender (for including in msdos packaging) from
       http://sandmann.dotster.com/cwsdpmi/csdpmi7b.zip
   and pdcurses from:
       https://github.com/wmcbrine/PDCurses.git

The MSDOS cross-compile can then be carried out by specifying
CROSS_TO_MSDOS=1 on the make command line.

For example:
       make CROSS_TO_MSDOS=1 all
       make CROSS_TO_MSDOS=1 package

You can explicitly include tty and curses support if desired, otherwise
you'll end up with a tty-only cross-compile build:
       make WANT_WIN_TTY=1 WANT_WIN_CURSES=1 CROSS_TO_MSDOS=1 all

Also note that building the msdos targets using the make command
above, does not preclude you from building local linux or macOS
targets as well. Just drop the CROSS_TO_MSDOS=1 from the make
command line.

The cross-compiler hints additions are enclosed inside ifdef sections
and won't interfere with the non-cross-compile build in that case.
2020-09-28 16:28:15 -04:00
nhmall
b9b4755fe3 expand sys/unix Makefiles scope
Expand the use of the sys/unix Makefiles to be used for both normal
local builds and installs, as well as cross-compiles for other
platforms/targets.

Up until now, the primary unix Makefiles have treated util/host-side
component compiles, links and target object files just the same as
the game component compiles, links, and target object files.

Unfortunately, that meant that cross-compile effort typically had
to re-invent Makefiles specific to the cross-compile, creating a
maintenance burden and deviation from the typical local unix build
and providing a daunting obstacle to those that want to establish
build for a target environment/platform.

This change distinguishes between util/host-side component builds,
links, and component builds and targets object files destined for
the game (and other target platforms) in the Makefiles.

In theory, this will ease the effort for people that want to try to
resurrect NetHack perhaps on an old platform where it is no longer
viable to build NetHack-3.7 on the platform itself using old, outdated
compile tools, possibly with an old, outdated C dialect.

Some details:

-  Game-related targets in the Makefiles (as opposed to util/host-side
   targets that will be executed on the host), which could be destined
   for another platform in a cross-compile scenario are prefixed with
   $(TARGETPFX) so that they are distinguished.

   The default scenario where no cross-compiler is involved, is to
   define TARGETPFX to nothing, and therefore meant to have no effect.

-  Game-related compile and link commands in the Makefiles and their
   associated command line flags are distinguished from util/host-side
   compile and link commands in the Makefiles by using $(TARGET_CC),
   $(TARGET_CFLAGS), $(TARGET_LINK), $(TARGET_LFLAGS), $(TARGET_CXX),
   $(TARGET_CXXFLAGS), $(TARGET_LIBS).

   Those are used in the Makefile in place of $(CC), $(CFLAGS), $(LINK),
   $(LFLAGS), $(CXX), $(CXXFLAGS), $(LIBS).

   The default scenario where no cross-compiler is involved, defines
   the TARGET_ version of those Makefile variables to match their
   typical non-TARGET_ ounterparts.

-  The dependency lists in the Makefiles includes the $(TARGETPFX)
   prefix for stuff that would potentially be produced from a
   cross-compile build.

-  It adds pregame targets and $(PREGAME) variable, so that hints files
   can add some additional stuff if required for a cross-compile
   scenario.

   The default scenario where no cross-compiler is involved doesn't
   do anything for $(PREGAME).

-  It adds $(BUILDMORE) target and variable, so that hints files
   can add some additional things to be built for a cross-compile
   scenario.

-  It adds a "package" target and $(PACKAGE) variable, so that hints files
   can add steps for the target platform in a cross-compile
   scenario.

   The "install" target assumes local build and placement and
   isn't really applicable to a cross-compile scenario where the results
   really just need to be bundled up for transport to the target platform.

-  Also, this adds a pair of include files that can be updated with some
   cross-compile recipes as they evolve. They are named "cross-pre.2020"
   (for stuff to be included in the PRE section) and "cross-post.2020"
   for stuff to be included in the POST section via sys/unix/setup.sh.

   Those are included in sys/unix/hints/linux.2020 and
   sys/unix/hints/macOS.2020 hints files.
2020-09-28 16:25:31 -04:00
PatR
10d80eb150 Qt's 3.6 status conditions
Replace the blank placeholder icon with individual placeholders
for Stone, Slime, Strngl, Deaf, Lev, Fly, and Ride.  They're just
40x40 tiles showing solid color (different for each) holding white
block letters spelling the condition.  For the first four of those,
the text runs from upper-left to lower-right, for Lev and Fly the
text runs from lower-left towards upper-right, and for Ride it's
horizontal.  Not particularly exciting but better than blank.  We
still need real artwork to make them be similar to the older
conditions.

Also moves the two petmarks and the pilemark from qt_xpms.h to
qt_map.cpp.  The marks and the assorted status icons are all
static arrays, and including that header in two source files
meant that they were all duplicated unless the compiler or linker
was smart enough to discard the unused ones.
2020-09-23 16:40:26 -07:00
Adam Powers
5462072ceb bump version for minor improvements 2020-09-12 12:49:10 -07:00
Adam Powers
1c23434de6 update docs 2020-09-12 12:48:28 -07:00
Adam Powers
176f553b6e remove stray debug message 2020-09-12 12:48:13 -07:00
Adam Powers
d2fdc6f582 add new exports, cleaner debugging options 2020-09-12 12:40:04 -07:00
Adam Powers
34e4b1fae9 js test code 2020-09-12 12:34:45 -07:00
Adam Powers
c602ecc5a2 default is a permenant inventory window 2020-09-12 12:27:29 -07:00