Advice about gcc.

* README.win32: Advice about gcc.

	* libgimp/gimp.{c,h,def}: New way to get address of PLUG_IN_INFO
 	to the gimp dll, similar as used by the EMX port. Much cleaner.
	Works well with gcc also now.

	* app/gimprc.c: Remove gratuituous printf.

	* app/makefile.msc: Update with new files.

	* plug-ins/makefile.msc: Small updates.

	* plug-ins/makefile.cygwin: New file.

	* plug-ins/gfig/gfig.c
	* plug-ins/script-fu/script-fu-scripts.c: Include <glib.h> early.
This commit is contained in:
Tor Lillqvist 1999-07-03 02:27:32 +00:00
parent 8b50905ad2
commit 2815f523e9
13 changed files with 456 additions and 41 deletions

View File

@ -1,3 +1,22 @@
1999-07-03 Tor Lillqvist <tml@iki.fi>
* README.win32: Advice about gcc.
* libgimp/gimp.{c,h,def}: New way to get address of PLUG_IN_INFO
to the gimp dll, similar as used by the EMX port. Much cleaner.
Works well with gcc also now.
* app/gimprc.c: Remove gratuituous printf.
* app/makefile.msc: Update with new files.
* plug-ins/makefile.msc: Small updates.
* plug-ins/makefile.cygwin: New file.
* plug-ins/gfig/gfig.c
* plug-ins/script-fu/script-fu-scripts.c: Include <glib.h> early.
1999-07-02 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/dodgeburn.c: changed the tool toggle key to <Ctrl>.

View File

@ -6,10 +6,11 @@ native Windows, and pre-built binary packages, see
http://www.iki.fi/tml/gimp/win32/ or
http://www.gimp.org/~tml/gimp/win32/
To build the GIMP on Win32, you will need (for now) the Microsoft
compiler. Eventually gcc (egcs) on cygwin will also be supported, but
without the produced executables depending on the cygwin dll (gcc
-mno-cygwin).
To build the GIMP on Win32, you can use either the Microsoft compiler
or gcc (egcs) without the produced executables depending on the
cygwin dll (gcc -mno-cygwin). For more information about the
preparation necessary for building with gcc, read README.win32 in the
GLib 1.3 distribution.
The GIMP wants to be built with the GNU gettext library for
internationalisation (i18n). Get the version ported to Win32 (not a
@ -18,13 +19,13 @@ any i18n stuff, undefine ENABLE_NLS in the config.h.win32 file, and
remove references to the gnu-intl library from the makefiles.
First, build in the libgimp directory, then in tools/gcg, then in app,
plug-ins, and finally in modules. Check the makefile.msc files in said
directories.
plug-ins, and finally in modules. Check the makefile.msc or
makefile.cygwin files in said directories.
The current build setup for Windows is a mess, with complex
hand-maintained makefiles. I know. Adding parallel makefiles for gcc
isn't going to make it any better. On the other hand, I don't think
using the Unix style configuration mechanism (under cygwin) is quite
feasible, either.
didn't make it any cleaner. On the other hand, I don't think using the
Unix style configuration mechanism (under cygwin) is quite feasible,
either.
--Tor Lillqvist <tml@iki.fi>

View File

@ -2277,7 +2277,6 @@ static char *
value_to_str (char *name)
{
int i;
printf(" STRING = %s", name);
for (i = 0; i < nfuncs; i++)
if (! strcmp (funcs[i].name, name))
switch (funcs[i].type)

View File

@ -114,6 +114,7 @@ gimp_OBJECTS = \
disp_callbacks.obj \
docindex.obj \
docindexif.obj \
dodgeburn.obj \
draw_core.obj \
drawable.obj \
drawable_cmds.obj \
@ -143,8 +144,8 @@ gimp_OBJECTS = \
gimage_mask_cmds.obj \
gimpbrush.obj \
gimpbrushgenerated.obj \
gimpcontext.obj \
gimpbrushlist.obj \
gimpcontext.obj \
gimphistogram.obj \
gimplist.obj \
gimplut.obj \
@ -223,6 +224,7 @@ gimp_OBJECTS = \
selection.obj \
session.obj \
shear_tool.obj \
smudge.obj \
temp_buf.obj \
text_tool.obj \
text_tool_cmds.obj \

View File

@ -111,6 +111,11 @@ static GHashTable *temp_proc_ht = NULL;
#ifdef NATIVE_WIN32
static GPlugInInfo *PLUG_IN_INFO_PTR;
#define PLUG_IN_INFO (*PLUG_IN_INFO_PTR)
void
set_gimp_PLUG_IN_INFO_PTR(GPlugInInfo *p)
{
PLUG_IN_INFO_PTR = p;
}
#else
#ifndef __EMX__
extern GPlugInInfo PLUG_IN_INFO;
@ -129,12 +134,8 @@ gimp_main (int argc,
char *argv[])
{
#ifdef NATIVE_WIN32
HMODULE handle;
char *peer, *peer_fd;
guint32 thread;
handle = GetModuleHandle (NULL);
PLUG_IN_INFO_PTR = (GPlugInInfo *) GetProcAddress (handle, "PLUG_IN_INFO");
#endif
if ((argc < 4) || (strcmp (argv[1], "-gimp") != 0))

View File

@ -252,6 +252,7 @@ EXPORTS
parasite_is_type
parasite_name
parasite_new
set_gimp_PLUG_IN_INFO_PTR
wire_clear_error
wire_destroy
wire_error
@ -273,4 +274,4 @@ EXPORTS
wire_write_int32
wire_write_int8
wire_write_msg
wire_write_string
wire_write_string

View File

@ -84,18 +84,6 @@ struct _GPlugInInfo
GRunProc run_proc;
};
#if defined (NATIVE_WIN32) && !defined (LIBGIMP_COMPILATION)
/* Define PLUG_IN_INFO as an exported symbol (when compiling a plug-in).
* In gimp.c, we don't declare it at all, but fetch the address
* of it with GetProcAddress.
*/
#ifdef __GNUC__
GPlugInInfo PLUG_IN_INFO;
#else
__declspec(dllexport) GPlugInInfo PLUG_IN_INFO;
#endif
#endif
struct _GTile
{
guint ewidth; /* the effective width of the tile */
@ -190,7 +178,7 @@ struct _GParam
#ifdef NATIVE_WIN32
/* Define WinMain() as plug-ins are built as GUI applications. Also
/* Define WinMain() because plug-ins are built as GUI applications. Also
* define a main() in case some plug-in still is built as a console
* application.
*/
@ -202,19 +190,27 @@ struct _GParam
# endif
# define MAIN() \
static int \
win32_gimp_main (int argc, char *argv[]) \
{ \
extern void set_gimp_PLUG_IN_INFO_PTR(GPlugInInfo *); \
set_gimp_PLUG_IN_INFO_PTR(&PLUG_IN_INFO); \
return gimp_main (argc, argv); \
} \
\
int _stdcall \
WinMain (int hInstance, \
int hPrevInstance, \
WinMain (void *hInstance, \
void *hPrevInstance, \
char *lpszCmdLine, \
int nCmdShow) \
{ \
return gimp_main (__argc, __argv); \
return win32_gimp_main (__argc, __argv); \
} \
\
int \
main (int argc, char *argv[]) \
{ \
return gimp_main (argc, argv); \
return win32_gimp_main (argc, argv); \
}
#else
#ifndef __EMX__

View File

@ -97,7 +97,7 @@ gimp_OBJECTS = \
gimp-$(GIMP_VER).dll : $(gimp_OBJECTS) gimp.def
$(CC) $(CFLAGS) -LD -Fegimp-$(GIMP_VER).dll $(gimp_OBJECTS) $(GETTEXT)\intl\gnu-intl.lib $(GLIB)\glib-$(GLIB_VER).lib $(LDFLAGS) user32.lib /def:gimp.def
# Pass -DLIBGIMP_COMPILATION when compiling these
# Pass -DLIBGIMP_COMPILATION when compiling gimp_OBJECTS
gimp.obj : gimp.c
$(CC) $(CFLAGS) -GD -c -DLIBGIMP_COMPILATION gimp.c

View File

@ -48,6 +48,8 @@
#include "config.h"
#include <glib.h> /* Include early for obscure Win32
build reasons */
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>

388
plug-ins/makefile.cygwin Normal file
View File

@ -0,0 +1,388 @@
# Makefile to build the GIMP plug-ins with cygwin's make and gcc -mno-cygwin
# I don't want to use many hand-written makefiles, so this is quite complex.
# This same makefile is also included by sub-makes called as subroutines.
# Various parts of this file are used when makeing from the plug-ins directory,
# and when building individual plug-ins and the three plug-in libraries.
INSTALL = install
GIMP = /gimp
BIN = $(GIMP)/plug-ins
ifndef LIBRARY
ifndef PLUGIN
# This part is used when making from the plug-ins directory
FROMPLUGINSDIR=YES # Used to bypass other parts below
# List plug-ins. Use several lists just so that this makefile looks more like
# the one used with Microsoft's nmake, which has silly limits.
# The COMMON* ones are in the common subdirectory
COMMON1 = CEL CML_explorer align_layers animationplay animoptimize apply_lens autocrop autostretch_hsv blinds blur borderaverage bumpmap c_astretch checkerboard colorify compose convmatrix cubism
COMMON2 = decompose deinterlace depthmerge despeckle destripe diffraction displace edge emboss engrave exchange film flarefx fractaltrace
COMMON3 = gauss_iir gauss_rle gbr gee gicon gif gifload glasstile gqbist gradmap grid gtm guillotine header hot hrz gz illusion iwarp jigsaw jpeg laplace lic
COMMON4 = mapcolor max_rgb mblur newsprint nlfilt noisify normalize nova oilify palette papertile pat pcx pix pixelize plasma plugindetails png pnm polar ps psd randomize ripple rotate rotators
COMMON5 = scatter_hsv semiflatten sharpen shift smooth_palette snoise sobel sparkle spread tga threshold_alpha tiff tile tileit tiler video vinvert vpropagate waves whirlpinch wind wmf xbm xwd zealouscrop
# These have own subdirectories each
SEPARATE = AlienMap FractalExplorer Lighting MapObject bmp dbbrowser faxg3 fits flame fp gfig gfli ifscompose maze mosaic pagecurl print rcm sgi sinus struc unsharp
# These are unofficial, ie not in the CVS. To build these, you should
# get tml's source snapshot and copy this makefile to the
# ../unofficial-plug-ins directory, go there, and do "make -f
# makefile.cygwin unofficial".
UNOFFICIAL = guash user_filter twain
# The main target
all : ../config.h libs-all common-plugins-all separate-plugins-all
../config.h : ../config.h.win32
cp ../config.h.win32 ../config.h
install : libs-install common-plugins-install separate-plugins-install scripts-install
unofficial:
for d in $(UNOFFICIAL); do $(MAKE) -f makefile.cygwin sub-one-separate DIR=$$d TARGET=install; done
clean : libs-clean common-plugins-clean separate-plugins-clean
libs-all :
$(MAKE) -f makefile.cygwin sub-libs TARGET=all
libs-install :
$(MAKE) -f makefile.cygwin sub-libs TARGET=install
libs-clean :
$(MAKE) -f makefile.cygwin sub-libs TARGET=clean
sub-libs:
cd megawidget; $(MAKE) -f ../makefile.cygwin TOP=../.. LIBRARY=megawidget $(TARGET)
cd gpc; $(MAKE) -f ../makefile.cygwin TOP=../.. LIBRARY=gpc $(TARGET)
cd libgck/gck; $(MAKE) -f ../../makefile.cygwin TOP=../../.. LIBRARY=gck OBJECTS="gckcolor.o gcklistbox.o gckmath.o gckui.o gckvector.o" $(TARGET)
common-plugins-all :
$(MAKE) -f makefile.cygwin sub-common-plugins TARGET=all
common-plugins-install :
$(MAKE) -f makefile.cygwin sub-common-plugins TARGET=install
common-plugins-clean :
cd common; $(MAKE) -f ../makefile.cygwin LIBRARY=PLUGIN=dummy clean
sub-common-plugins :
for d in $(COMMON1) $(COMMON2) $(COMMON3) $(COMMON4) $(COMMON5); do $(MAKE) -f makefile.cygwin sub-one-common DIR=$$d TARGET=$(TARGET); done
sub-one-common :
cd common; $(MAKE) -f ../makefile.cygwin TOP=../.. PLUGIN=$(DIR) EXTRA_$(DIR)=1 $(TARGET)
separate-plugins-all :
$(MAKE) -f makefile.cygwin sub-separate-plugins TARGET=all
separate-plugins-install :
$(MAKE) -f makefile.cygwin sub-separate-plugins TARGET=install
separate-plugins-clean :
$(MAKE) -f makefile.cygwin sub-separate-plugins TARGET=clean
sub-separate-plugins :
for d in $(SEPARATE); do $(MAKE) -f makefile.cygwin sub-one-separate DIR=$$d TARGET=$(TARGET); done
# We must handle script-fu separately because of the dash, sigh
cd script-fu; $(MAKE) -f ../makefile.cygwin TOP=../.. PLUGIN=script-fu EXTRA_script_fu=1 $(TARGET)
sub-one-separate :
cd $(DIR); $(MAKE) -f ../makefile.cygwin TOP=../.. PLUGIN=$(DIR) EXTRA_$(DIR)=1 $(TARGET)
scripts-install :
$(INSTALL) script-fu/scripts/*.scm $(GIMP)/scripts
$(INSTALL) script-fu/scripts/*.jpg $(GIMP)/scripts
for d in FractalExplorer/fractalexplorer-examples/*; do if [ -f $$d ]; then $(INSTALL) $$d $(GIMP)/fractalexplorer; fi; done
rm $(GIMP)/fractalexplorer/Makefile.am
endif # ifndef PLUGIN
endif # ifndef LIBRARY
ifndef FROMPLUGINSDIR
# This part is used when building individual plug-ins or one of
# the libraries.
ifdef EXTRA_Lighting
OBJECTS = \
lighting_apply.o \
lighting_image.o \
lighting_main.o \
lighting_preview.o \
lighting_shade.o \
lighting_ui.o
endif
ifdef EXTRA_MapObject
OBJECTS = \
arcball.o \
mapobject_apply.o \
mapobject_image.o \
mapobject_main.o \
mapobject_preview.o \
mapobject_shade.o \
mapobject_ui.o
endif
ifdef EXTRA_bmp
OBJECTS = \
bmp.o \
bmpread.o \
bmpwrite.o
endif
ifdef EXTRA_dbbrowser
OBJECTS = \
dbbrowser.o \
dbbrowser_utils.o
endif
ifdef EXTRA_faxg3
OBJECTS = \
faxg3.o \
g3.o \
run_tbl.o
endif
ifdef EXTRA_fits
OBJECTS = \
fits.o \
fitsrw.o
endif
ifdef EXTRA_flame
OBJECTS = \
cmap.o \
flame.o \
libifs.o \
rect.o
endif
ifdef EXTRA_fp
OBJECTS = \
fp.o \
fp_gdk.o \
fp_gtk.o \
fp_hsv.o \
fp_misc.o
endif
ifdef EXTRA_gdyntext
# Doesn't compile yet, though, so not included in list above
OBJECTS = \
charmap.o \
charmap_window.o \
font_selection.o \
gdyntext.o \
gdyntext_ui.o \
message_window.o
endif
ifdef EXTRA_gfli
OBJECTS = \
fli.o \
gfli.o
endif
ifdef EXTRA_ifscompose
OBJECTS = \
ifscompose.o \
ifscompose_storage.o \
ifscompose_utils.o
endif
ifdef EXTRA_jpeg
# Location of jpeg-6b sources
JPEG = $(TOP)/../jpeg-6b
EXTRACFLAGS = -I$(JPEG)
EXTRALIBS = -L $(JPEG) -ljpeg
endif
ifdef EXTRA_maze
OBJECTS = \
algorithms.o \
handy.o \
maze.o \
maze_face.o
endif
ifdef EXTRA_png
# Location of libpng sources
PNG = $(TOP)/../libpng-1.0.3
# And zlib
ZLIB = $(TOP)/../zlib-1.1.3
EXTRACFLAGS = -I$(PNG) -I$(ZLIB)
EXTRALIBS = -L $(PNG) -lpng -L $(ZLIB) -lz
endif
ifdef EXTRA_print
OBJECTS = \
print.o \
print-escp2.o \
print-pcl.o \
print-ps.o \
print-util.o
endif
ifdef EXTRA_rcm
OBJECTS = \
rcm.o \
rcm_callback.o \
rcm_dialog.o \
rcm_gdk.o \
rcm_misc.o
OPTIMIZE =
endif
ifdef EXTRA_script_fu
OBJECTS = \
interp_md5.o \
interp_regex.o \
interp_slib.o \
interp_sliba.o \
interp_trace.o \
script-fu.o \
script-fu-console.o \
script-fu-scripts.o \
regex.o \
../dbbrowser/dbbrowser_utils.o
EXTRACFLAGS = -DREGEX_MALLOC
HAVE_RESOURCE = YES
endif
ifdef EXTRA_sgi
OBJECTS = \
sgi.o \
sgilib.o
endif
ifdef EXTRA_tiff
# Location of tiff-3.4 sources
TIFF = $(TOP)/../tiff-v3.4/libtiff
# Location of jpeg-6b sources
JPEG = $(TOP)/../jpeg-6b
# And zlib
ZLIB = $(TOP)/../zlib-1.1.3
EXTRACFLAGS = -I$(TIFF)
EXTRALIBS = -L $(TIFF) -ltiff -L $(JPEG) -ljpeg -L $(ZLIB) -lz -luser32
endif
ifdef EXTRA_unsharp
OBJECTS = \
dialog_f.o \
unsharp.o
endif
ifdef EXTRA_guash
HAVE_RESOURCE = YES
endif
ifdef EXTRA_user_filter
OBJECTS = \
libyywrap.o \
uf_eval.o \
uf_file.o \
uf_gui.o \
uf_lexer.o \
uf_main.o \
uf_parser.tab.o
endif
ifdef EXTRA_twain
OBJECTS = \
tw_func.o \
tw_util.o \
twain.o
EXTRALIBS = -luser32
endif
GIMP_VER = 1.1
GTK_VER = 1.3
GLIB_VER = 1.3
GTK = $(TOP)/../gtk+
GLIB = $(TOP)/../glib
GETTEXT = $(TOP)/../gettext-0.10.35
PLUGINDIR = $(TOP)/plug-ins
OPTIMIZE = -O
CC = gcc $(OPTIMIZE) -mno-cygwin -mpentium
CFLAGS = -DHAVE_CONFIG_H $(EXTRACFLAGS) -I. -I$(TOP) -I$(PLUGINDIR) -I$(PLUGINDIR)/libgck -I$(GLIB) -I$(GTK)/gdk/win32 -I$(GTK) -I$(GETTEXT)/intl
ifdef PLUGIN
# This part is used when building individual plug-ins
all : $(PLUGIN).exe
install : all
$(INSTALL) $(PLUGIN).exe $(BIN)
ifndef OBJECTS
OBJECTS = $(PLUGIN).o
endif
ifdef HAVE_RESOURCE
# We have our own resource file (just an icon, usually)
RESOURCE = $(PLUGIN)res.o
else
# Use the Wilber icon otherwise. If gimp.exe eventually gets more resources,
# this will have to be changed.
RESOURCE = ../../app/gimpres.o
endif
$(PLUGIN).exe : $(OBJECTS) $(RESOURCE)
$(CC) $(CFLAGS) -mwindows -s -o $(PLUGIN).exe $(OBJECTS) $(RESOURCE) -L $(PLUGINDIR)/megawidget -lmegawidget -L $(PLUGINDIR)/gpc -lgpc -L $(PLUGINDIR)/libgck/gck -lgck -L ../../libgimp -lgimp-$(GIMP_VER) -lgimpui-$(GIMP_VER) -L $(GTK)/gtk -lgtk-$(GTK_VER) -L $(GTK)/gdk/win32 -lgdk-$(GTK_VER) -L $(GETTEXT)/intl -lgnu-intl -L $(GLIB) -lglib-$(GLIB_VER) $(EXTRALIBS) $(LDFLAGS)
$(PLUGIN)res.o : $(PLUGIN).rc
windres $(PLUGIN).rc $(PLUGIN)res.o
endif
ifdef LIBRARY
# This part is used when building a library
all : lib$(LIBRARY).a
install : all
ifndef OBJECTS
OBJECTS = $(LIBRARY).o
endif
lib$(LIBRARY).a : $(OBJECTS)
-rm $@
ar rc $@ $(OBJECTS)
endif
.c.o :
$(CC) $(CFLAGS) -c $<
clean :
-rm *.o *.a *.exe
endif # ifndef FROMPLUGINSDIR

View File

@ -23,16 +23,17 @@ FROMPLUGINSDIR=YES # Used to bypass other parts below
# The COMMON* ones are in the common subdirectory
COMMON1 = CEL CML_explorer align_layers animationplay animoptimize apply_lens autocrop autostretch_hsv blinds blur borderaverage bumpmap c_astretch checkerboard colorify compose convmatrix cubism
COMMON2 = decompose deinterlace depthmerge despeckle destripe diffraction displace edge emboss engrave exchange film flarefx fractaltrace
COMMON3 = gauss_iir gauss_rle gbr gee gicon gif gifload glasstile gqbist gradmap grid gtm guillotine header hot hrz gz illusion jigsaw jpeg laplace lic
COMMON3 = gauss_iir gauss_rle gbr gee gicon gif gifload glasstile gqbist gradmap grid gtm guillotine header hot hrz gz illusion iwarp jigsaw jpeg laplace lic
COMMON4 = mapcolor max_rgb mblur newsprint nlfilt noisify normalize nova oilify palette papertile pat pcx pix pixelize plasma plugindetails png pnm polar ps psd randomize ripple rotate rotators
COMMON5 = scatter_hsv semiflatten sharpen shift smooth_palette snoise sobel sparkle spread tga threshold_alpha tiff tile tileit tiler video vinvert vpropagate waves whirlpinch wind wmf xbm zealouscrop
COMMON5 = scatter_hsv semiflatten sharpen shift smooth_palette snoise sobel sparkle spread sunras tga threshold_alpha tiff tile tileit tiler video vinvert vpropagate waves whirlpinch wind wmf xbm xwd zealouscrop
# These have own subdirectories each
SEPARATE = AlienMap FractalExplorer Lighting MapObject bmp dbbrowser faxg3 fits flame fp gfig gfli ifscompose maze mosaic pagecurl print rcm sgi sinus struc unsharp
# These are unofficial, ie not in the CVS. To build these, you should
# get tml's source snapshot and copy this makefile to the
# ..\unofficial-plug-ins directory, and do "nmake -f makefile.msc unofficial".
# ..\unofficial-plug-ins directory, go there, and do "nmake -f
# makefile.msc unofficial".
UNOFFICIAL = guash user_filter twain
@ -217,6 +218,7 @@ OBJECTS = \
!IFDEF EXTRA_ifscompose
OBJECTS = \
ifscompose.obj \
ifscompose_storage.obj \
ifscompose_utils.obj
!ENDIF
@ -273,8 +275,8 @@ OBJECTS = \
script-fu.obj \
script-fu-console.obj \
script-fu-scripts.obj \
regex.obj
EXTRALIBS = ..\dbbrowser\dbbrowser_utils.obj
regex.obj \
..\dbbrowser\dbbrowser_utils.obj
EXTRACFLAGS = -DREGEX_MALLOC
HAVE_RESOURCE = YES
!ENDIF
@ -371,10 +373,10 @@ OBJECTS = $(PLUGIN).obj
!ENDIF
!IFDEF HAVE_RESOURCE
# Do we have our own resource file (just an icon, usually)
# We have our own resource file (just an icon, usually)
RESOURCE = $(PLUGIN).res
!ELSE
# Use the Wilber icon otherwise. If gimp.exe sometime gets more resources,
# Use the Wilber icon otherwise. If gimp.exe eventually gets more resources,
# this will have to be changed.
RESOURCE = ..\..\app\gimp.res
!ENDIF

View File

@ -18,6 +18,8 @@
#include "config.h"
#include <glib.h> /* Include early for obscure Win32
build reasons */
#include <stdlib.h>
#include <stdio.h>
#include <string.h>

View File

@ -18,6 +18,8 @@
#include "config.h"
#include <glib.h> /* Include early for obscure Win32
build reasons */
#include <stdlib.h>
#include <stdio.h>
#include <string.h>