Dear GIMP and GTK maintainers, developers, etc:

Over the past week I have labored to compile the GIMP 0.99.14 on my 
computer at work.  The included patches are the fruit of my efforts.  These 
patches were developed in order to compile GIMP on a system running SunOS 
4.1.4.  Although many of the issues addressed are specific to compiling 
under SunOS, I believe I have found a few other issues which are real "bug 
fixes."  These have been marked as such.  Below, I cover each patch and each
file that the patch will modify, with an explanation of the problem being 
addressed.  I also try to make a recommendation on improving on my work 
where possible - some of my changes are hacks just to get things running.

I hope that my work will aid in improving GIMP's cross-platform 
compatibility.

I'm sorry I don't really have the time to help "develop" the GIMP, but of
course if any of these changes are integrated into a future release of GIMP
then I'll be happy to test compile and play with it a while.

Sincerely, 
John R. Johns II
john_johns@credence.com / marten@best.com

============ Changes by gimp-john_johns-971017-0.patch ============ 

File     : app/Makefile.in
Change   : Link with -lrx.  SunOS does not include regex libraries, and so
           this patch will cause the GIMP to link to GNU's librx.
Recommend: Ideally, this should be auto-added on systems where a regex
           library is not found and GNU librx is available.  This is an
           issue for configure.

File     : app/app_procs.c
Change   : BUG FIX.  really_quit_cancel_callback() needs to cast "widget" to
           avoid warning message during compile.

File     : app/disp_callbacks.c
Change   : BUG FIX.  gdk_window_get_pointer() needs to cast "&tmask" to avoid
           warning message during compile.

File     : app/frac.c
Change   : BUG FIX.  Variable "quality" is not an integer, g_print() should 
           not treat it as one.  Change %d to %g.  This stops the warning 
           message that was appearing.
           BUG FIX.  g_print() calls meaning to print the address of pointer
           "channelTilesData" are using %i instead of %p.  This stops the
           warning message that was appearing.
 
File     : app/magnify.c
Change   : info_window_update() (from info_window.c) is called without 
           declaration.  Declare as extern to avoid warning message.

File     : app/procedural_db.c
Change   : Comment out #include <regex.h> and add #include <rxposix.h>.  
           This is needed to compile in regular expression support, using
           the GNU rx library.
Recommend: Ideally, this should be auto-handled on systems where a regex
           library is not found and GNU librx is available.  This is an
           issue for configure and some good #defines.

File     : app/scale.c
Change   : info_window_update() (from info_window.c) is called without
           declaration.  Declare as extern to avoid warning message.

File     : ./externs.h
Change   : Added this file.  This file solves two problems - it declares
           fwrite() so that sunras.c will compile, and it defines RAND_MAX
           so that files that need it will compile.
Recommend: sunras.c could be modified with a "stub" fwrite() function call
           that calls the real fwrite, and then take the address of the
           stub fwrite instead.
           RAND_MAX should be checked for by configure, and if not found,
           can be defined via -D through the Makefile.

File     : libgimp/Makefile.in
Change   : Link with -lrx.  SunOS does not include regex libraries, and so
           this patch will cause the GIMP to link to GNU's librx.
Recommend: Ideally, this should be auto-added on systems where a regex
           library is not found and GNU librx is available.  This is an
           issue for configure.

File     : libgimp/exitproc.c
Change   : Added this file.  SunOS 4.x has no atexit() function call.  While
           not perfect, this free replacement will do the necessary job.
           I don't know if the good people at GNU have an atexit() in their
           C library, but requiring people to compile with the GNU C library
           isn't a good idea.  You may be able to steal atexit() from the
           GNU C library if one is provided.

File     : libgimp/gimp.h
Change   : Includes the added "externs.h" file so nearly everything has
           access to it.
Recommend: See above re: ./externs.h

File     : libgimp/gimpwire.c
Change   : Includes the added "exitproc.c" file so that it's in the library
           for gimp and its' plug-ins to access.
Recommend: See above re: libgimp/exitproc.c

File     : libgimp/gimpwire.h
Change   : Includes the added "externs.h" file so nearly everything has
           access to it.
Recommend: See above re: ./externs.h

File     : MapObject/mapobject_preview.c
Change   : draw_wireframe_plane() and draw_wireframe_sphere() are used before
           they are declared.  Move the function draw_wireframe() down below
           the plane and sphere functions.  (Or, declare them at the top of
           the file.)

File     : plug-ins/blinds.c
Change   : BUG FIX.  You cannot format an integer value into "%0.2d" - this 
           makes no sense.  I'm not sure if this fix is correct, but what is 
           there originally is impossible.

File     : plug-ins/bmpwrite.c
Change   : Include unistd.h.  SEEK_SET, SEEK_CUR, and SEEK_END are defined in
           this file in SunOS.

File     : plug-ins/dgimp/dgimp_utils.c
Change   : BUG FIX.  Although this function is unfinished, it needs to return
           some value.

File     : plug-ins/fitsrw.c
Change   : Include unistd.h.  SEEK_SET, SEEK_CUR, and SEEK_END are defined in
           this file in SunOS.

File     : plug-ins/gfli.c
Change   : Include unistd.h.  SEEK_SET, SEEK_CUR, and SEEK_END are defined in
           this file in SunOS.

File     : plug-ins/pcx.c
Change   : Include unistd.h.  SEEK_SET, SEEK_CUR, and SEEK_END are defined in
           this file in SunOS.

File     : plug-ins/png/png.c
Change   : BUG FIX.  &(info->num_palette) should be cast to (int) (two 
           places).

File     : plug-ins/pnm.c
Change   : BUG FIX.  GCC 2.7.2.2 under SunOS 4.1.4 won't compile when you
           use += to sum pointer variables into an integer variable.  Before
           the sprintf(), cast to (int) (4 places).

File     : plug-ins/print.c
Change   : BUG FIX.  "values[0].data.d_status == STATUS_EXECUTION_ERROR;"
           doesn't set anything.

File     : plug-ins/psd.c
Change   : Include unistd.h.  SEEK_SET, SEEK_CUR, and SEEK_END are defined in
           this file in SunOS.

File     : plug-ins/script-fu/Makefile.in
Change   : Link with -lrx.  SunOS does not include regex libraries, and so
           this patch will cause the GIMP to link to GNU's librx.
Recommend: Ideally, this should be auto-added on systems where a regex
           library is not found and GNU librx is available.  This is an
           issue for configure.

File     : plug-ins/script-fu/interp_regex.c
Change   : Comment out #include <regex.h> and add #include <rxposix.h>.
           This is needed to compile in regular expression support, using
           the GNU rx library.
           BUG FIX.  Also, "p->re_nsub" is a long integer value, not a short;
           the sprintf() call should reflect that by using "%ld".
Recommend: Ideally, this should be auto-handled on systems where a regex
           library is not found and GNU librx is available.  This is an
           issue for configure and some good #defines.

File     : plug-ins/script-fu/interp_slib.c
Change   : memmove() does not exist under SunOS 4.x.  strerror() does not
           exist under SunOS 4.x.  Substitutes are provided.
Recommend: Possibly pull functions out of GNU C library and include when
           configure does not find them available.

File     : plug-ins/script-fu/interp_sliba.c
Change   : BUG FIX.  sizeof(double) is a long integer value, not a short.  
           sprintf() needs to use %ld.

File     : plug-ins/script-fu/script-fu-console.c
Change   : gimp_db_browser() is called without declaration.

File     : plug-ins/script-fu/script-fu-server.c
Change   : difftime() does not exist under SunOS 4.x.  A substitute is 
           provided.
Recommend: Possibly pull function out of GNU C library and include when
           configure does not find it available.

File     : plug-ins/script-fu/siod.h
Change   : Include <stdlib.h> before including siod.h.  size_t is used in
           siod.h and it isn't declared unless you have stdlib.h.

File     : plug-ins/sgilib.c 
Change   : Include unistd.h.  SEEK_SET, SEEK_CUR, and SEEK_END are defined in
           this file in SunOS.

File     : plug-ins/sunras.c 
Change   : BUG FIX.  "retval = putc (flag, ofp), putc (0x00, ofp);" is not a 
           valid statement in C.  I don't know if my change is correct or not
           but the original line is impossible code.  Also, had to include
           unistd.h for SEEK_SET, SEEK_CUR, and SEEK_END.

File     : plug-ins/tga.c
Change   : Include unistd.h.  SEEK_SET, SEEK_CUR, and SEEK_END are defined in
           this file in SunOS.

File     : plug-ins/tileit.c
Change   : BUG FIX.  You cannot format an integer value into "%0.1d" - this 
           makes no sense.  I'm not sure if this fix is correct, but what is 
           there originally is impossible.

File     : plug-ins/xwd.c
Change   : Include unistd.h.  SEEK_SET, SEEK_CUR, and SEEK_END are defined in
           this file in SunOS.

