Commit graph

113 commits

Author SHA1 Message Date
59a199c69d Don't put broken links in HTML info pages
Pass the valid info page names to emp2html.pl, and convert only valid
references to links there.
2013-05-12 18:53:02 +02:00
955bdeb223 Fold subj2html.pl into emp2html.pl 2013-05-11 16:04:11 +02:00
fded50a09c Refresh autoconf macros from autoconf-archive-2013.04.06 2013-05-08 14:35:04 +02:00
fad8e7f7b9 Move auxiliary build tools to build-aux/ 2013-05-08 14:35:04 +02:00
890e88d149 Declare subjects instead of picking them up automatically
Since subjects were added in Empire 2, we've always picked them up
from .SA requests.  If you mistype a subject there, you get a "is a
NEW subject" warning, and incorrect subject pages.  When building a
pristine tree, you get bogus "is a NEW subject" warnings for all
subjects.  If you somehow delete the generated subjects.mk, but not
the generated subject files, the build breaks.

Declare subjects in Make variable subjects.  Drop generated makefile
subject.mk.

Treat unknown topics in .SA arguments as errors.  This replaces the
"$subj is a NEW subject" warning.

Treat subjects without member pages as errors.  This replaces the "The
subject $subj has been removed" warning.

Safer and simpler.
2013-05-08 06:57:57 +02:00
cbed134d81 Fix remaking of info subject pages
We used to do all the info indexing work in info.pl: find subjects,
create subjects.mk (to tell make the list of subjects), the subject
pages, and TOP.t.  Worked, but touching an info page triggered a full
rebuild of all subject pages and TOP.t.

Commit 2f14064 (v4.3.0) tried to avoid that by splitting info.pl into
findsubj.pl, mksubj.pl, mktop.pl.  findsubj.pl puts not just the
subjects into subjects.mk, but also make rules for the subject pages,
to guide their remaking.  mksubj.pl creates a single subject page.
mktop.pl creates TOP.t.

Unfortunately, this doesn't work so well.  Since subjects.mk doesn't
exist in a virgin tree, we use -include.  Unwanted consequence:
findsubj.pl failure doesn't stop make.  Moreover, the complex make
machinery breaks down when info sources get removed or subjects get
dropped.

Go back to the old method, except keep mktop.pl separate, as that part
works just fine, and use simpler make rules.  mksubj.pl now creates
subjects.mk and all subject pages, like info.pl did.

This effectively reverts most of commit 2f14064.  I'll address the
excessive rebuilding of subject pages in a different way shortly.
2013-05-08 06:57:57 +02:00
a2338a1db4 Pass subjects instead of subject filenames to info/mktop.pl
mktop.pl doesn't actually use the files, so this is simpler and
clearer.
2013-05-08 06:57:57 +02:00
02a18de4d4 Fix remaking of config.h and config.h.in
Remaking config.h and config.h.in updates the target only when its
contents actually changes.  This is important, because after updating
config.h we need to recompile everything.

The make rules to do that are straight from the Autoconf manual.  But
they don't work: the rules that connect config.h and config.h.in to
stamp-h and stamp-h.in don't have recipes.  Since make doesn't have an
implicit rule either, it concludes that the target remains unchanged.
It still updates the prerequisites.  The recipe for updating the stamp
files then change the the targetes behind make's back.  Make misses
the change of config.h and/or config.h.in, and we get an incomplete
rebuild.

The rules need empty recipes instead.  This Autoconf manual was fixed
accordingly in autoconf.git commit 6b42b38.
2013-05-08 06:57:57 +02:00
ed8eead0ba Add fairland test to make check 2013-05-08 06:55:18 +02:00
4dd0720fc0 Add files test to make check 2013-05-08 06:55:18 +02:00
49b2b13a90 New make target check
Just a smoke test so far, extracted from src/scripts/nightly/.  This
makes the existing smoke test more easily accessible.  Noteworthy
differences:

* Instead of patching the code to make output more stable, postprocess
  the output to normalize it.

* Compare actual results to expected results instead of the previous
  test run's results.

* Much faster.  The old test harness used sleep liberally to "ensure"
  things always happen in the same order.

Known shortcomings:

* The smoke test hangs when the server fails to complete startup, or
  fails to terminate.

* Normalization of xdump hardcodes columns instead of getting them
  from xdump meta.

* Normalization of time values in xdump is an ugly hack.

* xdump meta column type isn't normalized.  Actual values can vary
  between systems, because the width of enumeration types is
  implementation-defined.  The smoke test works only when they're
  represented as int, which is the case on common systems.

* Currently expected to work only with thread package LWP and a
  random() that behaves exactly like the one on my development system,
  because:

  - Thread scheduling is reliably deterministic only with LWP

  - The PRN sequence produced by random() isn't portable

  - Shell builtin kill appears not to do the job in MinGW

  - The Windows server tries to run as service when -d isn't
    specified

Further work is needed to address these shortcomings.

Getting C programs behave exactly the same on all systems is hard.
We'll likely run into system-dependent differences that upset the
smoke test.  Floating-point computation seems particularly vulnerable.

Instead of updating src/scripts/nightly/ to use "make check", retire
it.  It hasn't been used in quite a while.  Investing more into our
homegrown auto-builder doesn't make sense, as canned auto-builders
such as Travis CI and Jenkins are readily available.

The shell scripts src/scripts/nightly/tests/?? become Empire batch
files tests/smoke/.  The shell scripts are actually shell boilerplate
around Empire batch files.  To make sure git recognizes the move, this
commit moves them unchanged.  tests/smoke-test strips the boilerplate
before it feeds the batch files to the client.  The next commit will
get rid fo that.
2013-05-08 06:55:11 +02:00
df4925d696 Update copyright notice 2013-01-12 17:45:01 +01:00
1118f1c0ca Update copyright notice 2012-06-10 10:52:22 +02:00
540526a140 Start the makefile's dependency section with a comment
Just to separate it visually from the preceding section
2012-05-01 18:37:50 +02:00
98cd2a3a70 Update known contributors comments 2011-04-14 20:21:23 +02:00
ffbbfcb25f Use the new path finder for land paths, drop old A*
This gets rid of the memory leak mentioned in the previous commit.

To get rid of the buffer overruns for long paths mentioned in the
previous commit, make BestLandPath() fail when path length exceeds
1023 characters.

assemble_dist_paths() and move_ground() pass buffers with a different
size.  Eliminate assemble_dist_paths()'s buffer.  Update now works
regardless of distribution distance (the distribute command still
limits to 1023, to be fixed in a later commit).  Enlarge
move_ground()'s buffers.  Doubles the length of paths accepted by
explore, move, and transport.

I use two test cases to benchmark the path finders: "continental" (Hvy
Metal 2 updates) and "island" (Hvy Plastic 2 updates).

The new path finder runs my tests around 3-4 times faster than the old
A* without its caches.  That's enough to meet its cached performance
for "island", but it's only half as fast for "continental".  Not for
long; big speedups are coming.
2011-04-12 21:48:58 +02:00
7e2008e7f4 License upgrade to GPL version 3 or later
Why upgrade?  I'm not a lawyer, but here's my take on the differences
to version 2:

* Software patents: better protection against abuse of patents to
  prevent users from exercising the rights under the GPL.  I doubt
  we'll get hit with a patent suit, but it's a good move just on
  general principles.

* License compatibility: compatible with more free licenses, i.e. can
  "steal" more free software for use in Empire.  I don't expect to steal
  much, but it's nice to have the option.

* Definition of "source code": modernization of some details for today's
  networked world, to make it easier to distribute the software.  Not
  really relevant to us now, as we normally distribute full source code.

* Tivoization: this is about putting GPL-licensed software in hardware,
  then make the hardware refuse to run modified software.  "Neat" trick
  to effectively deny its users their rights under the GPL.  Abuse was
  "pioneered" by TiVo (popular digital video recorders).  GPLv3 forbids
  it.  Unlikely to become a problem for us.

* Internationalization: more careful wording, to harden the license
  outside the US.  The lawyers tell us it better be done that way.

* License violations: friendlier way to deal with license violations.
  This has come out of past experience enforcing the GPL.

* Additional permissions: Probably not relevant to us.

Also include myself in the list of principal authors.
2011-04-12 21:20:58 +02:00
37589489c6 Fix make clean to remove info.ps
Missed in commit 9067d7a4.
2011-01-09 15:27:26 +01:00
f9d6149db3 Update link to `Recursive Make Considered Harmful' 2010-02-13 21:04:01 +01:00
e93cc9934e Less verbose make output
Many commands, compiler invocations in particular, are rather long,
and warnings tend to get lost in the noise.  Suppress the command
details.  Run make with a V=1 parameter for full output.
2010-02-13 18:48:31 +01:00
73e25ff21e Update copyright notice 2010-01-19 08:40:17 +01:00
4d40a27542 Use src/lib/w32/w32sockets.c for client
Move client's w32_connect() to w32sockets.c.

Replace w32_recv() and w32_send() by read() and write().

Replace w32_close() by w32_close_function.

Replace call of WSAStartup() in w32_sysdep_init() by
w32_socket_init().

Remove the identical copies of fd_is_socket(),
w32_set_winsock_errno(), w32_socket().
2009-12-05 15:19:36 +01:00
1153d9c995 Use src/lib/w32/w32io.c for client
Replaces w32_writev_socket() and w32_readv_fd().  Split w32types.h off
w32misc.h, to avoid putting irrelevant stuff into client tarball.
2009-12-05 15:19:34 +01:00
c8231b120b Revert "MinGW provides random() in -liberty, no need to replace it"
This reverts commit 3ec807e99a.

Our nightly build test cases rely on the PRN sequence generated by GNU
libc's random().  We used to have such a PRNG in our tree (derived
from an old version of GNU libc's), for use under Windows.  Thus we
got the same PRN sequence on both our nightly test systems.  Commit
3ec807e9 switched to -liberty under Windows and removed our random().
Now we got a different sequence there, breaking the test cases.

Test cases still don't work on non-Windows systems where random()
doesn't match GNU libc's.  We should switch to a PRNG that produces
the same sequence everywhere.

Conflicts:

	src/lib/w32/w32misc.h
2009-12-05 15:09:19 +01:00
3ec807e99a MinGW provides random() in -liberty, no need to replace it 2009-11-30 19:45:28 +01:00
b8fccf7324 MinGW provides getopt(), no need to replace it 2009-11-30 19:45:28 +01:00
4c6deb1f98 Move Windows socket stuff out off posixio.c into w32sockets.c
This is so we can avoid linking utilities with socket libraries (see
commit 8b778634).

When using sockets, we need to replace close(), because Windows'
close() can't cope with socket file descriptors.  But replacing it
always would pull in the socket stuff again.  Define close() to call
function pointer w32_close_function, which is initially _close.
Rename posix_close() to w32_close_maybe_socket().  Make new
w32_socket_init() put it in w32_close_function.

Same for read() and write(): define read(), write() to call function
pointers w32_read_function, w32_write_function, initially _read(),
_write(); rename posix_read(), posix_write() to
w32_read_maybe_socket(), w32_write_maybe_socket(), and put them into
w32_read_function, w32_write_function in w32_socket_init().

Also call WSAStartup() there, and use that from loc_NTInit().
WSACleanup() now belongs next to w32_socket_init().  Don't bother,
just drop it, along with loc_NTTerm().
2009-11-30 19:45:27 +01:00
a977bd08f6 Rename m4/my_termlib.m4 to m4/my_terminfo.m4 2009-04-25 13:57:45 +02:00
cf4cb6c907 Fix generation of src/client/aclocal.m4
Revert commit c3d2786f, because the resulting aclocal.m4 includes
stuff from outside the standalone build.  Generate with cat instead.
2009-04-25 10:14:42 +02:00
8b7786340e Clean up autoconfiguration of libraries
Make configure compute three sets of libraries: LIBS_client for the
client, LIBS_server for the server, and LIBS for the rest.  This
replaces termlibs.

Unfortunately, LIBS doesn't work with Windows, because
src/lib/w32/posixio.c pulls in socket stuff.  Temporary workaround:
use LIBS_server instead.
2009-04-13 12:55:15 +02:00
c3d2786f1a Remake src/client/aclocal.m4 with aclocal instead of cp 2009-04-12 18:32:24 +02:00
2fb427b676 Fix distclean to remove generated files distributed in client tarball 2009-03-10 13:08:15 +01:00
ee20a9cd34 Update known contributors comments 2009-02-18 21:11:33 +01:00
dd8921218b Fix make dist in a separate build directory without git, really
Make didn't remake sources.mk even though it was a phony target.  I
don't understand why.  But we can just as well create it in its only
user, dist-source.
2009-02-17 23:00:07 +01:00
35ef345ecb Update copyright notice 2009-02-08 09:33:18 +01:00
e597257438 Fix make dist in a separate build directory without git
In that case, make copied the sources.mk from $srcdir, but unless it
existed already, the peculiar workings of VPATH did us in: make
searched for the target, found it in $srcdir, and the dependency
became circular.

Fix by keeping sources.mk in $srcdir always.  We can build it there,
because its contents depends only on git state, not on anything in the
build tree.  This avoids the need to copy sources.mk alltogether.
2008-12-07 18:14:46 -05:00
b4ecf7c7a6 Use 'git ls-files' instead of deprecated 'git-ls-files' 2008-12-02 21:26:32 -05:00
0d48dae06b Explicitly specify dependency output file with gcc -MF
Used to work without that, but somehow no longer does.
2008-10-28 19:27:23 -04:00
d702068457 Fix trailing whitespace 2008-09-17 21:31:40 -04:00
d72f9936db Fix remaking of sources.mk with git
Broken since commit 35db407d, v.4.3.12.  v4.3.14 and v4.3.15 were
distributed with a stale sources.mk in the tarball.  The latter does
not build out of the box because of that.
2008-07-25 08:34:35 -04:00
231947e41a Fix make distclean to remove generated sources.mk 2008-03-14 20:25:44 +01:00
0dd6702df1 Update known contributors comments 2008-03-14 20:25:44 +01:00
7ec0f0c0d0 New utility program empdump
empdump exports and imports game state as plain text.  Limitations: it
currently can't export player bmaps, power report, telegrams,
announcements, message of the day, no-login message and log files.
Exported floating-point values may be inexact.  Importing an exported
game state may not result in identical data files; besides the loss of
floating-point precision just mentioned, coordinates are normalized,
and characters beyond a string's terminating zero in a character array
are lost.  Bug: importing resets timestamps to zero.  It should set
them to the current time.
2008-03-14 20:25:42 +01:00
b3c5ba2f75 Tighten gcc warning options
Suppress only unused parameters, not all unused stuff.
2008-03-14 20:25:38 +01:00
adbcdf4335 Clean up dependencies after failed compile
If gcc's preprocessor chokes, it leaves an empty dependency file
behind, and doesn't touch the object file.  If an old object file
exists, and is newer than the .c file, make will then consider the
object file up-to-date.  This can lead to nasty version errors.
2008-03-14 20:25:09 +01:00
77e95bd788 Clean up library dependencies
Move stuff to untangle the ugly cyclic dependencies between the
archives built for selected subdirectories of src/lib/:

* Move common/io.c to empthread/ because it requires empthread stuff

* Move parts of subs/nstr.c to common/nstreval.c to satisfy
  common/ef_verify.o

* Move getstarg.c getstring.c onearg.c from gen/ to subs/ because they
  require stuff from there

* Move bridgefall.c check.c damage.c empobj.c journal.c maps.c
  sectdamage.c from common/ to subs/ because they require stuff from
  there

* Move cnumb.c from subs/ to common/ to satisfy common/type.o

* Move log.c fsize.c from common/ to gen/ because they really belong
  there

* Move emp_config.c mapdist.c from gen/ to common/ because they really
  belong there, and require stuff from libglobal.a

Also package as/ as libas.a to satisfy common/path.o.

Remaining dependencies:

    lib             needs
    --------------------------------------------
    libas.a         libglobal.a
    libcommon.a     libas.a libglobal.a libgen.a
    libgen.a
    libglobal.a
    liblwp.a        libgen.a
    libw32.a[*]     libgen.a

    [*] Except for service.o, which can only be linked into the server

Link order now: liblwp.a libcommon.a libas.a libgen.a libglobal.a
libw32.a.  The position of libw32.a is not quite right, but works
anyway.
2008-02-03 08:11:13 +01:00
db02dda32f Update copyright notice 2008-01-19 10:15:37 +01:00
35db407da0 Convert the build process from CVS to git
Detect .git instead of CVS.  Use git-ls-files with git, else
$(srcdir)/sources.mk.  info/findsubj.pl now gets the info files as
arguments rather than from sources.mk.

Remaking info subjects doesn't quite work, but it was broken similarly
before.
2008-01-13 11:17:26 +01:00
13a465edca Fix the previous revision. 2007-12-22 07:57:07 +00:00
Ron Koenderink
f082ef9fa6 (w32_getpw, w32_socket, w32_connect, w32_recv, w32_send,
w32_writev_socket, w32_close_socket, getpass, w32_openfd,
w32_openhandle, w32_readv_handle, w32_close_handle,
sysdep_init, sysdep_stdin_init, w32_select, w32_signal_handler,
sigaction, stdin_read_thread, w32_ring_from_file_to_bounce_buf)
[_WIN32]: New w32 equivalent functions for POSIX functions.
(recvline, sendcmd, tcp_connect, hostconnect, getpass,
main, intr, play, ring_to_file, ring_from_file, doexecute,
doredir) [_WIN32]: Use new WIN32 equivalent functions.
(main) [_WIN32]: Add sysdep_init() to support system dependent
initialization for equivalence functions.
(play) [_WIN32]: Add sysdef_stdin_init() to support system
dependent initialization for reading stdin.
(recv_input, play) [_WIN32]: Replace the calls to ring_to_file()
and select() with WIN32 specific enhanced versions.

Makefile.in: update dependencies with new files.
Make.mk: Add using of getopt.c and getopt.h
from src/lib/w32 directory.  Add getopt.c and getopt.h
to tar for client.
2007-12-11 22:00:25 +00:00