The file bugfix-genesis.patch contains the fixes in
ftp://genesis-sim.org/pub/genesis/Bug-fixes/src/kinetics in patch
format. This fixes were required for the kinetics library to work
properly under cygwin.

The other modifications needed to compile genesis on cygwin where
divided in two patch files.

fixcase-genesis.patch contains the changes needed because of the case
insensitivity of the win32 file system.  The directories
src/Xodus/draw, src/Xodus/widg, src/Xodus/xo where renamed to
src/Xodus/_draw, src/Xodus/_widg, src/Xodus/_xo respectively. The
patch fixes all references to files on these directories. Also, in
src/sprng/Makefile the target src was renamed to source to avoid
confussion with the SRC directory.

cygwin-genesis.patch contains fixes more specific to Cygwin. The
changes are specified file by file:

* src/shell/shell_hash.c

The hash function applied to the function addresses sent many of them
to positions near the end of the table. This caused "Hash table full"
errors during genesis startup. This was solved by changing the hash
table size from 10000 to 10001 if the Cygwin environment is used,
which causes a different arrangement in the table.

* src/shell/shell_io.c

Function AvailableChars: Cygwin does not implement the FIONREAD ioctl
(aka TIOCINQ). This was solved using the same method as for T3E
(select() function + using internal fields of the FILE struct). This
required including <sys/time.h> for Cygwin.

* src/shell/shell_tty.c 

Replaced a call to FIONREAD by a call to AvailableCharacters, wich
will do the proper job depending on the machine and system used

* src/shell/shell_setup.c

Added code for searching for executables with .exe extension when
running under Cygwin.

* src/device/timetable.c

Under certain circumstances, the code for the TUPDATE action of the
timetable object would attempt to free an uninitialized pointer
(tempti). This caused a segmentation fault under Cygwin. This was
solved by initializing the pointer to NULL on declaration.

* src/diskio/interface/netcdf/netcdf-3.4/src/ncgen/ncgentab.c

<values.h> was included but no definition from it was used. This
header file is obsolete and is not present on most modern systems. The
inclusion was commented out.

* src/sys/jump.c

Added Cygwin to the list of systems that need struct sigcontext
defined

* src/Makefile.dist

Added a section with Cygwin definitions

* src/Makefile.Cygwin

New file, adapted from Makefile.other

* src/sprng/SRC/make.Cygwin

New file, identical to make.Linux

* src/convert/Makefile and src/sys/Makefile

The script for installing executables needs the .exe extension to be
added to the program names under Cygwin. This was done by exporting
the $(EXE_EXT) variable from the top level makefile and appending it
to the program names.

* src/sys/Makefile

The do_cmd_args in src/ss/eval.c is a recursive function that has a
local buffer variable of 10000 chars. This causes a stack overflow
under Cygwin when code_g tries to process the xfastplot object in
src/Xodus/widget/widglib.g. The solution was to increase the stack
size for code_g. This was done by exporting the $(CODE_G_LFLAGS)
variable from the top level makefile and including it in the options
for linking code_g.

* src/kinetics/text.c

The included <X11/Intrinsic.h> would not compile under Cygwin if SYSV
is defined. So SYSV is temporarily undefined for the inclusion of this
header.

* src/diskio/interface/netcdf/Makefile

netcdflib failed to build if $PATH contained spaces. This is unlikely
to happen on most build environments, but it is quite common in
Windows. Adding quotes around $$PATH solves the problem.