Compare commits

...
Sign in to create a new pull request.

94 commits

Author SHA1 Message Date
7e63185007 commands: Rename the command functions
Command functions are traditionally named like the command shortened
to four characters.  When this name collides with a keyword or library
function, we abbreviate more: brea(), rea().  A few are unabbreviated,
e.g.  execute().  A few have different names, e.g. explain(), not
list().

Commit 23726b379 (v4.3.0) suppressed a GCC warning about carg()
colliding with its built-in function.

Ron Koenderink reported Microsoft Visual Studio 2019 fails to link:
"_carg already defined in ucrtd.lib(ucrtbased.dll)".

Time to clean this up: rename the functions to c_FOO(), where FOO is
the unabbreviated name of the command.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-18 06:16:26 +01:00
af143ac597 info/Empire4.4: Update change log for 4.4.1
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-17 21:24:29 +01:00
20986a480e buy: Fix bogus error when lot gets reused at the last prompt
When the lot being bid for goes away and gets reused while the player
is at the prompt for the destination sector, comm.com_amount gets
stale.  We use it before we detect the change and fail the command
This can lead to a misleading ""You don't have that much to spend!"
error.  Messed up when the code was fixed to deal with lot changes in
4.0.2.

Fix by checking for lot change earlier.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-17 21:24:29 +01:00
6a30258d31 buy: Don't continue when lot changes while asking for bid
When the lot being bid for changes while the player is at the "How
much" prompt, we report "Commodity #%d has changed!", and continue
with the changed lot.

If continuing is okay, we should keep quiet.  We did that until commit
40b11c098 "Fix buy not to wipe out concurrent updates", v4.3.27.  Okay
when only the lot's price changed.

However, the lot could have gone away, or even be reused for something
else.  Failing the command seems safest for the player, so do that.
It's how we use the check_FOO_ok() elsewhere.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-17 21:24:29 +01:00
37af1d7eb9 work: Don't let embarked engineers work
Engineers can work even when loaded on a ship or land unit.  They
happily raise sea sector efficiency.  That's just wrong.  It's
questionable even on land, because unloading need not be possible.
Has been that way since the command was added in Empire 2.

Add the missing check.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-17 21:24:29 +01:00
589bc1ed1a neweff production work: Fix crash for sea sector
The work required for building sea sectors is zero in sect.config.
When a deity runs neweff or production on a sea sector, e.g. with
"neweff *", buildeff() divides by zero.  Same when a player or deity
runs work with an engineer in a sea sector.  Broken in commit
2ffd7b948 "config: Make work to build sectors configurable", v4.4.0

Fix buildeff() to avoid the division.  Change the required work to 100
in sect.config for good measure.

Cover deity use of neweff and production in tests/update.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-17 21:24:29 +01:00
88bd68b88b config: Increase mountain process efficiency from 75% to 100%
Each point of gold resource is worth 5d.  Except for mountains, where
it's just 3.75d.  This is because a mountain's process efficiency is
only 75%.  Has been that way since Empire 3 made mountains mine gold.

This is actually a needless complication: a sector with 75% process
efficiency produces just like one with 100% process efficiency and 75%
of the resource.

Increase mountain process efficiency to 100%.  Deities may want to
compensate by adjusting mountains' gold resources.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-17 21:24:29 +01:00
9b84153038 config: Make product work independently configurable
The work required for a product is traditionally the amount of raw
materials, plus 1 for resource usage, or 1 if using neither.  Make it
independently configurable instead, via new product selector bwork,
backed by new struct pchrstr member p_bwork.  Keep the required work
exactly the same in the default configuration.

Clients that compute work from materials need to be updated.  Easy,
since build work is now exposed in xdump.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-17 21:24:29 +01:00
d7a9593f35 tests/version: Cover show product and show news
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-17 21:24:29 +01:00
301656771b update: Give a few helpers internal linkage
External use of prod_materials_cost(), prod_resource_limit() went away
in commit 4a714a37d "production: Use update code instead of
duplicating it", v4.4.0.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-17 21:24:29 +01:00
70542a0cb5 info/power: Fix commodity power formula
Messed up in commit 1307a3be6 "show: Extend show item to show the
power value", v4.4.0.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-17 21:24:29 +01:00
0adf2e890e info/Products: Don't call sector p.e. "level p.e."
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-17 21:24:29 +01:00
e5ea07b61a arm: Rework "cannot carry nukes" test for robustness
We reject satellites, ABMs, anti-ship missiles, and SAMs.  That's
enumerating badness.  More robust replacement: accept only bomber,
tactical, cargo, except for anti-ship missiles.

Throw in PLN_LAUNCHED sanity checking while there.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-17 21:24:29 +01:00
0d6130246c ef_verify: Reject invalid plane flag combinations
Any plane may have capabilities VTOL, helo, light.

Capability missile requires VTOL.

Anti-ballistic missiles have capabilities missile, SDI.

Anti-satellite missiles have capabilities missile, satellite.

Surface-to-air missiles have capabilities missile, intercept.

Anti-ship missiles have capabilities missile, marine, and may have
tactical.

Surface-to-surface missiles have capability missile, and may have
tactical.

Satellites have capability satellite, and may have spy, image.

Ordinary planes may have capabilities bomber, tactical, intercept,
cargo, spy, image, ASW, para, escort, mine, sweep.  Capability para
requires cargo; see para().

Only "missile requires VTOL" is enforced.  Enforce the rest.

Excluding P_O when asking for P_N is now redundant.  Drop that from
msl_abm_intercept().

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-17 21:24:29 +01:00
0d53d1a6e9 launch interception: Drop support for ABM, a-sat consuming shells
Their impact on the target does not depend on shell load (it sometimes
did for a-sats until commit cf960a573 "Make anti-sat launch consistent
with interception", v4.3.23).  The shell use is logistical busy-work,
and economically irrelevant.  Remove it.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-17 21:24:29 +01:00
10060390f5 config: Change asat not to consume shells
The asat's impact on the target does not depend on its shell load (it
sometimes did until commit cf960a573 "Make anti-sat launch consistent
with interception", v4.3.23).  The shell use is logistical busy-work,
and economically irrelevant.  Remove it.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-17 21:24:29 +01:00
a677cc31d7 mission: Don't permit marine missiles on support missions
Marine missiles can't actually support, see perform_mission().  Make
the mission command reject them.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-17 21:24:29 +01:00
8a65621275 mission: Fix an error message pasto going back to Chainsaw 3
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-17 21:24:29 +01:00
6f3f78481d mission: Don't permit SAMs on escort missions
The mission code doesn't treat SAMs specially: they take off, fly out,
maybe fight, fly home, and land.  Landing triggers the oops in
pln_put1().

Letting SAMs escort makes no sense.  Fix the mission command to reject
them.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-17 21:24:29 +01:00
1c7d9a67f6 info/Plane-types: Document SAM, ABM and a-sat missile abilities
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-17 21:24:29 +01:00
9dfe007701 info: Clean up references to long-gone options
Option DEFENSE_INFRA was replaced in commit 4d1dd6fa6, v4.3.6.  Point
to the replacement instead.

Options SHIPCHOPPERS and XLIGHT were made non-optional in Empire 2.
Don't mention them.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-17 21:24:29 +01:00
75e9b97ba0 retreat: Drop unused parameter @code
Unused since commit beedf8dce "retreat: Rewrite automatic retreat code
to fix its many bugs", v4.3.33.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-17 21:24:29 +01:00
16f0a07725 lwp: Include signal.h instead of ucontext.h where possible
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-17 21:24:29 +01:00
eb0721507e subs/attsub: Drop a stale comment
Stale since commit 6ac9ad66e (v4.3.20) silently dropped dead code for
supply of military.  Dead since commit 689f435af (v4.2.14) dropped
option GRAB_THINGS.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-17 21:24:29 +01:00
e5bccdd52e assault attack board lboard paradrop: Fix defending land unit supply
get_dlist() collects defending land units in a list, and resupplies
them.  Bug: it uses a local copy instead of the one in the list.  When
att_fight() writes back the list, the commodities supplied get wiped
out, triggering a seqno oops.  Broken in commit 62b9399cd "subs:
Factor lnd_insque() out of lnd_sel(), ask_olist(), ...", v4.3.33.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-17 21:24:29 +01:00
8fc2c0ffa2 Update copyright notice
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-17 21:24:29 +01:00
1e64ece1f5 Drop macros AGREE_FREE, AGREE_PROPOSED, AGREE_SIGNED
Commit 555de3100 (v4.3.0) added these macros so xdump tables loan and
treaty can share an agreement_statuses table.  Treaties are gone since
commit a109de948 (v4.3.33).  Drop the macros.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-17 21:24:29 +01:00
5ed11ffd57 doc/coding: Improve section "Portability" a bit
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-17 21:24:29 +01:00
259200777e include: Move sarg.c stuff to nsc.h to avoid incomplete enum
Portability issue: prototypes.h uses enum ns_seltype, defined in
nsc.h.  GCC is fine with that; it supports incomplete enum types as an
extension.  Broken in commit 157ae8ec2 "Clean up superfluous include
of nsc.h in prototypes.h", v4.3.27.  Moving sarg.c stuff to nsc.h
fixes it.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-17 21:24:29 +01:00
528d644f02 common/pathfind: A more portable DPRINTF()
C99 requires at least one argument for the "..." in a variadic macro.
GCC and Clang don't care, but warn with -pedantic.  Solaris cc warns.

The warning is easy to avoid, so do it.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-17 21:24:29 +01:00
e18d1dc589 configure: Move terminfo check next to readline check
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-17 21:24:28 +01:00
e23d0f6259 m4/my_lib_readline: Fix check for additional libraries
MY_LIB_READLINE tries each readline-compatible library with a sequence
of additional libraries, starting with none.  If the check with none
fails, all the others checks reuse the cached result, and also fail.
Broken in commit 1cbda2c7d "client: Rewrite readline configuration",
v4.4.0.

Avoid the unwanted chaching.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-17 21:24:28 +01:00
882379f883 Make: Use SHELL to run test scripts, since /bin/sh may suck
The test scripts need a POSIX-compliant Bourne shell.  /bin/sh isn't
on some systems, such as Solaris.  Run them with $(SHELL).

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-17 21:24:28 +01:00
3f0718885a Make: Get SHELL from Autoconf
The default SHELL isn't POSIX on some systems, such as Solaris.  Use
the one Autoconf chooses instead of the default.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-17 21:24:28 +01:00
f3c1edf8d2 Make: Slighly less verbose "make check" output
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-17 21:24:28 +01:00
1a10b41ae8 info/Empire4.3: Work around "nroff: Out of temp file space"
Solaris 10's nroff can't deal with the lengthy .NF ... .FI: it
complains, writes truncated output, and terminates
successfully (*boggle*).  Split the .NF ... .FI in two.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-17 21:24:28 +01:00
13362acc46 configure: Test GCC-specific compiler flags only when using GCC
Commit 23373d01d "configure: Test compiler flags" (v4.4.0) made
configure test whether compiler flags work, to let us use flags that
work only for some compilers.

Unfortunately, the Sun C compiler accepts invalid options with a
warning, breaking the test.  Observed on Solaris 10.

Fix by testing the compiler flags only when AC_PROG_CC detected GCC.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-17 21:24:28 +01:00
6cff488537 bomb: Pass NULL instead of 0 to pln_damage()
Neglected in commit 820d755e5 "subs: Change pln_damage()'s parameter
noisy to string prefix", v4.3.33.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-17 21:24:28 +01:00
e312e4f8d6 bomb launch interdiction: Fix crash on bombs missing target
plane damage() prints @noisy with snprintf() even when it's null.  It
doesn't actually use the output then.  Some systems (GNU, Windows)
deal gracefully with printing null strings, others crash.  @noisy is
null when bombers or missiles miss and do collateral damage.  Affects
bomb, launch, and interdiction missions.  Broken in commit 820d755e5
"subs: Change pln_damage()'s parameter noisy to string prefix",
v4.3.33.

Fix by guarding the snprintf().

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-17 21:24:28 +01:00
77d3da4f09 Clarify build requirements
Document the need for the XSI Extension.  Don't list curses as
required, it's actually optional.  Correct advice for Solaris.  Add
advice for AIX.  Drop references to C89; we actually require C99, and
POSIX.1-2001 provides it.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-17 21:24:28 +01:00
deee99a01d Fix build for systems that don't provide POSIX.1-2001 by default
We require POSIX.1-2001.  Some systems provide it only with feature
test macro _POSIX_C_SOURCE defined to 200112L.  Since we don't define
it, the build fails there.  Observed on Solaris 10.

We actually require the XSI extension.  The GNU C Library provides it
by default.  With _POSIX_C_SOURCE 200112L, however, you have to define
feature test macro _XOPEN_SOURCE to get it.  But then _POSIX_C_SOURCE
is redundant.

Make configure put #define _XOPEN_SOURCE 600 into config.h.  Drop the
two existing #define _XOPEN_SOURCE 500 in .c files.

Now Solaris cc refuses to play ball unless switched to C99.  Replace
AC_PROG_CC by AC_PROG_CC_STDC to mollify it.

Unfortunately, use of _XOPEN_SOURCE exposes bugs in AIX libc and old
versions of GNU libc:

* AIX defines struct in6_addr's member s6_addr as a macro expanding
  into the actual member.  Without _ALL_SOURCE (the default), the
  expansion is wrong and doesn't compile.  Observed with AIX V7.2.

* GNU lib's IN6_IS_ADDR_V4MAPPED() is unusable without
  _DEFAULT_SOURCE (default) or _GNU_SOURCE.  Observed with Debian 8.
  Tracked at <https://sourceware.org/bugzilla/show_bug.cgi?id=16421>,
  fixed in version 2.25.

Affects just sockaddr_ntop()'s special case from commit 372cdb136 "Use
IPv4 format for IPv4-mapped addresses", v4.3.31.  Disable the special
case and use IPv6 format on such systems.  This is a very minor
usability regression.  Could be avoided, I guess, but it's not worth
the trouble.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-17 21:24:28 +01:00
ab93877534 client: Drop use of getpass()
getpass() is traditional Unix, but has been withdrawn from POSIX.  We
still use it when it's available, and fall back to portable code only
when it's not.

The portable code behaves differently: it reads stdin instead of
/dev/tty, and in noncanonical mode.

Simplify things: always use the replacement.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-17 21:24:28 +01:00
53b2271d1d client: Make get_password() not echo with POSIX && !HAVE_GETPASS
getpass() is traditional Unix, but has been withdrawn from POSIX.  We
provide a replacement in case it's missing.  The one for Windows
suppresses echo, like getpass() does.  Implement that for POSIX.  The
other differences to getpass() remain.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-17 21:24:28 +01:00
ea762c1f08 client: Factor set_echo_if_tty() out of get_password()
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-17 21:24:28 +01:00
e551b6198d client: Move get_password() from login.c to getpass.c
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-17 21:24:28 +01:00
f98747ae0e client: New get_password()
I'm going to drop use of getpass().  As a first step, weaken the bond
by hiding it in a separate function.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-17 21:24:28 +01:00
057ca5b340 client: Reorder misc.h, and point to the .c
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-17 21:24:28 +01:00
8a04586048 lwp: Simplify lwpSigWait() interface
lwpSigWait() was designed to resemble sigwait().  It doesn't anymore.
Drop the awkward argument, and use the return value instead.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-17 21:24:28 +01:00
d89bda9998 lwp: Rename two variables for clarity
Rename LwpSigCaught to LwpPendingSig, and lwpCatchAwaitedSig() to
lwpHandleAwaitedSig().

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-17 21:24:28 +01:00
8a1d9fbb4b lwp: Rewrite signal wait code for portability and safety
LWP's use of sigset_t is problematic.

To iterate over a sigset_t, it uses NSIG, which is not portable: BSD
and System V provide it, but it's not POSIX.

To record signals caught, it updates a sigset_t variable from a signal
handler.  The variable isn't volatile, because we'd have to cast away
volatile for sigaddset().

Replace sigset_t by an array of signal numbers terminated with 0.

Since lwpInitSigWait() needs to store the signal set for
lwpCatchAwaitedSig() anyway, there is no need to pass it to
lwpSigWait().  Drop its parameter.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-17 21:24:28 +01:00
bfb558dee3 lwp: Fix signal wait screwup for multiple different signals
lwpSigWait() clears LwpSigCheck even when signals remain in
LwpSigCaught.  The next empth_wait_for_signal() will then wait until
another one gets caught.  Broken in commit fe2de3d74, v4.3.10.

Fix by clearing it only when LwpSigCaught is empty.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-17 21:24:28 +01:00
7481482656 lwp: Fix handling of sigismember() failure
sigismember() fails when passed an invalid or unsupported signal
number.  lwpInitSigWait() and lwpGetSig() treat sigismember() failure
like "is a member".  lwpInitSigWait() will then sigaction()
unsuccessfully.  Harmless.  lwpGetSig() returns the bad signal number
when it's greater than any caught signal's number.  The bad signal
number then gets returned to main(), which shuts down the server.

Fix by treating failure like "is not a member".

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-17 21:24:28 +01:00
5315db952d lwp: Fix unsafe update of LwpSigCaught
lwpCatchAwaitedSig() is not reentrant.  lwpInitSigWait() attempts to
protect it by setting an appropriate signal mask, but screws up.  This
could conceivably lose signals.  Messed up when it got added in commit
7183516d9, v4.3.6.  Fix it.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-17 21:24:28 +01:00
85ad194648 lwp: Drop inappropriate oops in lwpSigWait()
lwpSigWait()'s contract specifies failure, which means oopsing is
wrong.  Harmless, as its only caller empth_wait_for_signal() oopses on
failure.  Drop it anyway.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-17 21:24:28 +01:00
1ebee96036 info: Use S_ISREG() instead of S_IFREG for readability
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-17 21:24:28 +01:00
e91b4e3b6e info: Add #include <strings.h> for portability
We get strncasecmp() from <string.h>.  This is a BSDism; POSIX
provides it in <strings.h>.  Missed in commit 8fdd0259f2, v4.2.19.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-17 21:24:28 +01:00
c3eb998396 Make: Fix build with tool chains that require depcomp
Commit fad8e7f7b "Move auxiliary build tools to build-aux/" moved
depcomp, but neglected to adjust Make.mk.  This broke the build with
tool chains that actually use depcomp.  Modern GCC and Clang don't.
Fix the obvious way.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-17 21:24:28 +01:00
f06473fbb4 build-aux/git-version-gen: Refresh from Gnulib commit 4f78c231f4
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-17 21:24:28 +01:00
d5ce86dfc8 build-aux INSTALL: Refresh from automake 1.16.3
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-17 21:24:28 +01:00
5a828769de m4: Refresh macros from autoconf-archive commit fd1d25c148
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-17 21:24:28 +01:00
ada4678128 config: Enlarge configuration tables that have variable size
Configuration tables product, sect-chr, ship-chr, plane-chr, land-chr,
nuke-chr have a bit of extra space deities can use for customizing
their games.  Give them more: enlarge product from 23 to 31
entries (plus one sentinel), sect-chr from 39 to 63, ship-chr from 47
to 127, plane-chr from 47 to 127, land-chr from 31 to 127, and
nuke-chr from 20 to 63.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-17 21:24:28 +01:00
e379edc648 config: Drop configuration table size macros
Macros LND_TYPE_MAX, N_MAXNUKE, PLN_TYPE_MAX, P_MAX, SCT_TYPE_MAX,
SHP_TYPE_MAX are only used to size a single array each.  Eliminate.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-17 21:24:28 +01:00
a374e6435d Avoid SCT_TYPE_MAX, use ARRAY_SIZE() instead
The next commit will get rid of SCT_TYPE_MAX.  Prepare.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-17 21:24:28 +01:00
5e45859979 New macro ARRAY_SIZE()
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-17 21:24:28 +01:00
50d84c025b econfig: Fix documentation of key assault_penalty
Messed up when keys got documented in 4.2.0.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-17 21:24:28 +01:00
46ab8b59e6 info/Empire4.4: Fix more 4.4.0 change log entry typos
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-17 21:24:28 +01:00
56ce1eaada fairland: Tidy up comments
Don't use ALL CAPS for headings.  Reformat them in the style
recommended by doc/coding.  Drop a few comments that aren't pulling
their weight, and fix the odd typo.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-17 21:24:28 +01:00
ae85142a68 fairland: Rename fl_move() to drift_capital()
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-17 21:24:28 +01:00
200059b65b fairland: Move qprint() and NUMTRIES
qprint() was carelessly added at the end of the file in Empire 2,
where it's under the "Write a script for placing capitals" headline.
Move it to a more sensible place.

NUMTRIES was added behind the global variables in Empire 2.  Move it
before them, and reformat its comment.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-17 21:24:28 +01:00
d8db5b7308 fairland: Fuse capx[], capy[] into cap[]
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-17 21:24:28 +01:00
9c9e0ff8d5 fairland: Fuse sectx[], secty[] into sect[]
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-17 21:24:28 +01:00
4413a8e1b2 fairland: Simplify how write_sect() iterates over sectors
Iterating over IDs is slightly simpler than iterating over
coordinates, so do that.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-17 21:24:28 +01:00
7039ef6767 fairland: Represent sector ownership more efficiently
Replace own[x][y] by own[XYOFFSET(x, y)], and narrow the element type
from int to short.  Takes a fourth the space.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-17 21:24:28 +01:00
8a40b6b15c fairland: Tweak rural iron, fert, oil for simplicity
The previous commit's interpolation tables reproduce the historical
linear functions faithfully.  This exact fit requires an awkward data
point in each of the tables for iron fertility and oil.  Drop them.

No double-valued data points remain.  Adjust struct resource_point
member @res to int.

This results in slightly less rural iron (33 elevations down one
point), fertility (10 elevations down one point) and oil (14
elevations down one point, 5 down two points).  Only resource values
less than 100 are affected.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-17 21:24:28 +01:00
5b5e2cdfa8 fairland: Compute resources by interpolating tables
The functions mapping elevation to resources are piecewise linear.
Replace them by linear interpolation on data points defined in tables.
Tables are easier to tweak for deities than code.

The data points are a bit awkward because the functions they replace
are.  The next commit will tweak them to address that.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-17 21:24:28 +01:00
39ef156f00 fairland: Tweak sea oil & mountain gold for simplicity
The functions mapping elevation to resources are piecewise linear,
except for set_oil(), which randomly adds 1 to sea oil, and
set_gold(), which is isn't linear for mountains, but very close.

Drop the random oil bit, and replace the non-liner gold function by a
linear one.  Both resources decrease at most by one point.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-17 21:24:28 +01:00
fdd55428c3 fairland: Rewrite complicated, buggy & boring elevation code
Land elevation is computed by first placing mountains, then elevating
land to fit.

Mountains placement is a weighted random sampling.  A sector's weight
is its distance to sea capped at five and squared.

Non-mountain, non-capital sectors get assigned equidistant elevations
from 1 up to 97 rounded to integer in an order that depends on
distance to mountain and distance to sea, both capped at 5.  Mountains
get equidistant elevations starting at 98 (see recent commit
"fairland: Fair mountain resources").  Capitals get 36.

Sea elevation is randomly chosen from a range that depends on the
sector's distance to land.  The range increases from [-27,-1] next to
land to [-127,-1] for distance 5 and up.

Without mountains, the result is boring: elevation increases pretty
much linearly with the distance from the coast, i.e. each islands is a
single cone.  With mountains, we get one cone per mountain.  The sea
sea elevations are basically noise.

Worse, it's buggy: mountain placement can place fewer mountains than
requested.  The weighted random sampling assigns weights even to
sectors that cannot be picked (capitals and sectors that have been
picked already).  When the dice land on such a sector, it instead
picks the next one (in island growth order) that can be picked.  If
there is no next one, the mountain is not placed.  This is a fairness
issue.

Impact varies with fairland parameters.  For 60 sector islands with 5%
mountains, around one in 10000 islands is short one mountain in my
testing.  For 10 sector islands with 50% mountains, some 760 out of
10000 islands are short one sector, 80 short two, and five short
three.  The numbers get worse as spikiness increases.

Undocumented misfeature: the placement loop is limited to 1000
iterations, supposedly to catch a runaway loop.  Since the loop
iterates exactly once per mountain, all this accomplishes it limiting
mountains to 1000 per island.

When too few mountains are placed, the loop assigning elevations to
non-mountain, non-capital decrements elevations below 1.  Since
Chainsaw 3, such elevations then get mapped to 1, plastering over the
bug.  We get non-mountain sectors with elevation 1 instead of
mountains.

Rewrite as follows.

Use a simple random hill algorithm to assign raw elevations:
initialize elevation to zero, then randomly raise circular hills on
land / lower circular depressions at sea.  Their size and height
depends on the distance to the coast, capped at 3.  After a sufficient
number of iterations, the resulting terrain has a "natural" look.
This is elevate_prep().

elevate_land() then sorts non-capital sectors by raw elevation.  The
highest become mountains.  Sectors get assigned the same equidistant
elevations as before, just in raw elevation order.

elevate_sea() simply normalizes raw elevation to [-127,-1].

Elevations now show a nice undulating pattern independent of mountain
percentage.

Implementation detail: replace elev[x][y] by elev[XYOFFSET(x, y)], and
narrow the element type from int to short.  Takes a fourth the space.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-17 21:24:28 +01:00
2105ed3fa1 fairland: Tweak rural elevations for simplicity
elevate_land() computes the sequence of elevations 97, 97 - delta,
... in fixed point with a scaling factor of 100.  Switch to
floating-point, because it's simpler.  Elevations (and thus resources)
change slightly due to reduced rounding errors.

Note that we map elevations less than 1 to 1 both before and after the
patch.  Odd.  Turns out this mitigates a bug: mountain placement can
place fewer mountains than it should, and when that happens,
elevations go below 1 here.  The next commit will fix this.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-17 21:24:28 +01:00
7a3af61016 fairland: Drop unused elevation band for coastal mountains
Elevations 34 and 35 are reserved for coastal mountains.  When an
elevation computed for a non-mountain falls in that band, it's
adjusted to 36.

This is unnecessary since the previous commit; drop.  Test output
shows the dropped elevation adjustment.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-17 21:24:28 +01:00
7502a2c4c9 fairland: Fair mountain resources
For fairness, fairland aims to make islands of the same size consist
of the exact same sectors, just individually arranged.

It fails to achieve its aim for mountains: their elevation is random,
34 or 35 for coastal mountains, and between 98 and 254 (two dice) for
non-coastal ones.  Elevation determines resources.  Mountains get 89
gold on average (between 80 and 93), except for coastal mountains,
which get none.  It didn't really matter until Empire 3 made mountains
produce gold dust.  Since then, it's unfair.

Set mountain elevation to 98 + i * delta, where i is the mountain
number (starting at zero), delta is (127 - 98) / max_mn, and max_mn is
the maximum number of mountains an island could have.  This puts the
highest mountains on the largest islands.

Non-coastal mountains have slightly less gold than before, coastal
mountains have much more.

Mountains can still be unfair, because fairland can screw up their
number.  To be fixed soon.

Avoid elevations 34 and 35 for non-mountain, non-capital sectors
doesn't make sense anymore.  The next commit will get rid of it.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-17 21:24:28 +01:00
fd64db89d2 fairland: Use zero elevation for "not yet elevated"
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-17 21:24:28 +01:00
54782fb4c1 fairland: Eliminate sectc[][], use adj_land[] instead
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-17 21:24:28 +01:00
51bf9f7822 fairland: Replace distance_to_land(), distance_to_sea()
distance_to_land() searches for closest land sector, and
distance_to_sea() for the closest sea sector.  We already have a more
efficient alternative: the breadth-first search recently added for
spheres of influence can precompute these distances.  Put it to use,
and retire distance_to_land() and distance_to_sea().

distance_to_what() could now be simplified.  Don't bother, because
it'll soon be deleted entirely.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-17 21:24:28 +01:00
60a89a83c7 fairland: Eliminate macro ELEV, it's an abomination
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-17 21:24:28 +01:00
fe86ea430a fairland: Prefer placing islands away from the edge of the sphere
When an island gets placed too close to the edge of the sphere of
influence, its side facing the edge will likely be formed by the edge.
Looks unnatural, and can give a clue on the location of the other
continent.

Make place_island() prefer sectors away from the edge: instead of
picking one of the admissible sectors with equal probability, reduce
the probability as we get closer to the edge.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-17 21:24:28 +01:00
4fca4dfddd fairland: Try harder to deliver the requested amount of land
Planned island sizes are random with an expected value that matches
the average size requested by the user.  Can be off quite a bit when
the number of islands is small.  Also, actual island size can be
smaller than planned size when space is tight.

Instead of picking random island sizes independently, pick a random
split of their requested total size.

To reduce the probability of islands not growing to their planned
size, grow large islands before smaller ones.

To compensate for inability to grow, carry the difference over to the
next island size.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-17 21:24:28 +01:00
08ca6ace12 fairland: Make actual island sizes fair
The previous commit reduced the difference in island size within the
same batch of islands to at most one.  Eliminate the remaining
difference by shrinking the bigger islands by one sector.

This invalidates the precomputed exclusive zones, so recompute them.

fairland-test needs a tweak to avoid loss of test coverage.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-05 10:41:37 +01:00
212c7ddcef fairland: Grow islands interleaved
The previous commits changed grow_island() to create islands in
batches consisting of one island per continent, all of the same
planned size.  grow_island() still places and grows one island after
the other.  When an island can't grow to the actual size, the others
in the same batch are not affected.  Island size can therefore differ
a lot within the same batch.

Change grow_island() to interleave the work on a batch's island: first
place them all, then add one sector to each in turn.  Stop after all
reached the planned size, or one or more could not be grown further.

This is similar to how we grow continents: drift() places them all,
and grow_continent() adds one sector to each continent in turn.

Island size within the same batch can now differ at most by one
sector.  The next commit will eliminate that remaining difference.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-05 10:41:36 +01:00
ca110e55ed fairland: Make planned island sizes fair
The previous two commits put the same number of islands closest to
each continent.  This one makes their planned sizes match: instead of
rolling dice separately for each island's size, we roll dice only for
the first continent's islands.  The other continent's islands get the
same sizes.

Actual island sizes still differ when islands can't be grown to their
planned size.  To be addressed next.

fairland-test needs a tweak to avoid loss of test coverage.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-05 10:41:36 +01:00
18687315ac fairland: Fail when island can't be placed, for fairness
The previous commit made island distribution more fair by placing
islands close to a continent in turn.  This is still unfair when
fairland can't place all the islands.

Make grow_islands() fail when it can't place all islands, and main()
start over then, just like it does when grow_continents() fails.

Deities can no longer fill the world with islands by asking for a
impossibly high number of islands.  Tolerable loss, I think.

fairland-test needs a tweak to avoid loss of test coverage.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-05 10:41:36 +01:00
74bc8adb63 fairland: Distribute islands more fairly among continents
fairland places islands of random size in random places, subject to
minimum distances.  Results are often less than fair, in particular
when the number of islands per continent is low: some continents have
more land nearby than others.  Increasing distances between islands
doesn't help much.  Deities commonly run fairland until they find the
result acceptable.

The next few commits will tackle this issue.  As a first step, this
one places islands closest to continents in turn, so that each
continent is closest to the same number of islands.  A continent is
closest to an island when it is closest to each of its sectors.

The number of islands must be a multiple of the number of continents
now.

Since fairland may be unable to place all islands, a continent may
still get fewer islands than it should.  The next commit will address
that.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-05 10:41:36 +01:00
446005f84c fairland: Compute spheres of influence
A continent's sphere of influence is the set of sectors closer to it
than to any other continent.  The next commit needs this.  Compute the
spheres with a breadth-first search.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-05 10:41:36 +01:00
5a13bef8e2 fairland: Eliminate dirx[], diry[]
dirx[] and diry[] are redundant with diroff[][].  Convert the
remaining uses, and drop the arrays.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-05 10:41:36 +01:00
73c103e9df fairland: Fix island growth and correct its bias
grow_one_sector() picks a coastal start sector, then moves along the
coast trying to add an adjacent sector to the island.

It operates in spiking mode with a chance of @sp percent.

When spiking, the neighbors with sea on both sides are preferred.  For
instance, when the area around the sector being considered looks like
this

     - .
    - - .
     - .

then the neighbor in direction j is preferred, because it has sea in
directions u and n.  No other neighbor is preferred.

The start sector is the first coastal sector found in a linear search
in growth order, starting at the last sector grown when spiking, or
else at a random sector.  This is new_try().

grow_one_sector() tries adding a neighbor in clockwise order, starting
with a random direction.  When spiking, it goes around the clock two
times, trying only preferred sectors in the first round.

When it can't add a neighbor, it moves to the next coastal sector with
next_coast().

Taken together, this randomly picks one element from the set of
pairs (S, D) where the sector in direction D off base sector S can be
added to the island.  How does the probability distribution look like?

Bias: a sector's probability to be added to the island land increases
with the number of base sectors it is adjacent to.  This tends to fill
in bays and lakes, which is fine.

Bias: coastal sectors following runs of non-coastal ones are more
likely to be picked as start sector.  Perhaps less of an issue when
spiking, where the pick is not intended to be random.

Bias: a pair (S, D) is more likely to be picked when base sector S
follows a run of coastal sectors that aren't base sectors, or
direction D follows a a run of directions that don't permit growth.

The impact of these two biases is not obvious.  I suspect they are the
reason behind the tendency of large islands to curve around obstacles
in a counterclockwise direction.  This can result in multiple islands
wrapping around a central one like layers of an onion.

Bug: the move along the coast is broken.  next_coast() searches for
the first adjacent sea in clockwise order, starting in direction g,
then from there clockwise for a sector belonging to the island.
Amazingly, this does move along the coast in a clockwise direction.
It can get caught in a loop, though.  Consider this island:

        -
     - - -
      -

If we start at the central sector (marked 0), the search along the
coast progresses like this:

        1
     - 0 2
      -

It reaches the central sector again after three moves (to 1, to 2,
back to 0), and stops without having reached the two sectors on the
left.

If we start with the leftmost sector, the search loops: 0, 1, 2, 3, 1,
...

        2
     0 1 3
      -

grow_one_sector() ensures termination by giving up after 200 moves.
Nuts!

Because of this, grow_one_sector() can fail when it shouldn't, either
because the search along the coast stops early, or goes into a loop,
or simply because there's too much coast.  The latter should not
happen in common usage, where island sizes are in the tens, not the
hundreds.

Clean up this hot mess by rewriting grow_one_sector() to pick a sector
adjacent to the island with a clearly defined probability, as follows.

Use weighted random sampling to pick one sector from the set of
possible adjacent sectors.

When spiking, a sector's weight increases with number of adjacent sea
sectors.  This directs the growth away from land, resulting in spikes.

When not spiking, the weight increases with the number of adjacent
land sectors.  This makes the island more rounded.

To visit the adjacent sectors, grow_one_sector() iterates over the
neighbors of all island sectors, skipping neighbors that have been
visited already.

This produces comparable results for low spike percentages.  The weird
onions are gone, though.

Noticeable differences emerge as the spike percentage grows.  Whereas
the old one produces long snakes that tend to curve into themselves,
the new one produces shorter spikes extending from a core, a bit like
tentacles.  Moreover, islands are more centered on their first sector
now.  The probability for coastal capitals is lower, in particular for
moderate spike percentages.

I consider this improvements.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-05 10:41:36 +01:00
478 changed files with 11003 additions and 8539 deletions

View file

@ -1,6 +1,6 @@
#
# Empire - A multi-player, client/server Internet based war game.
# Copyright (C) 1986-2020, Dave Pare, Jeff Bailey, Thomas Ruschak,
# Copyright (C) 1986-2021, Dave Pare, Jeff Bailey, Thomas Ruschak,
# Ken Stevens, Steve McClure, Markus Armbruster
#
# Empire is free software: you can redistribute it and/or modify
@ -28,7 +28,7 @@
# GNUmakefile.in: Makefile template for configure
#
# Known contributors to this file:
# Markus Armbruster, 2005-2009
# Markus Armbruster, 2005-2020
#
# The real meat is in Make.mk, which see.
@ -68,6 +68,7 @@ INSTALL_DATA := @INSTALL_DATA@
INSTALL_PROGRAM := @INSTALL_PROGRAM@
NROFF := @NROFF@
RANLIB := @RANLIB@
SHELL := @SHELL@
prefix := @prefix@
exec_prefix := @exec_prefix@

318
INSTALL
View file

@ -1,8 +1,8 @@
Installation Instructions
*************************
Copyright (C) 1994-1996, 1999-2002, 2004-2013 Free Software Foundation,
Inc.
Copyright (C) 1994-1996, 1999-2002, 2004-2016 Free Software
Foundation, Inc.
Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
@ -12,97 +12,96 @@ without warranty of any kind.
Basic Installation
==================
Briefly, the shell commands `./configure; make; make install' should
configure, build, and install this package. The following
more-detailed instructions are generic; see the `README' file for
Briefly, the shell command './configure && make && make install'
should configure, build, and install this package. The following
more-detailed instructions are generic; see the 'README' file for
instructions specific to this package. Some packages provide this
`INSTALL' file but do not implement all of the features documented
'INSTALL' file but do not implement all of the features documented
below. The lack of an optional feature in a given package is not
necessarily a bug. More recommendations for GNU packages can be found
in *note Makefile Conventions: (standards)Makefile Conventions.
The `configure' shell script attempts to guess correct values for
The 'configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation. It uses
those values to create a `Makefile' in each directory of the package.
It may also create one or more `.h' files containing system-dependent
definitions. Finally, it creates a shell script `config.status' that
those values to create a 'Makefile' in each directory of the package.
It may also create one or more '.h' files containing system-dependent
definitions. Finally, it creates a shell script 'config.status' that
you can run in the future to recreate the current configuration, and a
file `config.log' containing compiler output (useful mainly for
debugging `configure').
file 'config.log' containing compiler output (useful mainly for
debugging 'configure').
It can also use an optional file (typically called `config.cache'
and enabled with `--cache-file=config.cache' or simply `-C') that saves
the results of its tests to speed up reconfiguring. Caching is
disabled by default to prevent problems with accidental use of stale
cache files.
It can also use an optional file (typically called 'config.cache' and
enabled with '--cache-file=config.cache' or simply '-C') that saves the
results of its tests to speed up reconfiguring. Caching is disabled by
default to prevent problems with accidental use of stale cache files.
If you need to do unusual things to compile the package, please try
to figure out how `configure' could check whether to do them, and mail
diffs or instructions to the address given in the `README' so they can
to figure out how 'configure' could check whether to do them, and mail
diffs or instructions to the address given in the 'README' so they can
be considered for the next release. If you are using the cache, and at
some point `config.cache' contains results you don't want to keep, you
some point 'config.cache' contains results you don't want to keep, you
may remove or edit it.
The file `configure.ac' (or `configure.in') is used to create
`configure' by a program called `autoconf'. You need `configure.ac' if
you want to change it or regenerate `configure' using a newer version
of `autoconf'.
The file 'configure.ac' (or 'configure.in') is used to create
'configure' by a program called 'autoconf'. You need 'configure.ac' if
you want to change it or regenerate 'configure' using a newer version of
'autoconf'.
The simplest way to compile this package is:
1. `cd' to the directory containing the package's source code and type
`./configure' to configure the package for your system.
1. 'cd' to the directory containing the package's source code and type
'./configure' to configure the package for your system.
Running `configure' might take a while. While running, it prints
Running 'configure' might take a while. While running, it prints
some messages telling which features it is checking for.
2. Type `make' to compile the package.
2. Type 'make' to compile the package.
3. Optionally, type `make check' to run any self-tests that come with
3. Optionally, type 'make check' to run any self-tests that come with
the package, generally using the just-built uninstalled binaries.
4. Type `make install' to install the programs and any data files and
4. Type 'make install' to install the programs and any data files and
documentation. When installing into a prefix owned by root, it is
recommended that the package be configured and built as a regular
user, and only the `make install' phase executed with root
user, and only the 'make install' phase executed with root
privileges.
5. Optionally, type `make installcheck' to repeat any self-tests, but
5. Optionally, type 'make installcheck' to repeat any self-tests, but
this time using the binaries in their final installed location.
This target does not install anything. Running this target as a
regular user, particularly if the prior `make install' required
regular user, particularly if the prior 'make install' required
root privileges, verifies that the installation completed
correctly.
6. You can remove the program binaries and object files from the
source code directory by typing `make clean'. To also remove the
files that `configure' created (so you can compile the package for
a different kind of computer), type `make distclean'. There is
also a `make maintainer-clean' target, but that is intended mainly
source code directory by typing 'make clean'. To also remove the
files that 'configure' created (so you can compile the package for
a different kind of computer), type 'make distclean'. There is
also a 'make maintainer-clean' target, but that is intended mainly
for the package's developers. If you use it, you may have to get
all sorts of other programs in order to regenerate files that came
with the distribution.
7. Often, you can also type `make uninstall' to remove the installed
7. Often, you can also type 'make uninstall' to remove the installed
files again. In practice, not all packages have tested that
uninstallation works correctly, even though it is required by the
GNU Coding Standards.
8. Some packages, particularly those that use Automake, provide `make
8. Some packages, particularly those that use Automake, provide 'make
distcheck', which can by used by developers to test that all other
targets like `make install' and `make uninstall' work correctly.
targets like 'make install' and 'make uninstall' work correctly.
This target is generally not run by end users.
Compilers and Options
=====================
Some systems require unusual options for compilation or linking that
the `configure' script does not know about. Run `./configure --help'
the 'configure' script does not know about. Run './configure --help'
for details on some of the pertinent environment variables.
You can give `configure' initial values for configuration parameters
by setting variables in the command line or in the environment. Here
is an example:
You can give 'configure' initial values for configuration parameters
by setting variables in the command line or in the environment. Here is
an example:
./configure CC=c99 CFLAGS=-g LIBS=-lposix
@ -113,21 +112,21 @@ Compiling For Multiple Architectures
You can compile the package for more than one kind of computer at the
same time, by placing the object files for each architecture in their
own directory. To do this, you can use GNU `make'. `cd' to the
own directory. To do this, you can use GNU 'make'. 'cd' to the
directory where you want the object files and executables to go and run
the `configure' script. `configure' automatically checks for the
source code in the directory that `configure' is in and in `..'. This
is known as a "VPATH" build.
the 'configure' script. 'configure' automatically checks for the source
code in the directory that 'configure' is in and in '..'. This is known
as a "VPATH" build.
With a non-GNU `make', it is safer to compile the package for one
With a non-GNU 'make', it is safer to compile the package for one
architecture at a time in the source code directory. After you have
installed the package for one architecture, use `make distclean' before
installed the package for one architecture, use 'make distclean' before
reconfiguring for another architecture.
On MacOS X 10.5 and later systems, you can create libraries and
executables that work on multiple system types--known as "fat" or
"universal" binaries--by specifying multiple `-arch' options to the
compiler but only a single `-arch' option to the preprocessor. Like
"universal" binaries--by specifying multiple '-arch' options to the
compiler but only a single '-arch' option to the preprocessor. Like
this:
./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
@ -136,105 +135,104 @@ this:
This is not guaranteed to produce working output in all cases, you
may have to build one architecture at a time and combine the results
using the `lipo' tool if you have problems.
using the 'lipo' tool if you have problems.
Installation Names
==================
By default, `make install' installs the package's commands under
`/usr/local/bin', include files under `/usr/local/include', etc. You
can specify an installation prefix other than `/usr/local' by giving
`configure' the option `--prefix=PREFIX', where PREFIX must be an
By default, 'make install' installs the package's commands under
'/usr/local/bin', include files under '/usr/local/include', etc. You
can specify an installation prefix other than '/usr/local' by giving
'configure' the option '--prefix=PREFIX', where PREFIX must be an
absolute file name.
You can specify separate installation prefixes for
architecture-specific files and architecture-independent files. If you
pass the option `--exec-prefix=PREFIX' to `configure', the package uses
pass the option '--exec-prefix=PREFIX' to 'configure', the package uses
PREFIX as the prefix for installing programs and libraries.
Documentation and other data files still use the regular prefix.
In addition, if you use an unusual directory layout you can give
options like `--bindir=DIR' to specify different values for particular
kinds of files. Run `configure --help' for a list of the directories
you can set and what kinds of files go in them. In general, the
default for these options is expressed in terms of `${prefix}', so that
specifying just `--prefix' will affect all of the other directory
options like '--bindir=DIR' to specify different values for particular
kinds of files. Run 'configure --help' for a list of the directories
you can set and what kinds of files go in them. In general, the default
for these options is expressed in terms of '${prefix}', so that
specifying just '--prefix' will affect all of the other directory
specifications that were not explicitly provided.
The most portable way to affect installation locations is to pass the
correct locations to `configure'; however, many packages provide one or
correct locations to 'configure'; however, many packages provide one or
both of the following shortcuts of passing variable assignments to the
`make install' command line to change installation locations without
'make install' command line to change installation locations without
having to reconfigure or recompile.
The first method involves providing an override variable for each
affected directory. For example, `make install
affected directory. For example, 'make install
prefix=/alternate/directory' will choose an alternate location for all
directory configuration variables that were expressed in terms of
`${prefix}'. Any directories that were specified during `configure',
but not in terms of `${prefix}', must each be overridden at install
time for the entire installation to be relocated. The approach of
makefile variable overrides for each directory variable is required by
the GNU Coding Standards, and ideally causes no recompilation.
However, some platforms have known limitations with the semantics of
shared libraries that end up requiring recompilation when using this
method, particularly noticeable in packages that use GNU Libtool.
'${prefix}'. Any directories that were specified during 'configure',
but not in terms of '${prefix}', must each be overridden at install time
for the entire installation to be relocated. The approach of makefile
variable overrides for each directory variable is required by the GNU
Coding Standards, and ideally causes no recompilation. However, some
platforms have known limitations with the semantics of shared libraries
that end up requiring recompilation when using this method, particularly
noticeable in packages that use GNU Libtool.
The second method involves providing the `DESTDIR' variable. For
example, `make install DESTDIR=/alternate/directory' will prepend
`/alternate/directory' before all installation names. The approach of
`DESTDIR' overrides is not required by the GNU Coding Standards, and
The second method involves providing the 'DESTDIR' variable. For
example, 'make install DESTDIR=/alternate/directory' will prepend
'/alternate/directory' before all installation names. The approach of
'DESTDIR' overrides is not required by the GNU Coding Standards, and
does not work on platforms that have drive letters. On the other hand,
it does better at avoiding recompilation issues, and works well even
when some directory options were not specified in terms of `${prefix}'
at `configure' time.
when some directory options were not specified in terms of '${prefix}'
at 'configure' time.
Optional Features
=================
If the package supports it, you can cause programs to be installed
with an extra prefix or suffix on their names by giving `configure' the
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
with an extra prefix or suffix on their names by giving 'configure' the
option '--program-prefix=PREFIX' or '--program-suffix=SUFFIX'.
Some packages pay attention to `--enable-FEATURE' options to
`configure', where FEATURE indicates an optional part of the package.
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
is something like `gnu-as' or `x' (for the X Window System). The
`README' should mention any `--enable-' and `--with-' options that the
Some packages pay attention to '--enable-FEATURE' options to
'configure', where FEATURE indicates an optional part of the package.
They may also pay attention to '--with-PACKAGE' options, where PACKAGE
is something like 'gnu-as' or 'x' (for the X Window System). The
'README' should mention any '--enable-' and '--with-' options that the
package recognizes.
For packages that use the X Window System, `configure' can usually
For packages that use the X Window System, 'configure' can usually
find the X include and library files automatically, but if it doesn't,
you can use the `configure' options `--x-includes=DIR' and
`--x-libraries=DIR' to specify their locations.
you can use the 'configure' options '--x-includes=DIR' and
'--x-libraries=DIR' to specify their locations.
Some packages offer the ability to configure how verbose the
execution of `make' will be. For these packages, running `./configure
execution of 'make' will be. For these packages, running './configure
--enable-silent-rules' sets the default to minimal output, which can be
overridden with `make V=1'; while running `./configure
overridden with 'make V=1'; while running './configure
--disable-silent-rules' sets the default to verbose, which can be
overridden with `make V=0'.
overridden with 'make V=0'.
Particular systems
==================
On HP-UX, the default C compiler is not ANSI C compatible. If GNU
CC is not installed, it is recommended to use the following options in
On HP-UX, the default C compiler is not ANSI C compatible. If GNU CC
is not installed, it is recommended to use the following options in
order to use an ANSI C compiler:
./configure CC="cc -Ae -D_XOPEN_SOURCE=500"
and if that doesn't work, install pre-built binaries of GCC for HP-UX.
HP-UX `make' updates targets which have the same time stamps as
their prerequisites, which makes it generally unusable when shipped
generated files such as `configure' are involved. Use GNU `make'
instead.
HP-UX 'make' updates targets which have the same time stamps as their
prerequisites, which makes it generally unusable when shipped generated
files such as 'configure' are involved. Use GNU 'make' instead.
On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
parse its `<wchar.h>' header file. The option `-nodtk' can be used as
a workaround. If GNU CC is not installed, it is therefore recommended
to try
parse its '<wchar.h>' header file. The option '-nodtk' can be used as a
workaround. If GNU CC is not installed, it is therefore recommended to
try
./configure CC="cc"
@ -242,26 +240,26 @@ and if that doesn't work, try
./configure CC="cc -nodtk"
On Solaris, don't put `/usr/ucb' early in your `PATH'. This
On Solaris, don't put '/usr/ucb' early in your 'PATH'. This
directory contains several dysfunctional programs; working variants of
these programs are available in `/usr/bin'. So, if you need `/usr/ucb'
in your `PATH', put it _after_ `/usr/bin'.
these programs are available in '/usr/bin'. So, if you need '/usr/ucb'
in your 'PATH', put it _after_ '/usr/bin'.
On Haiku, software installed for all users goes in `/boot/common',
not `/usr/local'. It is recommended to use the following options:
On Haiku, software installed for all users goes in '/boot/common',
not '/usr/local'. It is recommended to use the following options:
./configure --prefix=/boot/common
Specifying the System Type
==========================
There may be some features `configure' cannot figure out
There may be some features 'configure' cannot figure out
automatically, but needs to determine by the type of machine the package
will run on. Usually, assuming the package is built to be run on the
_same_ architectures, `configure' can figure that out, but if it prints
_same_ architectures, 'configure' can figure that out, but if it prints
a message saying it cannot guess the machine type, give it the
`--build=TYPE' option. TYPE can either be a short name for the system
type, such as `sun4', or a canonical name which has the form:
'--build=TYPE' option. TYPE can either be a short name for the system
type, such as 'sun4', or a canonical name which has the form:
CPU-COMPANY-SYSTEM
@ -270,101 +268,101 @@ where SYSTEM can have one of these forms:
OS
KERNEL-OS
See the file `config.sub' for the possible values of each field. If
`config.sub' isn't included in this package, then this package doesn't
See the file 'config.sub' for the possible values of each field. If
'config.sub' isn't included in this package, then this package doesn't
need to know the machine type.
If you are _building_ compiler tools for cross-compiling, you should
use the option `--target=TYPE' to select the type of system they will
use the option '--target=TYPE' to select the type of system they will
produce code for.
If you want to _use_ a cross compiler, that generates code for a
platform different from the build platform, you should specify the
"host" platform (i.e., that on which the generated programs will
eventually be run) with `--host=TYPE'.
eventually be run) with '--host=TYPE'.
Sharing Defaults
================
If you want to set default values for `configure' scripts to share,
you can create a site shell script called `config.site' that gives
default values for variables like `CC', `cache_file', and `prefix'.
`configure' looks for `PREFIX/share/config.site' if it exists, then
`PREFIX/etc/config.site' if it exists. Or, you can set the
`CONFIG_SITE' environment variable to the location of the site script.
A warning: not all `configure' scripts look for a site script.
If you want to set default values for 'configure' scripts to share,
you can create a site shell script called 'config.site' that gives
default values for variables like 'CC', 'cache_file', and 'prefix'.
'configure' looks for 'PREFIX/share/config.site' if it exists, then
'PREFIX/etc/config.site' if it exists. Or, you can set the
'CONFIG_SITE' environment variable to the location of the site script.
A warning: not all 'configure' scripts look for a site script.
Defining Variables
==================
Variables not defined in a site shell script can be set in the
environment passed to `configure'. However, some packages may run
environment passed to 'configure'. However, some packages may run
configure again during the build, and the customized values of these
variables may be lost. In order to avoid this problem, you should set
them in the `configure' command line, using `VAR=value'. For example:
them in the 'configure' command line, using 'VAR=value'. For example:
./configure CC=/usr/local2/bin/gcc
causes the specified `gcc' to be used as the C compiler (unless it is
causes the specified 'gcc' to be used as the C compiler (unless it is
overridden in the site shell script).
Unfortunately, this technique does not work for `CONFIG_SHELL' due to
an Autoconf limitation. Until the limitation is lifted, you can use
this workaround:
Unfortunately, this technique does not work for 'CONFIG_SHELL' due to an
Autoconf limitation. Until the limitation is lifted, you can use this
workaround:
CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash
`configure' Invocation
'configure' Invocation
======================
`configure' recognizes the following options to control how it
'configure' recognizes the following options to control how it
operates.
`--help'
`-h'
Print a summary of all of the options to `configure', and exit.
'--help'
'-h'
Print a summary of all of the options to 'configure', and exit.
`--help=short'
`--help=recursive'
'--help=short'
'--help=recursive'
Print a summary of the options unique to this package's
`configure', and exit. The `short' variant lists options used
only in the top level, while the `recursive' variant lists options
also present in any nested packages.
'configure', and exit. The 'short' variant lists options used only
in the top level, while the 'recursive' variant lists options also
present in any nested packages.
`--version'
`-V'
Print the version of Autoconf used to generate the `configure'
'--version'
'-V'
Print the version of Autoconf used to generate the 'configure'
script, and exit.
`--cache-file=FILE'
'--cache-file=FILE'
Enable the cache: use and save the results of the tests in FILE,
traditionally `config.cache'. FILE defaults to `/dev/null' to
traditionally 'config.cache'. FILE defaults to '/dev/null' to
disable caching.
`--config-cache'
`-C'
Alias for `--cache-file=config.cache'.
'--config-cache'
'-C'
Alias for '--cache-file=config.cache'.
`--quiet'
`--silent'
`-q'
'--quiet'
'--silent'
'-q'
Do not print messages saying which checks are being made. To
suppress all normal output, redirect it to `/dev/null' (any error
suppress all normal output, redirect it to '/dev/null' (any error
messages will still be shown).
`--srcdir=DIR'
'--srcdir=DIR'
Look for the package's source code in directory DIR. Usually
`configure' can determine that directory automatically.
'configure' can determine that directory automatically.
`--prefix=DIR'
Use DIR as the installation prefix. *note Installation Names::
for more details, including other options available for fine-tuning
the installation locations.
'--prefix=DIR'
Use DIR as the installation prefix. *note Installation Names:: for
more details, including other options available for fine-tuning the
installation locations.
`--no-create'
`-n'
'--no-create'
'-n'
Run the configure checks, but stop before creating any output
files.
`configure' also accepts some other, not widely useful, options. Run
`configure --help' for more details.
'configure' also accepts some other, not widely useful, options. Run
'configure --help' for more details.

63
Make.mk
View file

@ -1,6 +1,6 @@
#
# Empire - A multi-player, client/server Internet based war game.
# Copyright (C) 1986-2020, Dave Pare, Jeff Bailey, Thomas Ruschak,
# Copyright (C) 1986-2021, Dave Pare, Jeff Bailey, Thomas Ruschak,
# Ken Stevens, Steve McClure, Markus Armbruster
#
# Empire is free software: you can redistribute it and/or modify
@ -27,7 +27,7 @@
# Make.mk: The real Makefile, included by GNUmakefile
#
# Known contributors to this file:
# Markus Armbruster, 2005-2017
# Markus Armbruster, 2005-2020
#
# This makefile was inspired by `Recursive Make Considered Harmful',
@ -72,7 +72,7 @@ include $(srcdir)/info/subjects.mk
topics := $(patsubst %.t,%,$(notdir $(tsrc)))
info := $(topics) $(subjects) all TOP
scripts := $(srcdir)/src/scripts
depcomp := $(SHELL) $(srcdir)/depcomp
depcomp := $(SHELL) $(srcdir)/build-aux/depcomp
tarball := $(SHELL) -e $(scripts)/tarball
econfig := $(sysconfdir)/empire/econfig
schedule := $(sysconfdir)/empire/schedule
@ -97,6 +97,11 @@ else
quiet-command = @echo $2 && $1
endif
# Helper for running tests
# Usage: $(call run-test, SHELL-SCRIPT)
# Recursively expanded, or else parameters don't work
run-test = $(call quiet-command, $(SHELL) -e $1 $(srcdir), TEST $1)
# How to substitute Autoconf output variables
# Recursively expanded so that $@ and $< work.
subst.in = sed \
@ -253,35 +258,35 @@ check: export EMPIRE_CHECK_ACCEPT :=
check-accept: export EMPIRE_CHECK_ACCEPT := y
_check: all
@echo "Warning: test suite is immature and needs work." >&2
$(srcdir)/tests/files-test $(srcdir)
$(srcdir)/tests/fairland-test $(srcdir)
$(srcdir)/tests/info-test $(srcdir)
$(call run-test, $(srcdir)/tests/files-test)
$(call run-test, $(srcdir)/tests/fairland-test)
$(call run-test, $(srcdir)/tests/info-test)
ifeq ($(empthread),LWP)
$(srcdir)/tests/smoke-test $(srcdir)
$(srcdir)/tests/actofgod-test $(srcdir)
$(srcdir)/tests/build-test $(srcdir)
$(srcdir)/tests/load-tend-test $(srcdir)
$(srcdir)/tests/navi-march-test $(srcdir)
$(srcdir)/tests/fire-test $(srcdir)
$(srcdir)/tests/torpedo-test $(srcdir)
$(srcdir)/tests/bridgefall-test $(srcdir)
$(srcdir)/tests/retreat-test $(srcdir)
$(srcdir)/tests/update-test $(srcdir)
$(srcdir)/tests/version-test $(srcdir)
$(call run-test, $(srcdir)/tests/smoke-test)
$(call run-test, $(srcdir)/tests/actofgod-test)
$(call run-test, $(srcdir)/tests/build-test)
$(call run-test, $(srcdir)/tests/load-tend-test)
$(call run-test, $(srcdir)/tests/navi-march-test)
$(call run-test, $(srcdir)/tests/fire-test)
$(call run-test, $(srcdir)/tests/torpedo-test)
$(call run-test, $(srcdir)/tests/bridgefall-test)
$(call run-test, $(srcdir)/tests/retreat-test)
$(call run-test, $(srcdir)/tests/update-test)
$(call run-test, $(srcdir)/tests/version-test)
else
@echo "$(srcdir)/tests/smoke-test SKIPPED"
@echo "$(srcdir)/tests/actofgod-test SKIPPED"
@echo "$(srcdir)/tests/build-test SKIPPED"
@echo "$(srcdir)/tests/load-tend-test SKIPPED"
@echo "$(srcdir)/tests/navi-march-test SKIPPED"
@echo "$(srcdir)/tests/fire-test SKIPPED"
@echo "$(srcdir)/tests/torpedo-test SKIPPED"
@echo "$(srcdir)/tests/bridgefall-test SKIPPED"
@echo "$(srcdir)/tests/retreat-test SKIPPED"
@echo "$(srcdir)/tests/update-test SKIPPED"
@echo "$(srcdir)/tests/version-test SKIPPED"
@echo "TEST $(srcdir)/tests/smoke-test SKIPPED"
@echo "TEST $(srcdir)/tests/actofgod-test SKIPPED"
@echo "TEST $(srcdir)/tests/build-test SKIPPED"
@echo "TEST $(srcdir)/tests/load-tend-test SKIPPED"
@echo "TEST $(srcdir)/tests/navi-march-test SKIPPED"
@echo "TEST $(srcdir)/tests/fire-test SKIPPED"
@echo "TEST $(srcdir)/tests/torpedo-test SKIPPED"
@echo "TEST $(srcdir)/tests/bridgefall-test SKIPPED"
@echo "TEST $(srcdir)/tests/retreat-test SKIPPED"
@echo "TEST $(srcdir)/tests/update-test SKIPPED"
@echo "TEST $(srcdir)/tests/version-test SKIPPED"
endif
$(srcdir)/tests/empdump-test $(srcdir)
$(call run-test, $(srcdir)/tests/empdump-test)
### Implicit rules

18
README
View file

@ -1,7 +1,7 @@
Welcome to Empire 4, code-named Wolfpack.
Empire is a multi-player, client/server Internet based war game.
Copyright (C) 1986-2020, Dave Pare, Jeff Bailey, Thomas Ruschak,
Copyright (C) 1986-2021, Dave Pare, Jeff Bailey, Thomas Ruschak,
Ken Stevens, Steve McClure, Markus Armbruster
This program is free software: you can redistribute it and/or modify
@ -26,8 +26,9 @@ To build the server and set up a game, follow the steps below.
(2) Building a server
Prerequisites: IEEE Std 1003.1-2001 (POSIX.1-2001), GNU make, a
curses library, Perl, and either nroff or GNU troff (`groff').
Prerequisites: IEEE Std 1003.1-2001 (POSIX.1-2001) with the X/Open
System Interfaces Extension, GNU make, Perl, and either nroff or
GNU troff (`groff').
See file `INSTALL' for detailed compilation and installation
instructions. Quick guide for the impatient: run configure; make;
@ -48,9 +49,14 @@ To build the server and set up a game, follow the steps below.
GNU make. Some systems have it installed as `gmake'.
Solaris supports POSIX.1-2001, but you need to set up your
environment for that. Try passing
SHELL=/usr/xpg4/bin/sh PATH=/usr/xpg6/bin:/usr/xpg4/bin:$PATH
to make. See standards(5) for details.
environment for that. Try
SHELL=/usr/xpg4/bin/sh
PATH=/usr/xpg6/bin:/usr/xpg4/bin:/usr/ccs/bin:$PATH
See standards(5) for details.
Likewise, AIX needs XPG_SUS_ENV=ON.
(3) Creating a game

View file

@ -1,9 +1,9 @@
#! /bin/sh
# Wrapper for compilers which do not understand '-c -o'.
scriptversion=2012-10-14.11; # UTC
scriptversion=2018-03-07.03; # UTC
# Copyright (C) 1999-2014 Free Software Foundation, Inc.
# Copyright (C) 1999-2020 Free Software Foundation, Inc.
# Written by Tom Tromey <tromey@cygnus.com>.
#
# This program is free software; you can redistribute it and/or modify
@ -17,7 +17,7 @@ scriptversion=2012-10-14.11; # UTC
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
@ -53,7 +53,7 @@ func_file_conv ()
MINGW*)
file_conv=mingw
;;
CYGWIN*)
CYGWIN* | MSYS*)
file_conv=cygwin
;;
*)
@ -67,7 +67,7 @@ func_file_conv ()
mingw/*)
file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
;;
cygwin/*)
cygwin/* | msys/*)
file=`cygpath -m "$file" || echo "$file"`
;;
wine/*)
@ -255,7 +255,8 @@ EOF
echo "compile $scriptversion"
exit $?
;;
cl | *[/\\]cl | cl.exe | *[/\\]cl.exe )
cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \
icl | *[/\\]icl | icl.exe | *[/\\]icl.exe )
func_cl_wrapper "$@" # Doesn't return...
;;
esac
@ -339,9 +340,9 @@ exit $ret
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC"
# End:

1091
build-aux/config.guess vendored

File diff suppressed because it is too large Load diff

2930
build-aux/config.sub vendored

File diff suppressed because it is too large Load diff

View file

@ -1,9 +1,9 @@
#! /bin/sh
# depcomp - compile a program generating dependencies as side-effects
scriptversion=2013-05-30.07; # UTC
scriptversion=2018-03-07.03; # UTC
# Copyright (C) 1999-2014 Free Software Foundation, Inc.
# Copyright (C) 1999-2020 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -16,7 +16,7 @@ scriptversion=2013-05-30.07; # UTC
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
@ -783,9 +783,9 @@ exit 0
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC"
# End:

View file

@ -1,8 +1,8 @@
#!/bin/sh
# Print a version string.
scriptversion=2017-08-07.06; # UTC
scriptversion=2019-10-13.15; # UTC
# Copyright (C) 2007-2018 Free Software Foundation, Inc.
# Copyright (C) 2007-2020 Free Software Foundation, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -15,9 +15,9 @@ scriptversion=2017-08-07.06; # UTC
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# This script is derived from GIT-VERSION-GEN from GIT: http://git.or.cz/.
# This script is derived from GIT-VERSION-GEN from GIT: https://git-scm.com/.
# It may be run two ways:
# - from a git repository in which the "git describe" command below
# produces useful output (thus requiring at least one signed tag)
@ -72,9 +72,10 @@ scriptversion=2017-08-07.06; # UTC
me=$0
year=`expr "$scriptversion" : '\([^-]*\)'`
version="git-version-gen $scriptversion
Copyright 2011 Free Software Foundation, Inc.
Copyright $year Free Software Foundation, Inc.
There is NO warranty. You may redistribute this software
under the terms of the GNU General Public License.
For more information about these matters, see the files named COPYING."
@ -141,11 +142,9 @@ then
v=`cat $tarball_version_file` || v=
case $v in
*$nl*) v= ;; # reject multi-line output
[0-9]*) ;;
*) v= ;;
esac
test "x$v" = x \
&& echo "$0: WARNING: $tarball_version_file is missing or damaged" 1>&2
&& echo "$0: WARNING: $tarball_version_file is damaged" 1>&2
fi
if test "x$v" != x
@ -167,7 +166,8 @@ then
# tag or the previous older version that did not?
# Newer: v6.10-77-g0f8faeb
# Older: v6.10-g0f8faeb
case ${v#-g*} in
vprefix=`expr "X$v" : 'X\(.*\)-g[^-]*$'` || vprefix=$v
case $vprefix in
*-*) : git describe is probably okay three part flavor ;;
*)
: git describe is older two part flavor
@ -218,7 +218,7 @@ fi
printf %s "$v"
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC0"

View file

@ -1,7 +1,7 @@
#!/bin/sh
# install - install a program, script, or datafile
scriptversion=2013-12-25.23; # UTC
scriptversion=2020-11-14.01; # UTC
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
@ -69,6 +69,11 @@ posix_mkdir=
# Desired mode of installed file.
mode=0755
# Create dirs (including intermediate dirs) using mode 755.
# This is like GNU 'install' as of coreutils 8.32 (2020).
mkdir_umask=22
backupsuffix=
chgrpcmd=
chmodcmd=$chmodprog
chowncmd=
@ -99,18 +104,28 @@ Options:
--version display version info and exit.
-c (ignored)
-C install only if different (preserve the last data modification time)
-C install only if different (preserve data modification time)
-d create directories instead of installing files.
-g GROUP $chgrpprog installed files to GROUP.
-m MODE $chmodprog installed files to MODE.
-o USER $chownprog installed files to USER.
-p pass -p to $cpprog.
-s $stripprog installed files.
-S SUFFIX attempt to back up existing files, with suffix SUFFIX.
-t DIRECTORY install into DIRECTORY.
-T report an error if DSTFILE is a directory.
Environment variables override the default commands:
CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
RMPROG STRIPPROG
By default, rm is invoked with -f; when overridden with RMPROG,
it's up to you to specify -f if you want it.
If -S is not specified, no backups are attempted.
Email bug reports to bug-automake@gnu.org.
Automake home page: https://www.gnu.org/software/automake/
"
while test $# -ne 0; do
@ -137,8 +152,13 @@ while test $# -ne 0; do
-o) chowncmd="$chownprog $2"
shift;;
-p) cpprog="$cpprog -p";;
-s) stripcmd=$stripprog;;
-S) backupsuffix="$2"
shift;;
-t)
is_target_a_directory=always
dst_arg=$2
@ -255,6 +275,10 @@ do
dstdir=$dst
test -d "$dstdir"
dstdir_status=$?
# Don't chown directories that already exist.
if test $dstdir_status = 0; then
chowncmd=""
fi
else
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
@ -271,15 +295,18 @@ do
fi
dst=$dst_arg
# If destination is a directory, append the input filename; won't work
# if double slashes aren't ignored.
# If destination is a directory, append the input filename.
if test -d "$dst"; then
if test "$is_target_a_directory" = never; then
echo "$0: $dst_arg: Is a directory" >&2
exit 1
fi
dstdir=$dst
dst=$dstdir/`basename "$src"`
dstbase=`basename "$src"`
case $dst in
*/) dst=$dst$dstbase;;
*) dst=$dst/$dstbase;;
esac
dstdir_status=0
else
dstdir=`dirname "$dst"`
@ -288,27 +315,16 @@ do
fi
fi
case $dstdir in
*/) dstdirslash=$dstdir;;
*) dstdirslash=$dstdir/;;
esac
obsolete_mkdir_used=false
if test $dstdir_status != 0; then
case $posix_mkdir in
'')
# Create intermediate dirs using mode 755 as modified by the umask.
# This is like FreeBSD 'install' as of 1997-10-28.
umask=`umask`
case $stripcmd.$umask in
# Optimize common cases.
*[2367][2367]) mkdir_umask=$umask;;
.*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
*[0-7])
mkdir_umask=`expr $umask + 22 \
- $umask % 100 % 40 + $umask % 20 \
- $umask % 10 % 4 + $umask % 2
`;;
*) mkdir_umask=$umask,go-w;;
esac
# With -d, create the new directory with the user-specified mode.
# Otherwise, rely on $mkdir_umask.
if test -n "$dir_arg"; then
@ -318,43 +334,49 @@ do
fi
posix_mkdir=false
case $umask in
*[123567][0-7][0-7])
# POSIX mkdir -p sets u+wx bits regardless of umask, which
# is incompatible with FreeBSD 'install' when (umask & 300) != 0.
;;
*)
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
# The $RANDOM variable is not portable (e.g., dash). Use it
# here however when possible just to lower collision chance.
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
if (umask $mkdir_umask &&
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
then
if test -z "$dir_arg" || {
# Check for POSIX incompatibilities with -m.
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
# other-writable bit of parent directory when it shouldn't.
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
ls_ld_tmpdir=`ls -ld "$tmpdir"`
case $ls_ld_tmpdir in
d????-?r-*) different_mode=700;;
d????-?--*) different_mode=755;;
*) false;;
esac &&
$mkdirprog -m$different_mode -p -- "$tmpdir" && {
ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
}
}
then posix_mkdir=:
fi
rmdir "$tmpdir/d" "$tmpdir"
else
# Remove any dirs left behind by ancient mkdir implementations.
rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
fi
trap '' 0;;
esac;;
trap '
ret=$?
rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null
exit $ret
' 0
# Because "mkdir -p" follows existing symlinks and we likely work
# directly in world-writeable /tmp, make sure that the '$tmpdir'
# directory is successfully created first before we actually test
# 'mkdir -p'.
if (umask $mkdir_umask &&
$mkdirprog $mkdir_mode "$tmpdir" &&
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1
then
if test -z "$dir_arg" || {
# Check for POSIX incompatibilities with -m.
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
# other-writable bit of parent directory when it shouldn't.
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
test_tmpdir="$tmpdir/a"
ls_ld_tmpdir=`ls -ld "$test_tmpdir"`
case $ls_ld_tmpdir in
d????-?r-*) different_mode=700;;
d????-?--*) different_mode=755;;
*) false;;
esac &&
$mkdirprog -m$different_mode -p -- "$test_tmpdir" && {
ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"`
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
}
}
then posix_mkdir=:
fi
rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir"
else
# Remove any dirs left behind by ancient mkdir implementations.
rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null
fi
trap '' 0;;
esac
if
@ -365,7 +387,7 @@ do
then :
else
# The umask is ridiculous, or mkdir does not conform to POSIX,
# mkdir does not conform to POSIX,
# or it failed possibly due to a race condition. Create the
# directory the slow way, step by step, checking for races as we go.
@ -394,7 +416,7 @@ do
prefixes=
else
if $posix_mkdir; then
(umask=$mkdir_umask &&
(umask $mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
# Don't fail if two instances are running concurrently.
test -d "$prefix" || exit 1
@ -427,14 +449,25 @@ do
else
# Make a couple of temp file names in the proper directory.
dsttmp=$dstdir/_inst.$$_
rmtmp=$dstdir/_rm.$$_
dsttmp=${dstdirslash}_inst.$$_
rmtmp=${dstdirslash}_rm.$$_
# Trap to clean up those temp files at exit.
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
# Copy the file name to the temp name.
(umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
(umask $cp_umask &&
{ test -z "$stripcmd" || {
# Create $dsttmp read-write so that cp doesn't create it read-only,
# which would cause strip to fail.
if test -z "$doit"; then
: >"$dsttmp" # No need to fork-exec 'touch'.
else
$doit touch "$dsttmp"
fi
}
} &&
$doit_exec $cpprog "$src" "$dsttmp") &&
# and set any options; do chmod last to preserve setuid bits.
#
@ -460,6 +493,13 @@ do
then
rm -f "$dsttmp"
else
# If $backupsuffix is set, and the file being installed
# already exists, attempt a backup. Don't worry if it fails,
# e.g., if mv doesn't support -f.
if test -n "$backupsuffix" && test -f "$dst"; then
$doit $mvcmd -f "$dst" "$dst$backupsuffix" 2>/dev/null
fi
# Rename the file to the real destination.
$doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
@ -474,9 +514,9 @@ do
# file should still install successfully.
{
test ! -f "$dst" ||
$doit $rmcmd -f "$dst" 2>/dev/null ||
$doit $rmcmd "$dst" 2>/dev/null ||
{ $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
{ $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
{ $doit $rmcmd "$rmtmp" 2>/dev/null; :; }
} ||
{ echo "$0: cannot unlink or rename $dst" >&2
(exit 1); exit 1
@ -493,9 +533,9 @@ do
done
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC"
# End:

View file

@ -1,6 +1,6 @@
#
# Empire - A multi-player, client/server Internet based war game.
# Copyright (C) 1986-2020, Dave Pare, Jeff Bailey, Thomas Ruschak,
# Copyright (C) 1986-2021, Dave Pare, Jeff Bailey, Thomas Ruschak,
# Ken Stevens, Steve McClure, Markus Armbruster
#
# Empire is free software: you can redistribute it and/or modify
@ -27,14 +27,14 @@
# configure.ac: Autoconf input file
#
# Known contributors to this file:
# Markus Armbruster, 2005-2016
# Markus Armbruster, 2005-2020
#
# Process this file with autoconf to produce a configure script.
# Autoconf makes checking for and programming around assorted ancient
# crap relatively painless. But why bother? Just rely on C89 and
# POSIX, and when something breaks on some oddball machine, see
# whether it's worth fixing.
# crap relatively painless. But why bother? Just rely on POSIX, and
# when something breaks on some oddball machine, see whether it's
# worth fixing.
AC_PREREQ(2.69)
AC_INIT([Wolfpack Empire],
@ -46,15 +46,19 @@ AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_HEADERS([config.h])
### Checks for programs
AC_PROG_AWK
AC_PROG_INSTALL
AC_PROG_RANLIB
AC_PROG_CC
AC_PROG_CC_STDC
AM_PROG_CC_C_O
# Private automake macro, tsk, tsk, tsk...
_AM_DEPENDENCIES(CC)
AC_DEFINE([_XOPEN_SOURCE], [600],
[Request POSIX-1.2001 with XSI Extension])
# Note: this is after AC_PROG_CC_STDC, because Solaris cc fails with
# _XOPEN_SOURCE unless switched to C99, which breaks AC_PROG_CC_STDC.
AC_ARG_VAR(NROFF, [nroff command])
AC_CHECK_PROG(NROFF, groff, [GROFF_NO_SGR= groff -Tascii -U], nroff)
@ -80,6 +84,8 @@ LIBS="$LIBS_SOCKETS $LIBS"
AX_LIB_SOCKET_NSL
LIBS_server="$LIBS"
MY_WITH_READLINE
MY_WITH_TERMINFO
LIBS_client="$LIBS"
### Checks for header files
@ -87,6 +93,9 @@ MY_WITH_READLINE
### Checks for typedefs, structures, and compiler characteristics
if test "$GCC"
then
# Enable useful warnings
# Some of them are commented out because the code needs cleanup first
# Clang needs to be tested with -Werror=unknown-warning-option
@ -115,9 +124,6 @@ dnl -Wswitch-default dnl
-Wno-unused-parameter dnl
], [], [$cflags_test])
# Our carg() conflicts with libm's TODO clean that up
MY_APPEND_COMPILE_FLAGS([-fno-builtin-carg -Wno-incompatible-library-redeclaration])
# No multiple definitions of uninitialized global variables
MY_APPEND_COMPILE_FLAGS([-fno-common])
@ -164,10 +170,13 @@ main(int argc, char *argv[])
}
]])])
fi # $GCC
### Checks for library functions
AC_CHECK_FUNCS(getaddrinfo getpass)
AC_CHECK_FUNCS(getaddrinfo)
MY_WORKING_IN6_IS_ADDR_V4MAPPED
MY_FUNC_MAKECONTEXT
@ -212,9 +221,6 @@ POSIX) AC_DEFINE([EMPTH_POSIX], 1, [Define to use POSIX threads]) ;;
Windows) AC_DEFINE([EMPTH_W32], 1, [Define to use Windows threads]) ;;
esac
MY_WITH_TERMINFO
LIBS_client="$LIBS"
### Output

View file

@ -191,8 +191,6 @@ Do not use
// C++/C99 comments
because they are not portable C89.
Conditional compilation
Unless the conditional code is very short, please comment it like
@ -362,7 +360,18 @@ it's as relevant as ever:
Portability
-----------
FIXME C89, POSIX
Code for IEEE Std 1003.1-2001 (POSIX.1-2001) with the X/Open System
Interfaces Extension. This standard includes ISO/IEC 9899:1999 (C99)
by reference.
Some systems may have flaws that require work-arounds. Use Autoconf
to detect the flaws, and isolate the system-specific code, e.g. by
providing a replacement function when the system's function is flawed.
Keeping the Windows build working may require extending src/lib/w32/.
Keep the client as portable as practical. In particular, stick to
C89.
FIXME sizes, printf formats

View file

@ -1,6 +1,6 @@
/*
* Empire - A multi-player, client/server Internet based war game.
* Copyright (C) 1986-2020, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Copyright (C) 1986-2021, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure, Markus Armbruster
*
* Empire is free software: you can redistribute it and/or modify

View file

@ -1,6 +1,6 @@
/*
* Empire - A multi-player, client/server Internet based war game.
* Copyright (C) 1986-2020, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Copyright (C) 1986-2021, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure, Markus Armbruster
*
* Empire is free software: you can redistribute it and/or modify

View file

@ -1,6 +1,6 @@
/*
* Empire - A multi-player, client/server Internet based war game.
* Copyright (C) 1986-2020, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Copyright (C) 1986-2021, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure, Markus Armbruster
*
* Empire is free software: you can redistribute it and/or modify

View file

@ -1,6 +1,6 @@
/*
* Empire - A multi-player, client/server Internet based war game.
* Copyright (C) 1986-2020, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Copyright (C) 1986-2021, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure, Markus Armbruster
*
* Empire is free software: you can redistribute it and/or modify

View file

@ -1,6 +1,6 @@
/*
* Empire - A multi-player, client/server Internet based war game.
* Copyright (C) 1986-2020, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Copyright (C) 1986-2021, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure, Markus Armbruster
*
* Empire is free software: you can redistribute it and/or modify

View file

@ -1,6 +1,6 @@
/*
* Empire - A multi-player, client/server Internet based war game.
* Copyright (C) 1986-2020, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Copyright (C) 1986-2021, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure, Markus Armbruster
*
* Empire is free software: you can redistribute it and/or modify

View file

@ -1,6 +1,6 @@
/*
* Empire - A multi-player, client/server Internet based war game.
* Copyright (C) 1986-2020, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Copyright (C) 1986-2021, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure, Markus Armbruster
*
* Empire is free software: you can redistribute it and/or modify

View file

@ -1,6 +1,6 @@
/*
* Empire - A multi-player, client/server Internet based war game.
* Copyright (C) 1986-2020, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Copyright (C) 1986-2021, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure, Markus Armbruster
*
* Empire is free software: you can redistribute it and/or modify
@ -28,7 +28,7 @@
*
* Known contributors to this file:
* Marc Olzheim, 2004
* Markus Armbruster, 2004-2015
* Markus Armbruster, 2004-2020
*/
/*
@ -312,7 +312,7 @@ EMPCFBOTH("unit_damage", unit_damage, double, NSC_DOUBLE, 0,
EMPCFBOTH("collateral_dam", collateral_dam, double, NSC_DOUBLE, 0,
"Side effect damage amount done to sector")
EMPCFBOTH("assault_penalty", assault_penalty, double, NSC_DOUBLE, 0,
"Attack strength multiplier for paratroopers and assaulting")
"Land unit strength multiplier for assaulting and boarding")
EMPCFBOTH("fire_range_factor", fire_range_factor, float, NSC_FLOAT, 0,
"Scale normal firing ranges by this amount")
EMPCFBOTH("sect_mob_neg_factor", sect_mob_neg_factor, int, NSC_INT, 0,

View file

@ -1,6 +1,6 @@
/*
* Empire - A multi-player, client/server Internet based war game.
* Copyright (C) 1986-2020, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Copyright (C) 1986-2021, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure, Markus Armbruster
*
* Empire is free software: you can redistribute it and/or modify

View file

@ -1,6 +1,6 @@
/*
* Empire - A multi-player, client/server Internet based war game.
* Copyright (C) 1986-2020, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Copyright (C) 1986-2021, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure, Markus Armbruster
*
* Empire is free software: you can redistribute it and/or modify

View file

@ -1,6 +1,6 @@
/*
* Empire - A multi-player, client/server Internet based war game.
* Copyright (C) 1986-2020, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Copyright (C) 1986-2021, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure, Markus Armbruster
*
* Empire is free software: you can redistribute it and/or modify

View file

@ -1,6 +1,6 @@
/*
* Empire - A multi-player, client/server Internet based war game.
* Copyright (C) 1986-2020, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Copyright (C) 1986-2021, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure, Markus Armbruster
*
* Empire is free software: you can redistribute it and/or modify

View file

@ -1,6 +1,6 @@
/*
* Empire - A multi-player, client/server Internet based war game.
* Copyright (C) 1986-2020, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Copyright (C) 1986-2021, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure, Markus Armbruster
*
* Empire is free software: you can redistribute it and/or modify

View file

@ -1,6 +1,6 @@
/*
* Empire - A multi-player, client/server Internet based war game.
* Copyright (C) 1986-2020, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Copyright (C) 1986-2021, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure, Markus Armbruster
*
* Empire is free software: you can redistribute it and/or modify

View file

@ -1,6 +1,6 @@
/*
* Empire - A multi-player, client/server Internet based war game.
* Copyright (C) 1986-2020, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Copyright (C) 1986-2021, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure, Markus Armbruster
*
* Empire is free software: you can redistribute it and/or modify

View file

@ -1,6 +1,6 @@
/*
* Empire - A multi-player, client/server Internet based war game.
* Copyright (C) 1986-2020, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Copyright (C) 1986-2021, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure, Markus Armbruster
*
* Empire is free software: you can redistribute it and/or modify

View file

@ -1,6 +1,6 @@
/*
* Empire - A multi-player, client/server Internet based war game.
* Copyright (C) 1986-2020, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Copyright (C) 1986-2021, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure, Markus Armbruster
*
* Empire is free software: you can redistribute it and/or modify

View file

@ -1,6 +1,6 @@
/*
* Empire - A multi-player, client/server Internet based war game.
* Copyright (C) 1986-2020, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Copyright (C) 1986-2021, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure, Markus Armbruster
*
* Empire is free software: you can redistribute it and/or modify
@ -30,7 +30,7 @@
* Thomas Ruschak, 1992
* Ken Stevens, 1995
* Steve McClure, 1998
* Markus Armbruster, 2004-2016
* Markus Armbruster, 2004-2020
*/
#ifndef LAND_H
@ -41,7 +41,6 @@
#include "retreat.h"
#include "types.h"
#define LND_TYPE_MAX 30
#define LAND_MINEFF 10
#define LAND_MINFIREEFF 40 /* arty must be this effic to fire */
@ -125,7 +124,7 @@ struct lchrstr {
#define putland(n, p) ef_write(EF_LAND, (n), (p))
#define getlandp(n) ((struct lndstr *)ef_ptr(EF_LAND, (n)))
extern struct lchrstr lchr[LND_TYPE_MAX + 2];
extern struct lchrstr lchr[128];
enum {
LND_AIROPS_EFF = 50 /* min. efficiency for air ops */

View file

@ -1,6 +1,6 @@
/*
* Empire - A multi-player, client/server Internet based war game.
* Copyright (C) 1986-2020, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Copyright (C) 1986-2021, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure, Markus Armbruster
*
* Empire is free software: you can redistribute it and/or modify
@ -58,9 +58,9 @@ struct lonstr {
time_t l_duedate; /* date after which interest doubles, etc */
};
#define LS_FREE AGREE_FREE
#define LS_PROPOSED AGREE_PROPOSED
#define LS_SIGNED AGREE_SIGNED
#define LS_FREE 0
#define LS_PROPOSED 1
#define LS_SIGNED 2
extern double loan_owed(struct lonstr *loan, time_t paytime);

View file

@ -1,6 +1,6 @@
/*
* Empire - A multi-player, client/server Internet based war game.
* Copyright (C) 1986-2020, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Copyright (C) 1986-2021, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure, Markus Armbruster
*
* Empire is free software: you can redistribute it and/or modify

View file

@ -1,6 +1,6 @@
/*
* Empire - A multi-player, client/server Internet based war game.
* Copyright (C) 1994-2020, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Copyright (C) 1994-2021, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure, Markus Armbruster
* Copyright (C) 1991-3 Stephen Crane
*
@ -28,7 +28,7 @@
* lwp.h -- prototypes and structures for lightweight processes
*
* Known contributors to this file:
* Markus Armbruster, 2004-2013
* Markus Armbruster, 2004-2020
* Ron Koenderink, 2007-2009
*/
@ -41,7 +41,6 @@
#ifndef LWP_H
#define LWP_H
#include <signal.h>
#include <sys/time.h>
#define LWP_STACKCHECK 0x1
@ -55,7 +54,7 @@ struct lwp_rwlock;
#define LWP_MAX_PRIO 8
struct lwpProc *lwpInitSystem(int prio, void **ctxp, int flags, sigset_t *);
struct lwpProc *lwpInitSystem(int prio, void **ctxp, int flags, int[]);
struct lwpProc *lwpCreate(int prio, void (*)(void *), int size,
int flags, char *name,
int argc, char **argv, void *ud);
@ -65,7 +64,7 @@ void lwpYield(void);
int lwpSleepFd(int fd, int flags, struct timeval *timeout);
int lwpSleepUntil(time_t until);
void lwpWakeup(struct lwpProc *);
int lwpSigWait(sigset_t *set, int *sig);
int lwpSigWait(void);
void *lwpGetUD(struct lwpProc *);
void lwpSetUD(struct lwpProc *, char *ud);
int lwpSetPriority(int prio);

View file

@ -1,6 +1,6 @@
/*
* Empire - A multi-player, client/server Internet based war game.
* Copyright (C) 1986-2020, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Copyright (C) 1986-2021, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure, Markus Armbruster
*
* Empire is free software: you can redistribute it and/or modify

View file

@ -1,6 +1,6 @@
/*
* Empire - A multi-player, client/server Internet based war game.
* Copyright (C) 1986-2020, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Copyright (C) 1986-2021, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure, Markus Armbruster
*
* Empire is free software: you can redistribute it and/or modify

View file

@ -1,6 +1,6 @@
/*
* Empire - A multi-player, client/server Internet based war game.
* Copyright (C) 1986-2020, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Copyright (C) 1986-2021, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure, Markus Armbruster
*
* Empire is free software: you can redistribute it and/or modify
@ -29,7 +29,7 @@
*
* Known contributors to this file:
* Doug Hay, 1998
* Markus Armbruster, 2004-2014
* Markus Armbruster, 2004-2020
*/
#ifndef MISC_H
@ -89,6 +89,11 @@ extern void (*oops_handler)(void);
#define BUILD_ASSERT(cond) \
((void)BUILD_ASSERT_ONE(cond))
/*
* Number of elements in ARRAY.
*/
#define ARRAY_SIZE(array) (sizeof(array) / sizeof(array[0]))
void exit_nomem(void) ATTRIBUTE((noreturn));
/* return codes from command routines */
@ -103,8 +108,4 @@ extern char *ugetstring(char *prompt, char buf[]);
extern char *prbuf(char *format, ...)
ATTRIBUTE((format (printf, 1, 2)));
#define AGREE_FREE 0
#define AGREE_PROPOSED 1
#define AGREE_SIGNED 2
#endif

View file

@ -1,6 +1,6 @@
/*
* Empire - A multi-player, client/server Internet based war game.
* Copyright (C) 1986-2020, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Copyright (C) 1986-2021, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure, Markus Armbruster
*
* Empire is free software: you can redistribute it and/or modify

View file

@ -1,6 +1,6 @@
/*
* Empire - A multi-player, client/server Internet based war game.
* Copyright (C) 1986-2020, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Copyright (C) 1986-2021, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure, Markus Armbruster
*
* Empire is free software: you can redistribute it and/or modify

View file

@ -1,6 +1,6 @@
/*
* Empire - A multi-player, client/server Internet based war game.
* Copyright (C) 1986-2020, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Copyright (C) 1986-2021, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure, Markus Armbruster
*
* Empire is free software: you can redistribute it and/or modify

View file

@ -1,6 +1,6 @@
/*
* Empire - A multi-player, client/server Internet based war game.
* Copyright (C) 1986-2020, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Copyright (C) 1986-2021, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure, Markus Armbruster
*
* Empire is free software: you can redistribute it and/or modify
@ -28,7 +28,7 @@
*
* Known contributors to this file:
* Dave Pare, 1989
* Markus Armbruster, 2004-2016
* Markus Armbruster, 2004-2020
*/
#ifndef NSC_H
@ -319,6 +319,12 @@ extern void nsc_init(void);
extern int nxtitem(struct nstr_item *, void *);
/* src/lib/subs/nxtsct.c */
extern int nxtsct(struct nstr_sect *, struct sctstr *);
/* src/lib/subs/sarg.c */
extern enum ns_seltype sarg_type(char *);
extern int sarg_xy(char *, coord *, coord *);
extern int sarg_area(char *, struct range *);
extern int sarg_range(char *, coord *, coord *, int *);
extern int sarg_list(char *, int *, int);
/* src/lib/subs/snxtitem.c */
extern int snxtitem(struct nstr_item *, int, char *, char *);
extern void snxtitem_area(struct nstr_item *, int, struct range *);

View file

@ -1,6 +1,6 @@
/*
* Empire - A multi-player, client/server Internet based war game.
* Copyright (C) 1986-2020, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Copyright (C) 1986-2021, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure, Markus Armbruster
*
* Empire is free software: you can redistribute it and/or modify
@ -28,7 +28,7 @@
*
* Known contributors to this file:
* Dave Pare, 1986
* Markus Armbruster, 2004-2016
* Markus Armbruster, 2004-2020
*/
#ifndef NUKE_H
@ -38,7 +38,6 @@
#include "item.h"
#include "types.h"
#define N_MAXNUKE 20
#define MIN_DRNUKE_CONST 0.001
struct nukstr {
@ -83,7 +82,7 @@ struct nchrstr {
#define putnuke(n, p) ef_write(EF_NUKE, (n), (p))
#define getnukep(n) ((struct nukstr *)ef_ptr(EF_NUKE, (n)))
extern struct nchrstr nchr[N_MAXNUKE + 1];
extern struct nchrstr nchr[64];
/* src/lib/common/cargo.c */
extern void nuk_carrier_change(struct nukstr *, int, int, int);

View file

@ -1,6 +1,6 @@
/*
* Empire - A multi-player, client/server Internet based war game.
* Copyright (C) 1986-2020, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Copyright (C) 1986-2021, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure, Markus Armbruster
*
* Empire is free software: you can redistribute it and/or modify

View file

@ -1,6 +1,6 @@
/*
* Empire - A multi-player, client/server Internet based war game.
* Copyright (C) 1986-2020, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Copyright (C) 1986-2021, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure, Markus Armbruster
*
* Empire is free software: you can redistribute it and/or modify

View file

@ -1,6 +1,6 @@
/*
* Empire - A multi-player, client/server Internet based war game.
* Copyright (C) 1986-2020, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Copyright (C) 1986-2021, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure, Markus Armbruster
*
* Empire is free software: you can redistribute it and/or modify

View file

@ -1,6 +1,6 @@
/*
* Empire - A multi-player, client/server Internet based war game.
* Copyright (C) 1986-2020, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Copyright (C) 1986-2021, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure, Markus Armbruster
*
* Empire is free software: you can redistribute it and/or modify
@ -30,7 +30,7 @@
* Dave Pare, 1986
* Ken Stevens, 1995
* Steve McClure, 1998
* Markus Armbruster, 2004-2016
* Markus Armbruster, 2004-2020
*/
#ifndef PLANE_H
@ -41,7 +41,6 @@
#include "queue.h"
#include "types.h"
#define PLN_TYPE_MAX 46
#define PLANE_MINEFF 10
struct plnstr {
@ -135,7 +134,7 @@ struct plist {
#define putplane(n, p) ef_write(EF_PLANE, (n), (p))
#define getplanep(n) ((struct plnstr *)ef_ptr(EF_PLANE, (n)))
extern struct plchrstr plchr[PLN_TYPE_MAX + 2];
extern struct plchrstr plchr[128];
struct shiplist {
int uid;

View file

@ -1,6 +1,6 @@
/*
* Empire - A multi-player, client/server Internet based war game.
* Copyright (C) 1986-2020, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Copyright (C) 1986-2021, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure, Markus Armbruster
*
* Empire is free software: you can redistribute it and/or modify

View file

@ -1,6 +1,6 @@
/*
* Empire - A multi-player, client/server Internet based war game.
* Copyright (C) 1986-2020, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Copyright (C) 1986-2021, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure, Markus Armbruster
*
* Empire is free software: you can redistribute it and/or modify

View file

@ -1,6 +1,6 @@
/*
* Empire - A multi-player, client/server Internet based war game.
* Copyright (C) 1986-2020, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Copyright (C) 1986-2021, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure, Markus Armbruster
*
* Empire is free software: you can redistribute it and/or modify
@ -45,6 +45,7 @@ struct pchrstr {
int p_uid;
i_type p_ctype[MAXPRCON]; /* constituent types */
unsigned short p_camt[MAXPRCON]; /* constituent amounts */
int p_bwork; /* work to build one product unit */
i_type p_type; /* product item type, or I_NONE if level */
int p_level; /* level index (NAT_?LEV), or -1 if item */
int p_cost; /* dollars / product unit */
@ -57,8 +58,6 @@ struct pchrstr {
char *p_sname; /* short (7 char or less) name of product */
};
#define P_MAX 22
extern struct pchrstr pchr[P_MAX + 2];
extern struct pchrstr pchr[32];
#endif

View file

@ -1,6 +1,6 @@
/*
* Empire - A multi-player, client/server Internet based war game.
* Copyright (C) 1986-2020, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Copyright (C) 1986-2021, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure, Markus Armbruster
*
* Empire is free software: you can redistribute it and/or modify

View file

@ -1,6 +1,6 @@
/*
* Empire - A multi-player, client/server Internet based war game.
* Copyright (C) 1986-2020, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Copyright (C) 1986-2021, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure, Markus Armbruster
*
* Empire is free software: you can redistribute it and/or modify
@ -71,170 +71,170 @@ extern int radar(int);
extern void update_power(void);
extern int show_first_tel(char *);
/* Commands */
int acce(void);
int add(void);
int anti(void);
int apro(void);
int arm(void);
int army(void);
int assa(void);
int atta(void);
int bdes(void);
int best(void);
int boar(void);
int bomb(void);
int brea(void);
int budg(void);
int buil(void);
int buy(void);
int capi(void);
int carg(void);
int cens(void);
int chan(void);
int coas(void);
int coll(void);
int comm(void);
int cons(void);
int conv(void);
int coun(void);
int cuto(void);
int decl(void);
int deli(void);
int demo(void);
int desi(void);
int disa(void);
int disarm(void);
int dist(void);
int drop(void);
int dump(void);
int echo(void);
int edit(void);
int enab(void);
int enli(void);
int execute(void);
int explain(void);
int explore(void);
int fina(void);
int flash(void);
int flee(void);
int fly(void);
int force(void);
int fort(void);
int give(void);
int grin(void);
int hard(void);
int head(void);
int improve(void);
int info(void);
int land(void);
int landmine(void);
int laun(void);
int lboa(void);
int lcarg(void);
int ldump(void);
int ledg(void);
int leve(void);
int lload(void);
int llook(void);
int load(void);
int look(void);
int lost(void);
int lrad(void);
int lretr(void);
int lsta(void);
int ltend(void);
int map(void);
int march(void);
int mark(void);
int mine(void);
int mission(void);
int morale(void);
int move(void);
int multifire(void);
int name(void);
int nati(void);
int navi(void);
int ndump(void);
int new(void);
int newe(void);
int news(void);
int nuke(void);
int offe(void);
int orig(void);
int para(void);
int path(void);
int payo(void);
int pboa(void);
int pdump(void);
int peek(void);
int plan(void);
int play(void);
int powe(void);
int prod(void);
int pstat(void);
int quit(void);
int rada(void);
int range(void);
int rea(void);
int real(void);
int reco(void);
int reje(void);
int rela(void);
int relo(void);
int repa(void);
int repo(void);
int rese(void);
int reso(void);
int retr(void);
int rout(void);
int sabo(void);
int sate(void);
int scra(void);
int sct(void);
int scut(void);
int sdump(void);
int sell(void);
int set(void);
int setres(void);
int setsector(void);
int shar(void);
int shark(void);
int shi(void);
int shoo(void);
int show(void);
int show_motd(void);
int shut(void);
int sinfra(void);
int skyw(void);
int sona(void);
int spy(void);
int sstat(void);
int start(void);
int starve(void);
int stoc(void);
int stop(void);
int stre(void);
int supp(void);
int surv(void);
int swaps(void);
int tele(void);
int tend(void);
int terr(void);
int thre(void);
int togg(void);
int torp(void);
int trad(void);
int tran(void);
int turn(void);
int upda(void);
int upgr(void);
int vers(void);
int wall(void);
int wing(void);
int wipe(void);
int work(void);
int xdump(void);
int zdon(void);
int c_accept(void);
int c_add(void);
int c_anti(void);
int c_apropos(void);
int c_arm(void);
int c_army(void);
int c_assault(void);
int c_attack(void);
int c_bdes(void);
int c_bestpath(void);
int c_board(void);
int c_bomb(void);
int c_break(void);
int c_budget(void);
int c_build(void);
int c_buy(void);
int c_capital(void);
int c_cargo(void);
int c_census(void);
int c_change(void);
int c_coastwatch(void);
int c_collect(void);
int c_commodity(void);
int c_consider(void);
int c_convert(void);
int c_country(void);
int c_cutoff(void);
int c_declare(void);
int c_deliver(void);
int c_demobilize(void);
int c_designate(void);
int c_disable(void);
int c_disarm(void);
int c_distribute(void);
int c_drop(void);
int c_dump(void);
int c_echo(void);
int c_edit(void);
int c_enable(void);
int c_enlist(void);
int c_execute(void);
int c_explore(void);
int c_financial(void);
int c_fire(void);
int c_flash(void);
int c_fleetadd(void);
int c_fly(void);
int c_force(void);
int c_fortify(void);
int c_give(void);
int c_grind(void);
int c_harden(void);
int c_headlines(void);
int c_improve(void);
int c_info(void);
int c_land(void);
int c_launch(void);
int c_lboard(void);
int c_lcargo(void);
int c_ldump(void);
int c_ledger(void);
int c_level(void);
int c_list(void);
int c_lload(void);
int c_llookout(void);
int c_lmine(void);
int c_load(void);
int c_lookout(void);
int c_lost(void);
int c_lradar(void);
int c_lretreat(void);
int c_lstat(void);
int c_ltend(void);
int c_map(void);
int c_march(void);
int c_market(void);
int c_mine(void);
int c_mission(void);
int c_morale(void);
int c_motd(void);
int c_move(void);
int c_name(void);
int c_nation(void);
int c_navigate(void);
int c_ndump(void);
int c_newcap(void);
int c_neweff(void);
int c_newspaper(void);
int c_nuke(void);
int c_offer(void);
int c_origin(void);
int c_paradrop(void);
int c_path(void);
int c_payoff(void);
int c_pboard(void);
int c_pdump(void);
int c_peek(void);
int c_plane(void);
int c_players(void);
int c_power(void);
int c_production(void);
int c_pstat(void);
int c_quit(void);
int c_radar(void);
int c_range(void);
int c_read(void);
int c_realm(void);
int c_recon(void);
int c_reject(void);
int c_relations(void);
int c_reload(void);
int c_repay(void);
int c_report(void);
int c_reset(void);
int c_resource(void);
int c_retreat(void);
int c_route(void);
int c_sabotage(void);
int c_satellite(void);
int c_scrap(void);
int c_scuttle(void);
int c_sdump(void);
int c_sect(void);
int c_sell(void);
int c_set(void);
int c_setresource(void);
int c_setsector(void);
int c_sharebmap(void);
int c_shark(void);
int c_ship(void);
int c_shoot(void);
int c_show(void);
int c_shutdown(void);
int c_sinfrastructure(void);
int c_skywatch(void);
int c_sonar(void);
int c_spy(void);
int c_sstat(void);
int c_start(void);
int c_starvation(void);
int c_stockpile(void);
int c_stop(void);
int c_strength(void);
int c_supply(void);
int c_survey(void);
int c_swapsector(void);
int c_telegram(void);
int c_tend(void);
int c_territory(void);
int c_threshold(void);
int c_toggle(void);
int c_torpedo(void);
int c_trade(void);
int c_transport(void);
int c_turn(void);
int c_update(void);
int c_upgrade(void);
int c_version(void);
int c_wall(void);
int c_wingadd(void);
int c_wipe(void);
int c_work(void);
int c_xdump(void);
int c_zdone(void);
/*
* src/lib/common/ *.c
@ -566,11 +566,7 @@ extern void rad_map_set(natid, int, int, int, double, int);
/* retreat.c */
/* in retreat.h */
/* sarg.c */
extern enum ns_seltype sarg_type(char *);
extern int sarg_xy(char *, coord *, coord *);
extern int sarg_area(char *, struct range *);
extern int sarg_range(char *, coord *, coord *, int *);
extern int sarg_list(char *, int *, int);
/* in nsc.h */
/* satmap.c */
extern void satdisp_sect(struct sctstr *, int);
extern void satdisp_units(coord, coord);

View file

@ -1,6 +1,6 @@
/*
* Empire - A multi-player, client/server Internet based war game.
* Copyright (C) 1986-2020, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Copyright (C) 1986-2021, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure, Markus Armbruster
*
* Empire is free software: you can redistribute it and/or modify

View file

@ -1,6 +1,6 @@
/*
* Empire - A multi-player, client/server Internet based war game.
* Copyright (C) 1986-2020, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Copyright (C) 1986-2021, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure, Markus Armbruster
*
* Empire is free software: you can redistribute it and/or modify
@ -28,7 +28,7 @@
*
* Known contributors to this file:
* Ken Stevens, 1995
* Markus Armbruster, 2014-2015
* Markus Armbruster, 2014-2021
*/
#ifndef RETREAT_H
@ -49,7 +49,7 @@
#define RET_DCHRGED 64 /* Retreat when depth-charged */
#define RET_BOARDED 128 /* Retreat when unsuccessfully boarded */
extern void retreat_ship(struct shpstr *, natid, char);
extern void retreat_land(struct lndstr *, natid, char);
extern void retreat_ship(struct shpstr *, natid);
extern void retreat_land(struct lndstr *, natid);
#endif

View file

@ -1,6 +1,6 @@
/*
* Empire - A multi-player, client/server Internet based war game.
* Copyright (C) 1986-2020, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Copyright (C) 1986-2021, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure, Markus Armbruster
*
* Empire is free software: you can redistribute it and/or modify
@ -30,7 +30,7 @@
* Dave Pare
* Ken Stevens, 1995
* Steve McClure, 1998
* Markus Armbruster, 2004-2016
* Markus Armbruster, 2004-2020
*/
@ -160,14 +160,12 @@ struct dchrstr {
#define SCT_PLAINS 32 /* plains sector */
#define SCT_BTOWER 33 /* Bridge tower */
#define SCT_TYPE_MAX 38
#define getsect(x, y, p) ef_read(EF_SECTOR, sctoff((x), (y)), (p))
#define putsect(p) ef_write(EF_SECTOR, (p)->sct_uid, (p))
#define getsectp(x, y) ((struct sctstr *)ef_ptr(EF_SECTOR, sctoff((x), (y))))
#define getsectid(id) ((struct sctstr *)ef_ptr(EF_SECTOR, (id)))
extern struct dchrstr dchr[SCT_TYPE_MAX + 2];
extern struct dchrstr dchr[64];
#define IS_BIG_CITY(type) (dchr[(type)].d_pkg == UPKG)
/* Minimal efficiency of sectors that can be knocked down (bridges) */

View file

@ -1,6 +1,6 @@
/*
* Empire - A multi-player, client/server Internet based war game.
* Copyright (C) 1986-2020, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Copyright (C) 1986-2021, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure, Markus Armbruster
*
* Empire is free software: you can redistribute it and/or modify

View file

@ -1,6 +1,6 @@
/*
* Empire - A multi-player, client/server Internet based war game.
* Copyright (C) 1986-2020, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Copyright (C) 1986-2021, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure, Markus Armbruster
*
* Empire is free software: you can redistribute it and/or modify

View file

@ -1,6 +1,6 @@
/*
* Empire - A multi-player, client/server Internet based war game.
* Copyright (C) 1986-2020, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Copyright (C) 1986-2021, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure, Markus Armbruster
*
* Empire is free software: you can redistribute it and/or modify
@ -31,7 +31,7 @@
* Thomas Ruschak, 1992
* Ken Stevens, 1995
* Steve McClure, 1998
* Markus Armbruster, 2004-2016
* Markus Armbruster, 2004-2020
*/
#ifndef SHIP_H
@ -42,7 +42,6 @@
#include "retreat.h"
#include "types.h"
#define SHP_TYPE_MAX 46
#define SHIP_MINEFF 20
#define MAXSHPNAMLEN 24
@ -127,7 +126,7 @@ struct mchrstr {
#define putship(n, p) ef_write(EF_SHIP, (n), (p))
#define getshipp(n) ((struct shpstr *)ef_ptr(EF_SHIP, (n)))
extern struct mchrstr mchr[SHP_TYPE_MAX + 2];
extern struct mchrstr mchr[128];
enum {
SHP_AIROPS_EFF = 50, /* min. efficiency for air ops */

View file

@ -1,6 +1,6 @@
/*
* Empire - A multi-player, client/server Internet based war game.
* Copyright (C) 1986-2020, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Copyright (C) 1986-2021, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure, Markus Armbruster
*
* Empire is free software: you can redistribute it and/or modify

View file

@ -1,6 +1,6 @@
/*
* Empire - A multi-player, client/server Internet based war game.
* Copyright (C) 1986-2020, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Copyright (C) 1986-2021, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure, Markus Armbruster
*
* Empire is free software: you can redistribute it and/or modify
@ -36,6 +36,6 @@
extern int test_suite_prng_seed;
/* Commands for test suite use */
int testing_cmd(void);
int c___cmd(void);
#endif

View file

@ -1,6 +1,6 @@
/*
* Empire - A multi-player, client/server Internet based war game.
* Copyright (C) 1986-2020, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Copyright (C) 1986-2021, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure, Markus Armbruster
*
* Empire is free software: you can redistribute it and/or modify

View file

@ -1,6 +1,6 @@
/*
* Empire - A multi-player, client/server Internet based war game.
* Copyright (C) 1986-2020, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Copyright (C) 1986-2021, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure, Markus Armbruster
*
* Empire is free software: you can redistribute it and/or modify

View file

@ -1,6 +1,6 @@
/*
* Empire - A multi-player, client/server Internet based war game.
* Copyright (C) 1986-2020, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Copyright (C) 1986-2021, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure, Markus Armbruster
*
* Empire is free software: you can redistribute it and/or modify

View file

@ -1,6 +1,6 @@
/*
* Empire - A multi-player, client/server Internet based war game.
* Copyright (C) 1986-2020, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Copyright (C) 1986-2021, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure, Markus Armbruster
*
* Empire is free software: you can redistribute it and/or modify
@ -28,7 +28,7 @@
*
* Known contributors to this file:
* Ville Virrankoski, 1995
* Markus Armbruster, 2004-2016
* Markus Armbruster, 2004-2020
*/
#ifndef UPDATE_H
@ -59,7 +59,7 @@ struct budg_item {
/* A nation's budget for an update */
struct budget {
/* production by sector type */
struct budg_item prod[SCT_TYPE_MAX + 1];
struct budg_item prod[ARRAY_SIZE(dchr) - 1];
/* level production output */
float level[4];
/* building and maintenance */
@ -140,8 +140,6 @@ extern void pay_reserve(struct natstr *, int);
/* produce.c */
extern void produce(struct natstr *, struct sctstr *);
extern double prod_output(struct sctstr *, double);
extern double prod_materials_cost(struct pchrstr *, short[], int *);
extern double prod_resource_limit(struct pchrstr *, unsigned char *);
extern double prod_eff(int, float);
/* removewants.c */
extern int update_removewants(void);

View file

@ -1,6 +1,6 @@
/*
* Empire - A multi-player, client/server Internet based war game.
* Copyright (C) 1986-2020, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Copyright (C) 1986-2021, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure, Markus Armbruster
*
* Empire is free software: you can redistribute it and/or modify

View file

@ -1,6 +1,6 @@
/*
* Empire - A multi-player, client/server Internet based war game.
* Copyright (C) 1986-2020, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Copyright (C) 1986-2021, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure, Markus Armbruster
*
* Empire is free software: you can redistribute it and/or modify

View file

@ -1,6 +1,6 @@
/*
* Empire - A multi-player, client/server Internet based war game.
* Copyright (C) 1986-2020, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Copyright (C) 1986-2021, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure, Markus Armbruster
*
* Empire is free software: you can redistribute it and/or modify

View file

@ -1080,6 +1080,10 @@ Changes to Empire 4.3.21 - Mon Mar 9 21:34:52 UTC 2009
4.3.20.
* Code refactoring and cleanup.
.\" Work around "nroff: Out of temp file space":
.FI
.NF
Changes to Empire 4.3.20 - Fri Feb 20 18:14:20 UTC 2009
* Option LOANS is now disabled by default.
* Option RAILWAYS is now enabled by default.

View file

@ -5,10 +5,129 @@
This document outlines the various changes to the game and how they
will affect you, the player. These were coded as the Wolfpack project.
.NF
Changes to Empire 4.4.1 - Sun Jan 17 2021
* Fix land unit casualties in guerrilla fighting. Broken in 4.4.0.
* Changes to edit:
- You can now edit bars on ships and land units, and missile
fortification.
- Fix to reject fortification of embarked land units.
- Fix to zap land unit and plane fortification on load.
- Fix to take satellite off its carrier when moving it to orbit.
* Changes to load, unload, lload, lunload, tend, and ltend:
- tend land with multiple target ships now tends each land unit
just once.
- tend land now reports "not on ship" only when the land unit was
explicitly selected by UID. Matches unload.
- Fix load, unload, lload, lunload to suppress messages and skip
foreign ships / land units when the second argument starts with a
digit.
- load and unload no longer prompt for land units to unload when a
carrier can't carry any.
- Fix load plane to reject satellites in orbit. The stock game
does not have loadable satellites.
* Fix launch to take satellites off their carrier when moving to
orbit.
* Shield embarked planes and land units from sector damage, like
their ships.
* Rewrite much of fairland to make it more robust and more fair:
- Show a more useful map.
- Fix error handling, fix and tidy up error and progress messages.
- Drop option -a. Deities can find continents with ?dterr<N, where
N is the number of continents.
- Drop option -o. Deities can unset resources with "edit l * i 0 g
0 f 0 c 0 u 0".
- Drop a useless warning about small world. It was downgraded from
error in 4.3.25.
- Check arguments more thoroughly, and don't silently "correct" bad
arguments.
- Fix checking of minimal distance arguments. Has always been
broken, but 4.3.15 made it worse.
- Ensure the continents' first two sectors obey minimal distance.
- Correct bias in placement of expansion islands. These were more
often placed to the right of existing land. Players could
exploit that to guide their search for land.
- Fix island growth and correct its bias. Growth could fail even
when there was space to grow. Islands tended to curve around
obstacles in a counterclockwise direction. Besides fixing that,
the new code also gives better results for high spike
percentages: it produces shorter spikes extending from a core
rather than long snakes that tend to curve into themselves, and
is less prone to put capitals on the coast.
- Size and place expansion islands fairly: ensure each start island
"owns" the exact same set of expansion islands, where "owns"
means it's closer than any other start island.
- To make that work, fairland now requires the number of expansion
islands to be a multiple of the number of continents, and fails
when it can't place all the islands the deity asks for. You
can't fill the world with islands anymore by asking for
impossibly many of them.
- Fix silent failure to place place mountains. Fairness issue.
- Fix unfair mountain resources. Neglected when Empire 3 made
mountains produce gold dust.
- Drop undocumented, silent limit of 1000 mountains per island.
- Location of resources is more varied, in particular for islands
with few mountains, and for sea. Resource remain pretty much the
same overall.
- Performance improves for large minimal distances, especially for
crowded worlds. It can suffer for huge worlds and small minimal
distances.
- Manual page improvements.
- Code refactoring and cleanup.
* Test suite improvements:
- Fix empdump-test for "make check-accept". Has been broken its
addition in 4.3.33.
- Improve give and edit coverage.
- Cover load and tend. There are known gaps.
- Improve fairland coverage.
* Game customization improvements:
- Configuration tables now have more extra space deities can use
for customizing their games: 31 product types, 63 sector types,
127 ship, plane and land unit types, and 63 nuke types.
- Work to produce stuff is now independently configurable, and
"show product" shows it. Before, it was a function of raw
materials and resource use.
* New product selector "bwork" is work to build one unit of the
product.
* Fix build with compilers that require the depcomp wrapper for
dependency tracking. Broken in 4.3.31.
* Fix LWP signal code. Messed up in 4.3.6, some more in 4.3.10.
* Improve POSIX conformance for portability. Observed to fix the
build on Solaris 10.
* The client's password prompt now behaves the same on all POSIX
systems: read from standard input in canonical mode with echo
turned off. Before, it commonly read from /dev/tty in noncanonical
mode.
* The server crashed on systems when bomb, launch and interdiction
miss the target. Fix that.
* Fix truncated "info Empire4.3" on systems with a losing nroff.
* Make client's fancy line editing and persistent history work on
more systems.
* Fix ground combat not to wipe out commodities supplied to defending
land units. Broken in 4.3.33.
* Don't permit SAMs on escort missions. They work, apart from a
recoverable internal error, but it makes no sense.
* Don't permit marine missiles on support missions. They can't
actually go.
* Drop support for ABM and a-sat missiles consuming shells. The
shell use is logistical busy-work, and economically irrelevant.
The stock game's abm type didn't consume any, but its asat type
did.
* Stricter plane configuration validation.
* Increase mountain process efficiency from 75% to 100%. Gold
resources in mountains are now worth the same as elsewhere, and a
third more than before.
* Fix crash when a deity runs neweff or production on a sea sector.
Broken in 4.4.0.
* Don't let embarked engineers work. Screwed up when the command was
added in Empire 2.
* Fix buy error messages on concurrent lot change.
* Code refactoring and cleanup.
* Info page, manual page and documentation fixes and clarifications.
Changes to Empire 4.4.0 - Sun Sep 3 2017
* Don't increase negative ship and land unit mobility to zero on
trade.
* Client improvements
* Client improvements:
- Support fancy line editing and persistent history when compiled
with the GNU readline library. Contributed by Martin Haukeli.
- Fix misdetection of input EOF in obscure circumstances.
@ -176,8 +295,8 @@ Changes to Empire 4.4.0 - Sun Sep 3 2017
- sect-chr field "cost" is now money to build 100% (was: cost to
designate). It replaces field "build" (money to build 1%).
- New sect-chr, ship-chr, plane-chr, land-chr and nuke-chr field
"bwork" field "bwork" is work to build 100% sector efficiency.
Tearing down a sector costs one fourth as much.
"bwork" is work to build 100% sector efficiency. Tearing down a
sector costs one fourth as much.
- New sect-chr field "flags", backed by new table sect-chr-flags.
The only flag so far is "deity", which marks sectors mortals
can't designate.

View file

@ -53,10 +53,10 @@ Use the "improve" command to improve the infrastructure of your sectors.
To find out the required amounts of materials, mobility, and money
use the "show sect build" command.
.s1
Also, defensive infrastructure is not always improvable. See the version
info to see if the DEFENSE_INFRA option is enabled or not. If it is not
enabled, the defense infrastructure of the sector is always the same
as the efficiency of the sector. If it is enabled, you must improve your
sectors defensive values using the "improve" command.
Also, defensive infrastructure is not always improvable. See "show
sector b" to find out. If it is not enabled, the defense
infrastructure of the sector is always the same as the efficiency of
the sector. If it is enabled, you must improve your sectors defensive
values using the "improve" command.
.s1
.SA "improve, sinfrastructure, Mobility, Sectors"

View file

@ -225,9 +225,10 @@ cargo-carrying ability
.L VTOL
vertical take-off ability -- no need to use airports
.L missile
missile -- one shot, can be launched (see info launch). "marine"
missiles may only be fired at ships, "tactical" missiles which don't
have "marine" capability may only be fired at sectors.
missile -- One-shot. Can either intercept planes (ability intercept),
intercept tactical missiles (ability SDI), attack and intercept
satellites (ability satellite), attack and interdict ships (ability
marine), or attack and interdict on land (ability tactical).
.L light
light, can land on carriers or be carried on a submarine
.L spy
@ -302,4 +303,4 @@ as1 anti-sub plane 1 tactical ASW
f2 fighter 2 tactical intercept
es escort tactical escort
.FI
.SA "fly, build, show, Planes"
.SA "fly, launch, build, show, Planes"

View file

@ -57,16 +57,16 @@ Mining a \*Qnatural resource\*U such as fertility
takes one unit of work;
e.g., it takes 1 unit of work per unit of food produced.
.s1
How many products each unit of production makes depends on the level
How many products each unit of production makes depends on the
production efficiency, which is the product's level p.e. (shown by
"show product") times the sector type's p.e. (shown by "show sect
capabilities"). Production requires a level p.e. above zero, obviously.
capabilities"). Production requires a p.e. above zero, obviously.
.s1
Say your country is at tech level 25. Then your agribusinesses' level
Say your country is at tech level 25. Then your agribusinesses'
p.e. is (25+10)/(25+20) * 900% = 7, i.e. they'll make 7 food per unit
of production. Your shell industries' level p.e. is only
of production. Your shell industries' p.e. is only
(25-20)/(25-10) * 100% = 1/3, i.e. they'll make 1 shell per three
units of production. Your uranium mines can't produce at all, because
their level p.e. is negative.
their p.e. is negative.
.s1
.SA "Producing, Updates, Item-types"

View file

@ -212,11 +212,9 @@ land units can carry up to two spies.
.L pln
The number of 'light' planes the ship can carry.
.L hel
The number of helicopters the ship can carry. (If the SHIPCHOPPER option is
enabled)
The number of helicopters the ship can carry.
.L xpl
The number of extra-light planes the ship can carry. (If the XLIGHT option is
enabled)
The number of extra-light planes the ship can carry.
.in
.s1
Each ship can carry a certain amount of products and has certain

View file

@ -1,7 +1,7 @@
#!/usr/bin/perl
#
# Empire - A multi-player, client/server Internet based war game.
# Copyright (C) 1986-2020, Dave Pare, Jeff Bailey, Thomas Ruschak,
# Copyright (C) 1986-2021, Dave Pare, Jeff Bailey, Thomas Ruschak,
# Ken Stevens, Steve McClure, Markus Armbruster
#
# Empire is free software: you can redistribute it and/or modify

View file

@ -1,7 +1,7 @@
#!/usr/bin/perl
#
# Empire - A multi-player, client/server Internet based war game.
# Copyright (C) 1986-2020, Dave Pare, Jeff Bailey, Thomas Ruschak,
# Copyright (C) 1986-2021, Dave Pare, Jeff Bailey, Thomas Ruschak,
# Ken Stevens, Steve McClure, Markus Armbruster
#
# Empire is free software: you can redistribute it and/or modify

View file

@ -1,7 +1,7 @@
#!/usr/bin/perl
#
# Empire - A multi-player, client/server Internet based war game.
# Copyright (C) 1986-2020, Dave Pare, Jeff Bailey, Thomas Ruschak,
# Copyright (C) 1986-2021, Dave Pare, Jeff Bailey, Thomas Ruschak,
# Ken Stevens, Steve McClure, Markus Armbruster
#
# Empire is free software: you can redistribute it and/or modify

View file

@ -85,8 +85,8 @@ efficiency / 100.
The power value of a ship, plane, land unit or nuke is the power value
of the materials and money needed to build * efficiency / 100.
.s1
The power value of commodities is amount * type factor. \*Qshow
item\*U shows the type factor in column \*Qpower\*U.
The power value of commodities is amount * type factor / 1000.
\*Qshow item\*U shows the type factor in column \*Qpower\*U.
.s1
Efficiency is in percent.
.s1

View file

@ -91,7 +91,7 @@ The person to annoy if something goes wrong is:
You can get your own copy of the source from <http://www.wolfpackempire.com/>.
Copyright (C) 1986-2020, Dave Pare, Jeff Bailey, Thomas Ruschak,
Copyright (C) 1986-2021, Dave Pare, Jeff Bailey, Thomas Ruschak,
Ken Stevens, Steve McClure, Markus Armbruster
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

View file

@ -1,5 +1,5 @@
# ===========================================================================
# http://www.gnu.org/software/autoconf-archive/ax_append_flag.html
# https://www.gnu.org/software/autoconf-archive/ax_append_flag.html
# ===========================================================================
#
# SYNOPSIS
@ -23,33 +23,12 @@
# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
# Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com>
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation, either version 3 of the License, or (at your
# option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
# Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
#
# As a special exception, the respective Autoconf Macro's copyright owner
# gives unlimited permission to copy, distribute and modify the configure
# scripts that are the output of Autoconf when processing the Macro. You
# need not follow the terms of the GNU General Public License when using
# or distributing such scripts, even though portions of the text of the
# Macro appear in them. The GNU General Public License (GPL) does govern
# all other use of the material that constitutes the Autoconf Macro.
#
# This special exception to the GPL applies to versions of the Autoconf
# Macro released by the Autoconf Archive. When you make and distribute a
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice
# and this notice are preserved. This file is offered as-is, without any
# warranty.
#serial 6
#serial 8
AC_DEFUN([AX_APPEND_FLAG],
[dnl

View file

@ -1,5 +1,5 @@
# ===========================================================================
# http://www.gnu.org/software/autoconf-archive/ax_append_link_flags.html
# https://www.gnu.org/software/autoconf-archive/ax_append_link_flags.html
# ===========================================================================
#
# SYNOPSIS
@ -28,33 +28,12 @@
#
# Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com>
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation, either version 3 of the License, or (at your
# option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
# Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
#
# As a special exception, the respective Autoconf Macro's copyright owner
# gives unlimited permission to copy, distribute and modify the configure
# scripts that are the output of Autoconf when processing the Macro. You
# need not follow the terms of the GNU General Public License when using
# or distributing such scripts, even though portions of the text of the
# Macro appear in them. The GNU General Public License (GPL) does govern
# all other use of the material that constitutes the Autoconf Macro.
#
# This special exception to the GPL applies to versions of the Autoconf
# Macro released by the Autoconf Archive. When you make and distribute a
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice
# and this notice are preserved. This file is offered as-is, without any
# warranty.
#serial 5
#serial 7
AC_DEFUN([AX_APPEND_LINK_FLAGS],
[AX_REQUIRE_DEFINED([AX_CHECK_LINK_FLAG])

View file

@ -1,5 +1,5 @@
# ===========================================================================
# http://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html
# https://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html
# ===========================================================================
#
# SYNOPSIS
@ -29,33 +29,12 @@
# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
# Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com>
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation, either version 3 of the License, or (at your
# option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
# Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
#
# As a special exception, the respective Autoconf Macro's copyright owner
# gives unlimited permission to copy, distribute and modify the configure
# scripts that are the output of Autoconf when processing the Macro. You
# need not follow the terms of the GNU General Public License when using
# or distributing such scripts, even though portions of the text of the
# Macro appear in them. The GNU General Public License (GPL) does govern
# all other use of the material that constitutes the Autoconf Macro.
#
# This special exception to the GPL applies to versions of the Autoconf
# Macro released by the Autoconf Archive. When you make and distribute a
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice
# and this notice are preserved. This file is offered as-is, without any
# warranty.
#serial 4
#serial 6
AC_DEFUN([AX_CHECK_COMPILE_FLAG],
[AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF

View file

@ -1,5 +1,5 @@
# ===========================================================================
# http://www.gnu.org/software/autoconf-archive/ax_check_link_flag.html
# https://www.gnu.org/software/autoconf-archive/ax_check_link_flag.html
# ===========================================================================
#
# SYNOPSIS
@ -29,33 +29,12 @@
# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
# Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com>
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation, either version 3 of the License, or (at your
# option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
# Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
#
# As a special exception, the respective Autoconf Macro's copyright owner
# gives unlimited permission to copy, distribute and modify the configure
# scripts that are the output of Autoconf when processing the Macro. You
# need not follow the terms of the GNU General Public License when using
# or distributing such scripts, even though portions of the text of the
# Macro appear in them. The GNU General Public License (GPL) does govern
# all other use of the material that constitutes the Autoconf Macro.
#
# This special exception to the GPL applies to versions of the Autoconf
# Macro released by the Autoconf Archive. When you make and distribute a
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice
# and this notice are preserved. This file is offered as-is, without any
# warranty.
#serial 4
#serial 6
AC_DEFUN([AX_CHECK_LINK_FLAG],
[AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF

View file

@ -1,5 +1,5 @@
# ===========================================================================
# http://www.gnu.org/software/autoconf-archive/ax_lib_socket_nsl.html
# https://www.gnu.org/software/autoconf-archive/ax_lib_socket_nsl.html
# ===========================================================================
#
# SYNOPSIS
@ -28,7 +28,7 @@
# and this notice are preserved. This file is offered as-is, without any
# warranty.
#serial 6
#serial 7
AU_ALIAS([LIB_SOCKET_NSL], [AX_LIB_SOCKET_NSL])
AC_DEFUN([AX_LIB_SOCKET_NSL],

View file

@ -1,5 +1,5 @@
# ===========================================================================
# http://www.gnu.org/software/autoconf-archive/ax_pthread.html
# https://www.gnu.org/software/autoconf-archive/ax_pthread.html
# ===========================================================================
#
# SYNOPSIS
@ -19,10 +19,10 @@
# is necessary on AIX to use the special cc_r compiler alias.)
#
# NOTE: You are assumed to not only compile your program with these flags,
# but also link it with them as well. e.g. you should link with
# but also to link with them as well. For example, you might link with
# $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS
#
# If you are only building threads programs, you may wish to use these
# If you are only building threaded programs, you may wish to use these
# variables in your default LIBS, CFLAGS, and CC:
#
# LIBS="$PTHREAD_LIBS $LIBS"
@ -30,8 +30,8 @@
# CC="$PTHREAD_CC"
#
# In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant
# has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to that name
# (e.g. PTHREAD_CREATE_UNDETACHED on AIX).
# has a nonstandard name, this macro defines PTHREAD_CREATE_JOINABLE to
# that name (e.g. PTHREAD_CREATE_UNDETACHED on AIX).
#
# Also HAVE_PTHREAD_PRIO_INHERIT is defined if pthread is found and the
# PTHREAD_PRIO_INHERIT symbol is defined when compiling with
@ -55,6 +55,7 @@
#
# Copyright (c) 2008 Steven G. Johnson <stevenj@alum.mit.edu>
# Copyright (c) 2011 Daniel Richard G. <skunk@iSKUNK.ORG>
# Copyright (c) 2019 Marc Stevens <marc.stevens@cwi.nl>
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
@ -67,7 +68,7 @@
# Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
# with this program. If not, see <https://www.gnu.org/licenses/>.
#
# As a special exception, the respective Autoconf Macro's copyright owner
# gives unlimited permission to copy, distribute and modify the configure
@ -82,35 +83,40 @@
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.
#serial 21
#serial 27
AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD])
AC_DEFUN([AX_PTHREAD], [
AC_REQUIRE([AC_CANONICAL_HOST])
AC_REQUIRE([AC_PROG_CC])
AC_REQUIRE([AC_PROG_SED])
AC_LANG_PUSH([C])
ax_pthread_ok=no
# We used to check for pthread.h first, but this fails if pthread.h
# requires special compiler flags (e.g. on True64 or Sequent).
# requires special compiler flags (e.g. on Tru64 or Sequent).
# It gets checked for in the link test anyway.
# First of all, check if the user has set any of the PTHREAD_LIBS,
# etcetera environment variables, and if threads linking works using
# them:
if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then
save_CFLAGS="$CFLAGS"
if test "x$PTHREAD_CFLAGS$PTHREAD_LIBS" != "x"; then
ax_pthread_save_CC="$CC"
ax_pthread_save_CFLAGS="$CFLAGS"
ax_pthread_save_LIBS="$LIBS"
AS_IF([test "x$PTHREAD_CC" != "x"], [CC="$PTHREAD_CC"])
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
save_LIBS="$LIBS"
LIBS="$PTHREAD_LIBS $LIBS"
AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS])
AC_TRY_LINK_FUNC([pthread_join], [ax_pthread_ok=yes])
AC_MSG_CHECKING([for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS])
AC_LINK_IFELSE([AC_LANG_CALL([], [pthread_join])], [ax_pthread_ok=yes])
AC_MSG_RESULT([$ax_pthread_ok])
if test x"$ax_pthread_ok" = xno; then
if test "x$ax_pthread_ok" = "xno"; then
PTHREAD_LIBS=""
PTHREAD_CFLAGS=""
fi
LIBS="$save_LIBS"
CFLAGS="$save_CFLAGS"
CC="$ax_pthread_save_CC"
CFLAGS="$ax_pthread_save_CFLAGS"
LIBS="$ax_pthread_save_LIBS"
fi
# We must check for the threads library under a number of different
@ -118,12 +124,14 @@ fi
# (e.g. DEC) have both -lpthread and -lpthreads, where one of the
# libraries is broken (non-POSIX).
# Create a list of thread flags to try. Items starting with a "-" are
# C compiler flags, and other items are library names, except for "none"
# which indicates that we try without any flags at all, and "pthread-config"
# which is a program returning the flags for the Pth emulation library.
# Create a list of thread flags to try. Items with a "," contain both
# C compiler flags (before ",") and linker flags (after ","). Other items
# starting with a "-" are C compiler flags, and remaining items are
# library names, except for "none" which indicates that we try without
# any flags at all, and "pthread-config" which is a program returning
# the flags for the Pth emulation library.
ax_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
ax_pthread_flags="pthreads none -Kthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
# The ordering *is* (sometimes) important. Some notes on the
# individual items follow:
@ -132,82 +140,163 @@ ax_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mt
# none: in case threads are in libc; should be tried before -Kthread and
# other compiler flags to prevent continual compiler warnings
# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads)
# -pthreads: Solaris/gcc
# -mthreads: Mingw32/gcc, Lynx/gcc
# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads), Tru64
# (Note: HP C rejects this with "bad form for `-t' option")
# -pthreads: Solaris/gcc (Note: HP C also rejects)
# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
# doesn't hurt to check since this sometimes defines pthreads too;
# also defines -D_REENTRANT)
# ... -mt is also the pthreads flag for HP/aCC
# doesn't hurt to check since this sometimes defines pthreads and
# -D_REENTRANT too), HP C (must be checked before -lpthread, which
# is present but should not be used directly; and before -mthreads,
# because the compiler interprets this as "-mt" + "-hreads")
# -mthreads: Mingw32/gcc, Lynx/gcc
# pthread: Linux, etcetera
# --thread-safe: KAI C++
# pthread-config: use pthread-config program (for GNU Pth library)
case ${host_os} in
case $host_os in
freebsd*)
# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
ax_pthread_flags="-kthread lthread $ax_pthread_flags"
;;
hpux*)
# From the cc(1) man page: "[-mt] Sets various -D flags to enable
# multi-threading and also sets -lpthread."
ax_pthread_flags="-mt -pthread pthread $ax_pthread_flags"
;;
openedition*)
# IBM z/OS requires a feature-test macro to be defined in order to
# enable POSIX threads at all, so give the user a hint if this is
# not set. (We don't define these ourselves, as they can affect
# other portions of the system API in unpredictable ways.)
AC_EGREP_CPP([AX_PTHREAD_ZOS_MISSING],
[
# if !defined(_OPEN_THREADS) && !defined(_UNIX03_THREADS)
AX_PTHREAD_ZOS_MISSING
# endif
],
[AC_MSG_WARN([IBM z/OS requires -D_OPEN_THREADS or -D_UNIX03_THREADS to enable pthreads support.])])
;;
solaris*)
# On Solaris (at least, for some versions), libc contains stubbed
# (non-functional) versions of the pthreads routines, so link-based
# tests will erroneously succeed. (We need to link with -pthreads/-mt/
# -lpthread.) (The stubs are missing pthread_cleanup_push, or rather
# a function called by this macro, so we could check for that, but
# who knows whether they'll stub that too in a future libc.) So,
# we'll just look for -pthreads and -lpthread first:
# tests will erroneously succeed. (N.B.: The stubs are missing
# pthread_cleanup_push, or rather a function called by this macro,
# so we could check for that, but who knows whether they'll stub
# that too in a future libc.) So we'll check first for the
# standard Solaris way of linking pthreads (-mt -lpthread).
ax_pthread_flags="-pthreads pthread -mt -pthread $ax_pthread_flags"
;;
darwin*)
ax_pthread_flags="-pthread $ax_pthread_flags"
ax_pthread_flags="-mt,-lpthread pthread $ax_pthread_flags"
;;
esac
# Clang doesn't consider unrecognized options an error unless we specify
# -Werror. We throw in some extra Clang-specific options to ensure that
# this doesn't happen for GCC, which also accepts -Werror.
# Are we compiling with Clang?
AC_MSG_CHECKING([if compiler needs -Werror to reject unknown flags])
save_CFLAGS="$CFLAGS"
ax_pthread_extra_flags="-Werror"
CFLAGS="$CFLAGS $ax_pthread_extra_flags -Wunknown-warning-option -Wsizeof-array-argument"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([int foo(void);],[foo()])],
[AC_MSG_RESULT([yes])],
[ax_pthread_extra_flags=
AC_MSG_RESULT([no])])
CFLAGS="$save_CFLAGS"
AC_CACHE_CHECK([whether $CC is Clang],
[ax_cv_PTHREAD_CLANG],
[ax_cv_PTHREAD_CLANG=no
# Note that Autoconf sets GCC=yes for Clang as well as GCC
if test "x$GCC" = "xyes"; then
AC_EGREP_CPP([AX_PTHREAD_CC_IS_CLANG],
[/* Note: Clang 2.7 lacks __clang_[a-z]+__ */
# if defined(__clang__) && defined(__llvm__)
AX_PTHREAD_CC_IS_CLANG
# endif
],
[ax_cv_PTHREAD_CLANG=yes])
fi
])
ax_pthread_clang="$ax_cv_PTHREAD_CLANG"
if test x"$ax_pthread_ok" = xno; then
for flag in $ax_pthread_flags; do
case $flag in
# GCC generally uses -pthread, or -pthreads on some platforms (e.g. SPARC)
# Note that for GCC and Clang -pthread generally implies -lpthread,
# except when -nostdlib is passed.
# This is problematic using libtool to build C++ shared libraries with pthread:
# [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25460
# [2] https://bugzilla.redhat.com/show_bug.cgi?id=661333
# [3] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=468555
# To solve this, first try -pthread together with -lpthread for GCC
AS_IF([test "x$GCC" = "xyes"],
[ax_pthread_flags="-pthread,-lpthread -pthread -pthreads $ax_pthread_flags"])
# Clang takes -pthread (never supported any other flag), but we'll try with -lpthread first
AS_IF([test "x$ax_pthread_clang" = "xyes"],
[ax_pthread_flags="-pthread,-lpthread -pthread"])
# The presence of a feature test macro requesting re-entrant function
# definitions is, on some systems, a strong hint that pthreads support is
# correctly enabled
case $host_os in
darwin* | hpux* | linux* | osf* | solaris*)
ax_pthread_check_macro="_REENTRANT"
;;
aix*)
ax_pthread_check_macro="_THREAD_SAFE"
;;
*)
ax_pthread_check_macro="--"
;;
esac
AS_IF([test "x$ax_pthread_check_macro" = "x--"],
[ax_pthread_check_cond=0],
[ax_pthread_check_cond="!defined($ax_pthread_check_macro)"])
if test "x$ax_pthread_ok" = "xno"; then
for ax_pthread_try_flag in $ax_pthread_flags; do
case $ax_pthread_try_flag in
none)
AC_MSG_CHECKING([whether pthreads work without any flags])
;;
*,*)
PTHREAD_CFLAGS=`echo $ax_pthread_try_flag | sed "s/^\(.*\),\(.*\)$/\1/"`
PTHREAD_LIBS=`echo $ax_pthread_try_flag | sed "s/^\(.*\),\(.*\)$/\2/"`
AC_MSG_CHECKING([whether pthreads work with "$PTHREAD_CFLAGS" and "$PTHREAD_LIBS"])
;;
-*)
AC_MSG_CHECKING([whether pthreads work with $flag])
PTHREAD_CFLAGS="$flag"
AC_MSG_CHECKING([whether pthreads work with $ax_pthread_try_flag])
PTHREAD_CFLAGS="$ax_pthread_try_flag"
;;
pthread-config)
AC_CHECK_PROG([ax_pthread_config], [pthread-config], [yes], [no])
if test x"$ax_pthread_config" = xno; then continue; fi
AS_IF([test "x$ax_pthread_config" = "xno"], [continue])
PTHREAD_CFLAGS="`pthread-config --cflags`"
PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
;;
*)
AC_MSG_CHECKING([for the pthreads library -l$flag])
PTHREAD_LIBS="-l$flag"
AC_MSG_CHECKING([for the pthreads library -l$ax_pthread_try_flag])
PTHREAD_LIBS="-l$ax_pthread_try_flag"
;;
esac
save_LIBS="$LIBS"
save_CFLAGS="$CFLAGS"
ax_pthread_save_CFLAGS="$CFLAGS"
ax_pthread_save_LIBS="$LIBS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
LIBS="$PTHREAD_LIBS $LIBS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS $ax_pthread_extra_flags"
# Check for various functions. We must include pthread.h,
# since some functions may be macros. (On the Sequent, we
@ -218,8 +307,18 @@ for flag in $ax_pthread_flags; do
# pthread_cleanup_push because it is one of the few pthread
# functions on Solaris that doesn't have a non-functional libc stub.
# We try pthread_create on general principles.
AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>
static void routine(void *a) { a = 0; }
# if $ax_pthread_check_cond
# error "$ax_pthread_check_macro must be defined"
# endif
static void *some_global = NULL;
static void routine(void *a)
{
/* To avoid any unused-parameter or
unused-but-set-parameter warning. */
some_global = a;
}
static void *start_routine(void *a) { return a; }],
[pthread_t th; pthread_attr_t attr;
pthread_create(&th, 0, start_routine, 0);
@ -227,88 +326,164 @@ for flag in $ax_pthread_flags; do
pthread_attr_init(&attr);
pthread_cleanup_push(routine, 0);
pthread_cleanup_pop(0) /* ; */])],
[ax_pthread_ok=yes],
[])
[ax_pthread_ok=yes],
[])
LIBS="$save_LIBS"
CFLAGS="$save_CFLAGS"
CFLAGS="$ax_pthread_save_CFLAGS"
LIBS="$ax_pthread_save_LIBS"
AC_MSG_RESULT([$ax_pthread_ok])
if test "x$ax_pthread_ok" = xyes; then
break;
fi
AS_IF([test "x$ax_pthread_ok" = "xyes"], [break])
PTHREAD_LIBS=""
PTHREAD_CFLAGS=""
done
fi
# Clang needs special handling, because older versions handle the -pthread
# option in a rather... idiosyncratic way
if test "x$ax_pthread_clang" = "xyes"; then
# Clang takes -pthread; it has never supported any other flag
# (Note 1: This will need to be revisited if a system that Clang
# supports has POSIX threads in a separate library. This tends not
# to be the way of modern systems, but it's conceivable.)
# (Note 2: On some systems, notably Darwin, -pthread is not needed
# to get POSIX threads support; the API is always present and
# active. We could reasonably leave PTHREAD_CFLAGS empty. But
# -pthread does define _REENTRANT, and while the Darwin headers
# ignore this macro, third-party headers might not.)
# However, older versions of Clang make a point of warning the user
# that, in an invocation where only linking and no compilation is
# taking place, the -pthread option has no effect ("argument unused
# during compilation"). They expect -pthread to be passed in only
# when source code is being compiled.
#
# Problem is, this is at odds with the way Automake and most other
# C build frameworks function, which is that the same flags used in
# compilation (CFLAGS) are also used in linking. Many systems
# supported by AX_PTHREAD require exactly this for POSIX threads
# support, and in fact it is often not straightforward to specify a
# flag that is used only in the compilation phase and not in
# linking. Such a scenario is extremely rare in practice.
#
# Even though use of the -pthread flag in linking would only print
# a warning, this can be a nuisance for well-run software projects
# that build with -Werror. So if the active version of Clang has
# this misfeature, we search for an option to squash it.
AC_CACHE_CHECK([whether Clang needs flag to prevent "argument unused" warning when linking with -pthread],
[ax_cv_PTHREAD_CLANG_NO_WARN_FLAG],
[ax_cv_PTHREAD_CLANG_NO_WARN_FLAG=unknown
# Create an alternate version of $ac_link that compiles and
# links in two steps (.c -> .o, .o -> exe) instead of one
# (.c -> exe), because the warning occurs only in the second
# step
ax_pthread_save_ac_link="$ac_link"
ax_pthread_sed='s/conftest\.\$ac_ext/conftest.$ac_objext/g'
ax_pthread_link_step=`$as_echo "$ac_link" | sed "$ax_pthread_sed"`
ax_pthread_2step_ac_link="($ac_compile) && (echo ==== >&5) && ($ax_pthread_link_step)"
ax_pthread_save_CFLAGS="$CFLAGS"
for ax_pthread_try in '' -Qunused-arguments -Wno-unused-command-line-argument unknown; do
AS_IF([test "x$ax_pthread_try" = "xunknown"], [break])
CFLAGS="-Werror -Wunknown-warning-option $ax_pthread_try -pthread $ax_pthread_save_CFLAGS"
ac_link="$ax_pthread_save_ac_link"
AC_LINK_IFELSE([AC_LANG_SOURCE([[int main(void){return 0;}]])],
[ac_link="$ax_pthread_2step_ac_link"
AC_LINK_IFELSE([AC_LANG_SOURCE([[int main(void){return 0;}]])],
[break])
])
done
ac_link="$ax_pthread_save_ac_link"
CFLAGS="$ax_pthread_save_CFLAGS"
AS_IF([test "x$ax_pthread_try" = "x"], [ax_pthread_try=no])
ax_cv_PTHREAD_CLANG_NO_WARN_FLAG="$ax_pthread_try"
])
case "$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" in
no | unknown) ;;
*) PTHREAD_CFLAGS="$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG $PTHREAD_CFLAGS" ;;
esac
fi # $ax_pthread_clang = yes
# Various other checks:
if test "x$ax_pthread_ok" = xyes; then
save_LIBS="$LIBS"
LIBS="$PTHREAD_LIBS $LIBS"
save_CFLAGS="$CFLAGS"
if test "x$ax_pthread_ok" = "xyes"; then
ax_pthread_save_CFLAGS="$CFLAGS"
ax_pthread_save_LIBS="$LIBS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
LIBS="$PTHREAD_LIBS $LIBS"
# Detect AIX lossage: JOINABLE attribute is called UNDETACHED.
AC_MSG_CHECKING([for joinable pthread attribute])
attr_name=unknown
for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do
AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>],
[int attr = $attr; return attr /* ; */])],
[attr_name=$attr; break],
[])
done
AC_MSG_RESULT([$attr_name])
if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then
AC_DEFINE_UNQUOTED([PTHREAD_CREATE_JOINABLE], [$attr_name],
[Define to necessary symbol if this constant
uses a non-standard name on your system.])
fi
AC_CACHE_CHECK([for joinable pthread attribute],
[ax_cv_PTHREAD_JOINABLE_ATTR],
[ax_cv_PTHREAD_JOINABLE_ATTR=unknown
for ax_pthread_attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do
AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>],
[int attr = $ax_pthread_attr; return attr /* ; */])],
[ax_cv_PTHREAD_JOINABLE_ATTR=$ax_pthread_attr; break],
[])
done
])
AS_IF([test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xunknown" && \
test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xPTHREAD_CREATE_JOINABLE" && \
test "x$ax_pthread_joinable_attr_defined" != "xyes"],
[AC_DEFINE_UNQUOTED([PTHREAD_CREATE_JOINABLE],
[$ax_cv_PTHREAD_JOINABLE_ATTR],
[Define to necessary symbol if this constant
uses a non-standard name on your system.])
ax_pthread_joinable_attr_defined=yes
])
AC_MSG_CHECKING([if more special flags are required for pthreads])
flag=no
case ${host_os} in
aix* | freebsd* | darwin*) flag="-D_THREAD_SAFE";;
osf* | hpux*) flag="-D_REENTRANT";;
solaris*)
if test "$GCC" = "yes"; then
flag="-D_REENTRANT"
else
# TODO: What about Clang on Solaris?
flag="-mt -D_REENTRANT"
fi
;;
esac
AC_MSG_RESULT([$flag])
if test "x$flag" != xno; then
PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS"
fi
AC_CACHE_CHECK([whether more special flags are required for pthreads],
[ax_cv_PTHREAD_SPECIAL_FLAGS],
[ax_cv_PTHREAD_SPECIAL_FLAGS=no
case $host_os in
solaris*)
ax_cv_PTHREAD_SPECIAL_FLAGS="-D_POSIX_PTHREAD_SEMANTICS"
;;
esac
])
AS_IF([test "x$ax_cv_PTHREAD_SPECIAL_FLAGS" != "xno" && \
test "x$ax_pthread_special_flags_added" != "xyes"],
[PTHREAD_CFLAGS="$ax_cv_PTHREAD_SPECIAL_FLAGS $PTHREAD_CFLAGS"
ax_pthread_special_flags_added=yes])
AC_CACHE_CHECK([for PTHREAD_PRIO_INHERIT],
[ax_cv_PTHREAD_PRIO_INHERIT], [
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <pthread.h>]],
[[int i = PTHREAD_PRIO_INHERIT;]])],
[ax_cv_PTHREAD_PRIO_INHERIT=yes],
[ax_cv_PTHREAD_PRIO_INHERIT=no])
[ax_cv_PTHREAD_PRIO_INHERIT],
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <pthread.h>]],
[[int i = PTHREAD_PRIO_INHERIT;
return i;]])],
[ax_cv_PTHREAD_PRIO_INHERIT=yes],
[ax_cv_PTHREAD_PRIO_INHERIT=no])
])
AS_IF([test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes"],
[AC_DEFINE([HAVE_PTHREAD_PRIO_INHERIT], [1], [Have PTHREAD_PRIO_INHERIT.])])
AS_IF([test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes" && \
test "x$ax_pthread_prio_inherit_defined" != "xyes"],
[AC_DEFINE([HAVE_PTHREAD_PRIO_INHERIT], [1], [Have PTHREAD_PRIO_INHERIT.])
ax_pthread_prio_inherit_defined=yes
])
LIBS="$save_LIBS"
CFLAGS="$save_CFLAGS"
CFLAGS="$ax_pthread_save_CFLAGS"
LIBS="$ax_pthread_save_LIBS"
# More AIX lossage: compile with *_r variant
if test "x$GCC" != xyes; then
if test "x$GCC" != "xyes"; then
case $host_os in
aix*)
AS_CASE(["x/$CC"],
[x*/c89|x*/c89_128|x*/c99|x*/c99_128|x*/cc|x*/cc128|x*/xlc|x*/xlc_v6|x*/xlc128|x*/xlc128_v6],
[#handle absolute path differently from PATH based program lookup
AS_CASE(["x$CC"],
[x/*],
[AS_IF([AS_EXECUTABLE_P([${CC}_r])],[PTHREAD_CC="${CC}_r"])],
[AC_CHECK_PROGS([PTHREAD_CC],[${CC}_r],[$CC])])])
[x*/c89|x*/c89_128|x*/c99|x*/c99_128|x*/cc|x*/cc128|x*/xlc|x*/xlc_v6|x*/xlc128|x*/xlc128_v6],
[#handle absolute path differently from PATH based program lookup
AS_CASE(["x$CC"],
[x/*],
[AS_IF([AS_EXECUTABLE_P([${CC}_r])],[PTHREAD_CC="${CC}_r"])],
[AC_CHECK_PROGS([PTHREAD_CC],[${CC}_r],[$CC])])])
;;
esac
fi
@ -321,7 +496,7 @@ AC_SUBST([PTHREAD_CFLAGS])
AC_SUBST([PTHREAD_CC])
# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
if test x"$ax_pthread_ok" = xyes; then
if test "x$ax_pthread_ok" = "xyes"; then
ifelse([$1],,[AC_DEFINE([HAVE_PTHREAD],[1],[Define if you have POSIX threads libraries and header files.])],[$1])
:
else

View file

@ -1,5 +1,5 @@
# ===========================================================================
# http://www.gnu.org/software/autoconf-archive/ax_require_defined.html
# https://www.gnu.org/software/autoconf-archive/ax_require_defined.html
# ===========================================================================
#
# SYNOPSIS
@ -30,7 +30,7 @@
# and this notice are preserved. This file is offered as-is, without any
# warranty.
#serial 1
#serial 2
AC_DEFUN([AX_REQUIRE_DEFINED], [dnl
m4_ifndef([$1], [m4_fatal([macro ]$1[ is not defined; is a m4 file missing?])])

View file

@ -1,40 +1,52 @@
AC_DEFUN([MY_LIB_READLINE], [
have_readline=no
for readline_lib in readline edit editline; do
for termcap_lib in "" termlib termcap curses ncurses; do
AC_CHECK_LIB([$readline_lib], [add_history],
[have_readline=yes; break 2], [], [$termcap_lib])
AC_CACHE_CHECK([for a readline compatible library],
my_cv_lib_readline, [
my_lib_readline_save_LIBS="$LIBS"
for readline_lib in readline edit editline; do
for termcap_lib in "" termlib termcap curses ncurses; do
if test -z "$termcap_lib"; then
my_cv_lib_readline="-l$readline_lib"
else
my_cv_lib_readline="-l$readline_lib -l$termcap_lib"
fi
LIBS="$my_cv_lib_readline $my_lib_readline_save_LIBS"
AC_LINK_IFELSE([AC_LANG_CALL([], [add_history])],
[break 2], [my_cv_lib_readline=no])
done
done
done
])
if test "$have_readline" = yes; then
AC_CHECK_HEADER([readline/readline.h], [], [have_readline=no],
if test "$my_cv_lib_readline" != no; then
AC_CHECK_HEADER([readline/readline.h], [], [my_cv_lib_readline=no],
[AC_INCLUDES_DEFAULT])
AC_CHECK_HEADER([readline/history.h], [], [have_readline=no],
fi
if test "$my_cv_lib_readline" != no; then
AC_CHECK_HEADER([readline/history.h], [], [my_cv_lib_readline=no],
[AC_INCLUDES_DEFAULT])
fi
if test "$have_readline" = yes; then
if test "x$termcap_lib" != x; then
LIBS="-l$termcap_lib $LIBS"
fi
LIBS="-l$readline_lib $LIBS"
if test "$my_cv_lib_readline" = no; then
LIBS="$my_lib_readline_save_LIBS"
else
AC_DEFINE([HAVE_LIBREADLINE], [1],
[Define if you have libreadline])
fi
])
AC_DEFUN([MY_WITH_READLINE],
[
AC_ARG_WITH([readline],
[AS_HELP_STRING([--with-readline],
[support fancy command line editing @<:@default=check@:>@])],
[],
[with_readline=check])
if test "x$with_readline" != xno; then
MY_LIB_READLINE
if test "x$have_readline$with_readline" = xnoyes; then
AC_MSG_FAILURE([--with-readline was given, but test for readline failed])
fi
with_readline="$have_readline"
fi])
AC_DEFUN([MY_WITH_READLINE], [
AC_ARG_WITH([readline],
[AS_HELP_STRING([--with-readline],
[support fancy command line editing @<:@default=check@:>@])],
[],
[with_readline=check])
if test "x$with_readline" != xno; then
MY_LIB_READLINE
if test "x$my_cv_lib_readline$with_readline" = xnoyes; then
AC_MSG_FAILURE([--with-readline was given, but test for readline failed])
fi
if test "$my_cv_lib_readline" = no; then
with_readline=no
else
with_readline=yes
fi
fi])

View file

@ -0,0 +1,20 @@
AC_DEFUN([MY_WORKING_IN6_IS_ADDR_V4MAPPED], [
AC_CACHE_CHECK([whether IN6_IS_ADDR_V4MAPPED works],
my_cv_func_in6_is_addr_v4mapped, [
AC_COMPILE_IFELSE(
[AC_LANG_SOURCE([[#include <netinet/in.h>
int foo(struct sockaddr_in6 *sap6)
{
return IN6_IS_ADDR_V4MAPPED(&sap6->sin6_addr);
}]])],
[my_cv_func_in6_is_addr_v4mapped=yes],
[my_cv_func_in6_is_addr_v4mapped=no])])
AC_CHECK_MEMBERS([struct sockaddr_in6.sin6_addr.s6_addr],
[my_member_sockaddr_in6_sin6_addr_s6_addr=yes],
[my_member_sockaddr_in6_sin6_addr_s6_addr=no],
[[#include <netinet/in.h>]])
if test "x$my_cv_func_in6_is_addr_v4mapped$my_member_sockaddr_in6_sin6_addr_s6_addr" = xyesyes; then
AC_DEFINE([HAVE_WORKING_IN6_IS_ADDR_V4MAPPED], [1],
[Define if you have a working IN6_IS_ADDR_V4MAPPED()])
fi
])

View file

@ -68,7 +68,7 @@ average size of additional islands (default \fIsc\fP/2)
.TP
.I sp
land spikiness (in percent, default 10), low values result in rounded
islands, high values result in snakes
islands, high values result in tentacles
.TP
.I pm
how much of each island is mountain (in percent, default 0)

View file

@ -1,7 +1,7 @@
#!/usr/bin/perl
#
# xdump example program.
# Copyright (C) 2006-2020 Markus Armbruster
# Copyright (C) 2006-2021 Markus Armbruster
#
# Empire is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by

View file

@ -1,6 +1,6 @@
#
# Empire - A multi-player, client/server Internet based war game.
# Copyright (C) 1986-2020, Dave Pare, Jeff Bailey, Thomas Ruschak,
# Copyright (C) 1986-2021, Dave Pare, Jeff Bailey, Thomas Ruschak,
# Ken Stevens, Steve McClure, Markus Armbruster
#
# Empire is free software: you can redistribute it and/or modify
@ -28,7 +28,7 @@
# Makefile.in: Makefile template for configure
#
# Known contributors to this file:
# Markus Armbruster, 2005-2015
# Markus Armbruster, 2005-2020
#
CC = @CC@
@ -53,9 +53,9 @@ srcdir = @srcdir@
VPATH = @srcdir@
prog = empire$E
obj = expect.$O fnameat.$O host.$O ipglob.$O linebuf.$O login.$O \
main.$O play.$O ringbuf.$O secure.$O servcmd.$O termlib.$O version.$O \
$(LIBOBJS)
obj = expect.$O fnameat.$O getpass.$O host.$O ipglob.$O linebuf.$O \
login.$O main.$O play.$O ringbuf.$O secure.$O servcmd.$O termlib.$O \
version.$O $(LIBOBJS)
all: $(prog)
@ -82,6 +82,7 @@ uninstall:
# FIXME generate from .d
expect.$O: misc.h proto.h
fnameat.$O: fnameat.h
getpass.$O: misc.h
host.$O: misc.h
linebuf.$O: linebuf.h
login.$O: misc.h proto.h
@ -95,8 +96,8 @@ version.$O: version.h
$(obj): config.h
expect.$O: w32/sys/socket.h w32/unistd.h w32/w32types.h
getpass.$O: w32/unistd.h w32/w32types.h
host.$O: w32/sys/socket.h w32/netinet/in.h w32/arpa/inet.h w32/netdb.h w32/unistd.h w32/w32types.h
login.$O: w32/unistd.h w32/w32types.h
main.$O: w32/sys/socket.h w32/unistd.h w32/w32types.h
play.$O: w32/sys/socket.h w32/unistd.h w32/w32types.h
ringbuf.$O: w32/sys/uio.h w32/w32types.h

View file

@ -1,7 +1,7 @@
This is the basic Empire Client.
Empire is a multi-player, client/server Internet based war game.
Copyright (C) 1986-2020, Dave Pare, Jeff Bailey, Thomas Ruschak,
Copyright (C) 1986-2021, Dave Pare, Jeff Bailey, Thomas Ruschak,
Ken Stevens, Steve McClure, Markus Armbruster
This program is free software: you can redistribute it and/or modify

View file

@ -1,6 +1,6 @@
#
# Empire - A multi-player, client/server Internet based war game.
# Copyright (C) 1986-2020, Dave Pare, Jeff Bailey, Thomas Ruschak,
# Copyright (C) 1986-2021, Dave Pare, Jeff Bailey, Thomas Ruschak,
# Ken Stevens, Steve McClure, Markus Armbruster
#
# Empire is free software: you can redistribute it and/or modify
@ -27,7 +27,7 @@
# configure.ac: Autoconf input file
#
# Known contributors to this file:
# Markus Armbruster, 2005-2016
# Markus Armbruster, 2005-2020
#
# Process this file with autoconf to produce a configure script.
@ -44,6 +44,9 @@ AC_INIT([Wolfpack Empire Client],
AC_CONFIG_SRCDIR([empire.6])
AC_CONFIG_HEADERS([config.h])
AC_DEFINE([_XOPEN_SOURCE], [600],
[Request POSIX-1.2001 with XSI Extension])
### Checks for programs.
AC_PROG_CC
@ -76,7 +79,7 @@ fi
### Checks for library functions.
AC_CHECK_FUNCS(getaddrinfo getpass)
AC_CHECK_FUNCS(getaddrinfo)
### Site configuration

View file

@ -1,6 +1,6 @@
/*
* Empire - A multi-player, client/server Internet based war game.
* Copyright (C) 1986-2020, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Copyright (C) 1986-2021, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure, Markus Armbruster
*
* Empire is free software: you can redistribute it and/or modify

103
src/client/getpass.c Normal file
View file

@ -0,0 +1,103 @@
/*
* Empire - A multi-player, client/server Internet based war game.
* Copyright (C) 1986-2021, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure, Markus Armbruster
*
* Empire is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* ---
*
* See files README, COPYING and CREDITS in the root of the source
* tree for related information and legal notices. It is expected
* that future projects/authors will amend these files as needed.
*
* ---
*
* getpass.c: Get a password
*
* Known contributors to this file:
* Markus Armbruster, 2009-2020
*/
#include <config.h>
#include <string.h>
#ifdef _WIN32
#include <windows.h>
#else
#include <termios.h>
#endif
#include "misc.h"
static int
set_echo_if_tty(int on)
{
#ifdef _WIN32
DWORD mode;
HANDLE input_handle = GetStdHandle(STD_INPUT_HANDLE);
if (!GetConsoleMode(input_handle, &mode))
return 0;
if (on)
mode |= ENABLE_ECHO_INPUT;
else
mode &= ~ENABLE_ECHO_INPUT;
if (!SetConsoleMode(input_handle, mode))
return -1;
return 1;
#else
struct termios tcattr;
if (tcgetattr(0, &tcattr) < 0)
return 0;
if (on)
tcattr.c_lflag |= ECHO;
else
tcattr.c_lflag &= ~ECHO;
if (tcsetattr(0, TCSAFLUSH, &tcattr) < 0)
return -1;
return 1;
#endif
}
char *
get_password(const char *prompt)
{
static char buf[128];
char *p;
size_t len;
int echo_set;
echo_set = set_echo_if_tty(0);
if (echo_set <= 0)
printf("Note: your input is echoed to the screen\n");
printf("%s", prompt);
fflush(stdout);
p = fgets(buf, sizeof(buf), stdin);
if (echo_set > 0)
set_echo_if_tty(1);
if (!p)
return NULL;
len = strlen(p);
if (p[len - 1] == '\n')
p[len - 1] = 0;
return p;
}

View file

@ -1,6 +1,6 @@
/*
* Empire - A multi-player, client/server Internet based war game.
* Copyright (C) 1986-2020, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Copyright (C) 1986-2021, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure, Markus Armbruster
*
* Empire is free software: you can redistribute it and/or modify

View file

@ -1,6 +1,6 @@
/*
* Empire - A multi-player, client/server Internet based war game.
* Copyright (C) 1986-2020, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Copyright (C) 1986-2021, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure, Markus Armbruster
*
* Empire is free software: you can redistribute it and/or modify

View file

@ -1,6 +1,6 @@
/*
* Empire - A multi-player, client/server Internet based war game.
* Copyright (C) 1986-2020, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Copyright (C) 1986-2021, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure, Markus Armbruster
*
* Empire is free software: you can redistribute it and/or modify

View file

@ -1,6 +1,6 @@
/*
* Empire - A multi-player, client/server Internet based war game.
* Copyright (C) 1986-2020, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Copyright (C) 1986-2021, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure, Markus Armbruster
*
* Empire is free software: you can redistribute it and/or modify

View file

@ -1,6 +1,6 @@
/*
* Empire - A multi-player, client/server Internet based war game.
* Copyright (C) 1986-2020, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Copyright (C) 1986-2021, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure, Markus Armbruster
*
* Empire is free software: you can redistribute it and/or modify
@ -29,7 +29,7 @@
* Known contributors to this file:
* Dave Pare, 1989
* Steve McClure, 1998
* Markus Armbruster, 2004-2009
* Markus Armbruster, 2004-2020
*/
#include <config.h>
@ -38,46 +38,9 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#ifdef _WIN32
#include <windows.h>
#endif
#include "misc.h"
#include "proto.h"
#ifndef HAVE_GETPASS
#define getpass ersatz_getpass
static char *
ersatz_getpass(char *prompt)
{
static char buf[128];
char *p;
size_t len;
#ifdef _WIN32
DWORD mode;
HANDLE input_handle = GetStdHandle(STD_INPUT_HANDLE);
if (GetConsoleMode(input_handle, &mode))
SetConsoleMode(input_handle, mode & ~ENABLE_ECHO_INPUT);
else
#endif
printf("Note: your input is echoed to the screen\n");
printf("%s", prompt);
fflush(stdout);
p = fgets(buf, sizeof(buf), stdin);
#ifdef _WIN32
if (GetConsoleMode(input_handle, &mode))
SetConsoleMode(input_handle, mode | ENABLE_ECHO_INPUT);
#endif
if (!p)
return NULL;
len = strlen(p);
if (p[len - 1] == '\n')
p[len - 1] = 0;
return p;
}
#endif
int
login(int s, char *uname, char *cname, char *cpass,
int kill_proc, int utf8)
@ -123,7 +86,7 @@ login(int s, char *uname, char *cname, char *cpass,
return 0;
}
if (cpass == NULL) {
cpass = getpass("Your name? ");
cpass = get_password("Your name? ");
if (cpass == NULL || *cpass == 0)
return 0;
}

View file

@ -1,6 +1,6 @@
/*
* Empire - A multi-player, client/server Internet based war game.
* Copyright (C) 1986-2020, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Copyright (C) 1986-2021, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure, Markus Armbruster
*
* Empire is free software: you can redistribute it and/or modify

View file

@ -1,6 +1,6 @@
/*
* Empire - A multi-player, client/server Internet based war game.
* Copyright (C) 1986-2020, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Copyright (C) 1986-2021, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure, Markus Armbruster
*
* Empire is free software: you can redistribute it and/or modify
@ -28,7 +28,7 @@
*
* Known contributors to this file:
* Steve McClure, 1998
* Markus Armbruster, 2004-2017
* Markus Armbruster, 2004-2020
*/
#ifndef MISC_H
@ -41,10 +41,34 @@
extern char empirehost[];
extern char empireport[];
/* expect.c */
int recvline(int s, char *buf);
int parseid(char *);
int expect(int s, int match, char *buf);
void sendcmd(int s, char *cmd, char *arg);
/* getpass.c */
char *get_password(const char *);
/* host.c */
int tcp_connect(char *, char *);
/* login.c */
int login(int s, char *uname, char *cname, char *cpass, int kill_proc, int);
/* play.c */
int play(int, char *);
void prompt(int, char *, char *);
/* servcmd.c */
extern int eight_bit_clean;
extern FILE *auxfp;
extern int restricted;
int servercmd(int, char *, int);
void outch(char);
/* termlib.c */
#ifdef HAVE_CURSES_TERMINFO
void getsose(void);
void putso(void);
@ -55,17 +79,7 @@ void putse(void);
#define putse() ((void)0)
#endif /* !HAVE_CURSES_TERMINFO */
int recvline(int s, char *buf);
int parseid(char *);
int expect(int s, int match, char *buf);
int tcp_connect(char *, char *);
int login(int s, char *uname, char *cname, char *cpass, int kill_proc, int);
int play(int, char *);
void prompt(int, char *, char *);
void sendcmd(int s, char *cmd, char *arg);
int servercmd(int, char *, int);
void outch(char);
/* Compatibility gunk for Windows */
#ifdef _MSC_VER
#define pclose _pclose
#define popen _popen

View file

@ -1,6 +1,6 @@
/*
* Empire - A multi-player, client/server Internet based war game.
* Copyright (C) 1986-2020, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Copyright (C) 1986-2021, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure, Markus Armbruster
*
* Empire is free software: you can redistribute it and/or modify

Some files were not shown because too many files have changed in this diff Show more