Requirements to compile Freeciv
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Currently the native version of freeciv is tested with SAS C only.
Anyway the code should be much more portable than previous versions.

Furthermore you need the AmiTCP SDK or Miami SDK, MUI, NList and Guigfx
includes to be on your machine.

How to compile?
~~~~~~~~~~~~~~~
If all is ready, simply cd into this directory and enter

 'smake'

Maybe modify below settings before. 'smake install' will probably not work.
This is because there are currently no icons in the cvs. And the ilbm
pictures aren't there as well.

There are some settings you may change in the smakefile:
 DESTDIR     set to the directory, where install should copy files to
 CPU_MATH    set the CPU and math type you want including the math library
             for linker.
 TCPSDK      Choose one of the two possible lines
 OPTFLAGS    Set optimization flags, default are none.
 INCDIRS     Allows to include additional include directories. Normally
             this will be the Miami or AmiTCP SDK directory or empty.

To make the server call 'smake dirs civserver' (dirs creates directories).
To make the client call 'smake dirs civclient' (dirs creates directories).
To transform the locale files call 'smake dirs locale' (dirs creates
directories)
You need not add the dirs always, when they have been created already.

What to know about compiling process?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The files server/civserver.c and client/civclient.c contain the main()
functions for civserver and civclient. On the Amiga we need to do some
special stuff (e.g. library opening) before these main()'s are called. So
a special handling is needed:

The two files need to be compiled with DEFINE main=civ_main (redefine the
name main to civ_main). The files amigaserver.c and amigaclient.c contain
the real main() functions, which call civ_main() afterwards.
The main() in amigaserver.c and amigaclient.c expect normal C style
arguments argc and argv. If called from Workbench, argc is 0 and argv the
pointer to WBStartup message. If your compiler does not support that
behaviour, add another preparser and call the main function from it.

Example:

Add following before main() in amigaserver.c and amigaclient.c.

#ifdef __MY_COMPILER_NAME__
int main(int argc, char *argv)
{
  if(WBenchMsg) /* the hell knows, how your compiler handles this :-) */
    return main2(0, (char **) WBenchMsg);
  else
    return main2(argc, argv);
}
#define main main2 /* redefine main to avoid conflicts */
#endif

The free process is handled with atexit(), so the libraries are freed on
abnormal program abortion also.

The gettext.c and libintl.h files.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
These two files allow support of NLS. This is not a complete gettext
implementation, but enough for freeciv port.
The environment variable "LANG" or "LANGUAGE" must contain the language
string (e.g. >de< for german locale). The function also tries to convert
the system language to the form used in freeciv distribution. If this
does not work add a new conversion entry to LocaleConvTab in gettext.c.

The language files are stored in locale directory in form xx.mo. Where
xx is the language identifier as used im po directory of source tree.

The vsnprintf.c file.
~~~~~~~~~~~~~~~~~~~~~
The current Amiga development systems (especially SAS and VBCC) do not
support argument reordering in their printf-style functions. So the
sprintf function must be added to the project. And as freeciv needs
vsnprintf (which has better error checking) instead of sprintf we also
removed the need to use the internal workaround of freeciv.

How to make with VBCC (at least 0.8)?
~~~~~~~~~~~~~~~~~~~~~~
- Get a make program.
- Get fd2pragma (Aminet/dev/misc/fd2pragma.lha) and create prototype files
  as well as usergroup.lib and guigfx.lib.
- Start make and fix all the other problems, which may have been added in
  between releases (example: make -f vmakefile). Ignore warnings.

Problems:
- Starting server from WB is nearly useless as it misses the input and
  output dialog.
- Starting client from WB misses the output dialog (client uses no input).
