Compare commits
113 commits
Author | SHA1 | Date | |
---|---|---|---|
b44abaf9d4 | |||
89dc5f6d0a | |||
774ae95997 | |||
![]() |
3abb8bff60 | ||
3aa4f7404c | |||
![]() |
ca801dec14 | ||
![]() |
3af4a32def | ||
![]() |
8447fc1cd2 | ||
a164390d1f | |||
598669673e | |||
b19aa1c13f | |||
f69db5e413 | |||
e23882161e | |||
4914daa587 | |||
1f6b79dd10 | |||
b770ac4ba8 | |||
dc793ea0a1 | |||
bfac52eb6d | |||
539c44a13a | |||
c6ec6a41c2 | |||
a6c46316e9 | |||
a021a20e55 | |||
1b677a4578 | |||
e23e4cd738 | |||
5f3c64c062 | |||
223add6a92 | |||
1d8451e87b | |||
8c9a383fa1 | |||
992ab36b59 | |||
9e9355da41 | |||
5d23a13fef | |||
c347db0551 | |||
0b46e31d60 | |||
61f0762eaa | |||
f8ccf1d918 | |||
bdd2a7a764 | |||
7b24e312e3 | |||
da9d5c6404 | |||
628e2e8e82 | |||
df7e8b3d21 | |||
125b5df9af | |||
52e540d62a | |||
cadb6e7f29 | |||
e14c5326e3 | |||
06487a46a3 | |||
87952c7f7c | |||
7714a8cb82 | |||
c48abacad2 | |||
a0d1f63729 | |||
ae421dafc2 | |||
55ff9cce09 | |||
55c1d29efe | |||
9556c6bd65 | |||
18e392c470 | |||
fef643031c | |||
ec4004b4d4 | |||
a830df0553 | |||
9d87eb9e22 | |||
37c69a3a7a | |||
d6c5c263b9 | |||
8e00a61812 | |||
54b1e7e167 | |||
691d0a27c1 | |||
c1f1344afe | |||
f7ae50261f | |||
2ae769bec4 | |||
37f2076a7d | |||
40cee426b7 | |||
2e4793408c | |||
460cc9e2ee | |||
aae823507c | |||
f15bb68b63 | |||
2c12238ecb | |||
7b9e579408 | |||
566b9fdbbe | |||
168db3b248 | |||
10356f9ecf | |||
53591e85d5 | |||
015b93b71c | |||
f57c71da92 | |||
e7583a519e | |||
6bad464348 | |||
d1b844c6eb | |||
c506cd7ed2 | |||
2e95ea6d80 | |||
90bb0f7fa3 | |||
6babfefdb0 | |||
82ed4c9d25 | |||
8dab67c116 | |||
ec9633b901 | |||
524c70659c | |||
e59451f0d9 | |||
6642878d5f | |||
8c15a3fe32 | |||
b6b32f02be | |||
6880908937 | |||
dd9bda62eb | |||
7ce7440a34 | |||
aed94594f1 | |||
b3d564c8ae | |||
72f88eefd8 | |||
fb2bd2408e | |||
7f1bbcad94 | |||
fd164c5860 | |||
56c014806e | |||
696d31460c | |||
8d0c196c8b | |||
ae988c00ba | |||
00bfeb833e | |||
d434e0cc87 | |||
d9425bb5da | |||
96c57d5ad7 | |||
494ab8dc07 |
482 changed files with 11254 additions and 8672 deletions
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -60,3 +60,7 @@
|
|||
*.orig
|
||||
*.rej
|
||||
*~
|
||||
|
||||
# Visual Studio Directories for building
|
||||
/.vs
|
||||
/Empire
|
||||
|
|
|
@ -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
318
INSTALL
|
@ -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.
|
||||
|
|
67
Make.mk
67
Make.mk
|
@ -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
|
||||
|
@ -81,8 +81,8 @@ edatadir := $(datadir)/empire
|
|||
builtindir := $(edatadir)/builtin
|
||||
einfodir := $(edatadir)/info.nr
|
||||
ehtmldir := $(edatadir)/info.html
|
||||
client/w32 := arpa/inet.h netdb.h netinet/in.h sys/time.h sys/socket.h \
|
||||
sys/uio.h unistd.h w32io.c w32sockets.c w32types.h
|
||||
client/w32 := arpa/inet.h getopt.c netdb.h netinet/in.h sys/time.h \
|
||||
sys/socket.h sys/uio.h unistd.h w32io.c w32sockets.c w32types.h
|
||||
|
||||
# Abbreviate make output
|
||||
# Run make with a V=1 parameter for full output.
|
||||
|
@ -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
18
README
|
@ -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
|
||||
|
||||
|
|
|
@ -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
1091
build-aux/config.guess
vendored
File diff suppressed because it is too large
Load diff
2930
build-aux/config.sub
vendored
2930
build-aux/config.sub
vendored
File diff suppressed because it is too large
Load diff
|
@ -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:
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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:
|
||||
|
|
34
configure.ac
34
configure.ac
|
@ -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
|
||||
|
||||
|
|
15
doc/coding
15
doc/coding
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 @@
|
|||
* item.h: Definitions for item characteristics stuff
|
||||
*
|
||||
* Known contributors to this file:
|
||||
* Markus Armbruster, 2004-2016
|
||||
* Markus Armbruster, 2004-2020
|
||||
*/
|
||||
|
||||
#ifndef ITEM_H
|
||||
|
@ -80,7 +80,8 @@ struct ichrstr {
|
|||
|
||||
/* variables using this structure */
|
||||
|
||||
extern struct ichrstr ichr[I_MAX + 2];
|
||||
#define ICHR_SZ (I_MAX + 2)
|
||||
extern struct ichrstr ichr[ICHR_SZ];
|
||||
|
||||
/* procedures using/returning this struct */
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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,8 @@ 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];
|
||||
#define LCHR_SZ 128
|
||||
extern struct lchrstr lchr[LCHR_SZ];
|
||||
|
||||
enum {
|
||||
LND_AIROPS_EFF = 50 /* min. efficiency for air ops */
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 *);
|
||||
|
|
|
@ -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,8 @@ 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];
|
||||
#define NCHR_SZ 64
|
||||
extern struct nchrstr nchr[NCHR_SZ];
|
||||
|
||||
/* src/lib/common/cargo.c */
|
||||
extern void nuk_carrier_change(struct nukstr *, int, int, int);
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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,8 @@ 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];
|
||||
#define PLCHR_SZ 128
|
||||
extern struct plchrstr plchr[PLCHR_SZ];
|
||||
|
||||
struct shiplist {
|
||||
int uid;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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,7 @@ struct pchrstr {
|
|||
char *p_sname; /* short (7 char or less) name of product */
|
||||
};
|
||||
|
||||
#define P_MAX 22
|
||||
|
||||
extern struct pchrstr pchr[P_MAX + 2];
|
||||
#define PCHR_SZ 32
|
||||
extern struct pchrstr pchr[PCHR_SZ];
|
||||
|
||||
#endif
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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,14 @@ 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];
|
||||
#define DCHR_SZ 64
|
||||
extern struct dchrstr dchr[DCHR_SZ];
|
||||
|
||||
#define IS_BIG_CITY(type) (dchr[(type)].d_pkg == UPKG)
|
||||
|
||||
/* Minimal efficiency of sectors that can be knocked down (bridges) */
|
||||
|
@ -223,7 +223,8 @@ struct sctintrins {
|
|||
unsigned char in_enable; /* enabled iff non-zero */
|
||||
};
|
||||
|
||||
extern struct sctintrins intrchr[INT_DEF + 2];
|
||||
#define INTRCHR_SZ INT_DEF + 2
|
||||
extern struct sctintrins intrchr[INTRCHR_SZ];
|
||||
|
||||
extern int fort_fire(struct sctstr *);
|
||||
extern int sct_rail_track(struct sctstr *);
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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,8 @@ 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];
|
||||
#define MCHR_SZ 128
|
||||
extern struct mchrstr mchr[MCHR_SZ];
|
||||
|
||||
enum {
|
||||
SHP_AIROPS_EFF = 50, /* min. efficiency for air ops */
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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.
|
||||
|
|
130
info/Empire4.4.t
130
info/Empire4.4.t
|
@ -5,10 +5,134 @@
|
|||
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 - Sat Feb 21 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 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 since
|
||||
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 some systems when bomb, launch and
|
||||
interdiction missed 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 work
|
||||
command was added in Empire 2.
|
||||
* Fix buy to handle concurrent lot change more robustly. The flawed
|
||||
handling goes back to 4.0.0 and 4.0.2.
|
||||
* Fix MOB_ACCESS mobility update for ships owned by countries with
|
||||
even country number. Broken in 4.4.0.
|
||||
* Journal entries for output are no longer flushed to disk right
|
||||
away.
|
||||
* 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 +300,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.
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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])
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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],
|
||||
|
|
423
m4/ax_pthread.m4
423
m4/ax_pthread.m4
|
@ -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
|
||||
|
|
|
@ -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?])])
|
||||
|
|
|
@ -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])
|
||||
|
|
|
@ -12,6 +12,8 @@ AC_DEFUN([MY_WINDOWS_API],
|
|||
AC_DEFINE([WINDOWS], 1, [Define if compiling for Windows API])
|
||||
AC_DEFINE([WIN32_LEAN_AND_MEAN], 1,
|
||||
[Define to make Windows includes pull in less junk])
|
||||
AC_DEFINE([_WIN32_WINNT], 0x0601,
|
||||
[Request Windows 7])
|
||||
LIBS_SOCKETS="-lws2_32"
|
||||
else
|
||||
LIBS_SOCKETS=
|
||||
|
|
20
m4/my_working_in6_is_addr_v4mapped.m4
Normal file
20
m4/my_working_in6_is_addr_v4mapped.m4
Normal 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
|
||||
])
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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,10 +96,11 @@ 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
|
||||
w32/getopt.$O:
|
||||
w32/w32io.$O: misc.h w32/sys/uio.h w32/w32types.h
|
||||
w32/w32sockets.$O: w32/sys/socket.h w32/unistd.h w32/w32types.h
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
103
src/client/getpass.c
Normal 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;
|
||||
}
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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
Loading…
Add table
Add a link
Reference in a new issue