Replace the build process. The new one requires GNU Make, Autoconf
and Autoconf macros that come with Automake. It supports multiple
separate builds of the same source tree, and updates dependencies
automatically. Targets info, html, install, install-html, uninstall
and dist are not yet implemented.
System configuration is now automatic. Previously, you had to choose
one of several canned system configurations, defined in Make.sysdefs.
Currently, system configuration always uses UCONTEXT for LWP, and
chooses LWP only if its requirements are met.
Feature configuration changed: instead of editing build.conf (further
processed by doconfig), you pass arguments to configure. Note that
build.conf settings that can be overridden in econfig have no
configure equivalent; just edit econfig instead.
Because generated headers complicate makefiles, fold gamesdef.h into
its users: path.c and ipglob.c become path.c.in and ipglob.c.in,
constants.c, vers.c, options.h simply hardcode defaults (most of them
are run-time configurable).
Call the client empire instead of emp_client. This matches what the
old standalone build did.
Ron Koenderink [Sun, 18 Dec 2005 15:16:52 +0000 (15:16 +0000)]
(shp_nav_one_sector, mchr[], ship_chr_flags[], Ship-types, Sector-types):
Add M_CANAL flag to indicate which ships can navigate a canal
in a big city. Remove the hard code values for canal from
shp_nav_one_sector() for which ships can navigate a canal.
Set M_CANAL flag in ship_chr_flags[] to match the hard
coding in shp_nav_one_sector().
Update Ship-types.t with new canal flag.
Update Sector-types.t to indicate that cities have canals.
(lwpNewContext) [MAKECONTEXT_SP_HIGH]: Work around makecontext()
lossage.
(IRIX5CFLAGS, SOLCFLAGS): Define MAKECONTEXT_SP_HIGH. This is wrong
for Solaris 10.
Redesign interface to machine-dependent code to cleanse lwp.c of
machine-dependencies:
(lwpNewContext): New, factored out of lwpCreate().
(lwpSwitchContext): New, factored out of lwpReschedule().
(LWP_EXTRASTACK, STKALIGN, lwpInitContext, lwpSave, lwpRestore): Move
to arch.c. Remove for UCONTEXT, else static linkage unless macro or
AIX32.
(lwpReschedule): Skip lwpStatus() when not actually switching.
(LwpStackGrowsDown): New.
(lwpInitSystem): Initialize it.
(lwpStackCheck, lwpStackCheckUsed): Use it.
(lwpProc): Members lowmark and himark are confusing, replace by
ustack, usize.
(lwpCreate): Initialize them.
(lwpStackCheckInit, lwpStackCheck, lwpStackCheckUsed): Rewrite using
them. lwpStackCheckUsed() was off by LWP_REDZONE when stack grows
down.
(lwpDestroy): Don't bother to clear memory to be freed.
(lwpCreate) [UCONTEXT]: ss_sp is the (base) address of the stack area,
not the initial stack pointer. Fix. ss_size was wrong as well.
Amazing that this ever worked.
(lwpCreate): Used to allocate one byte more than necessary. The fix
won't save memory (malloc() will add the byte back), it's just clearer
this way.
(lwpCreate): Clean up computation of sp. Rename parameter size to
stacksz.
(lwpCreate): Always compute newp->lowmark and newp->highmark from sp,
not from s. Old code misaligned newp->himark for stacks growing
upward when stack size argument wasn't aligned.
(lwpProc, lwpSem): Declare as incomplete type in include/lwp.h. Move
complete declaration to src/lib/lwp/lwpint.h.
(lwpQueue): Move to src/lib/lwp/lwpint.h.
(empth_main, empth_flags): New.
(empth_init): Initialize them.
(empth_create, empth_exit): Use them instead of lwpProc members.
Remove LWP code for targets we no longer support: VAX/MIPS Ultrix
(dropped in Make.sysdefs rev. 1.12), 386 USL/Unixware (unclear, long
ago), 386BSD (never been?)
Clean up the incomprehensible #ifdef jungle a bit. Didn't compile if
both UCONTEXT and one of the other recognized preprocessor symbols was
defined; fix to prefer UCONTEXT.
Less rigid field separators, support comments:
(skipfs): New.
(xuflds, xundump): Use it. Update field scanf stop-sets accordingly.
(xuflds): Update test for good field separator.
(xundump): Fail silently if nothing can be read and no specific table
is expected.
Plug memory leaks:
(freeflds): New.
(xundump): Call it.
(xuloadrow): Leave freeing storage to freeflds().
(xuflds): Ensure values[] is terminated with a VAL_NOTUSED element
even on error.
Ron Koenderink [Tue, 29 Nov 2005 23:55:17 +0000 (23:55 +0000)]
(xuflds, xunsymbol, xuloadrow): Split VAL_SYMBOL into
VAL_SYMBOL and VAL_SYMBOL_SET. Identify SYMBOL_SET
by the '(' and ')'. Switch SYMBOL_SET separator from '|' to a space.
(plane_bomb, land_bomb): Apply collateral damage to target sector
instead of where the targeted plane/land unit is after the attack.
Different if the target retreats. Can't happen for planes. Reported
by Greg German.
Ron Koenderink [Tue, 29 Nov 2005 03:57:44 +0000 (03:57 +0000)]
(close_files, finish_server, panic):
Rename close_files() to ef_close_srv() and move to fileinit.c.
Replace calls to close_files() with ef_fin_srv().
Call ef_close_srv() from ef_fin_srv().
(ef_close_srv, ef_fin_srv): New.
(init_files, init_server, ef_init_srv):
Rename init_files() to ef_open_srv() and move to fileinit.c.
Remove call to init_files() from init_server() and replace
with a call to ef_open_srv() from ef_init_srv().
(ef_open_srv): New.
(ef_load, init_server, ef_init_srv):
Move the call to ef_load() from init_server() to ef_init_srv().
(global_init, init_server, ef_init_srv):
Move the call to global_init() from init_server() to ef_init_srv().
(nullify_objects, global_init, init_server):
Split nullify_objects() into init_lchr() and init_dchr().
Locate init_lchr() and init_dchr() in init.c.
Add calls to init_lchr() and to init_dchr() from global_init().
(fillcache, do_write, io_input, io_output): Portability fix: always
check both EAGAIN and EWOULDBLOCK. These are distinct on some
systems, e.g. HP-UX.
(io_output) [hpux]: Used to treat all errors as EWOULDBLOCK. This
looks like a inept attempt to `fix' the above. Remove.
Ron Koenderink [Mon, 21 Nov 2005 18:25:49 +0000 (18:25 +0000)]
(natbyname): Do not look up a non-active country.
Previously a blank country name or deleted country name would
return a pointer to non-active countries.
This creates a security problem where some one can successfully
login into the server without country or password. Closes #1219569.
(dchrstr, pchrstr, rptstr): New member d_uid, p_uid, r_uid.
(dchr, bigcity_dchr, pchr, rpt): Initialize it.
(dchr_ca, pchr_ca, rpt_ca): New selector uid for it.
(laun, launch_as, launch_missile, launch_sat): When an argument is
bad, do not loop prompting, just fail. That's what the vast majority
of commands do.
(launch_as, launch_missile, launch_sat): Don't zap the target
argument. If the target is given as argument, launch all missiles at
that target. Previously, missiles after the first prompted for
another target.