Commit b5d790e6 authored by Tor Lillqvist's avatar Tor Lillqvist

Add G_SQRT2.

	* app/appenv.h: Add G_SQRT2.

	* app/iscissors.c: Use it.

	* app/makefile.{cygwin,msc}: Add new files.

	* */makefile.{cygwin,msc}: Use libintl extracted from glibc from a
	separate directory, not from gettext, because of licensing issues
	(we want to use the LGPL version in GTk+, so use it here, too).
parent 1fd1919f
1999-08-16 Tor Lillqvist <tml@iki.fi>
* app/appenv.h: Add G_SQRT2.
* app/iscissors.c: Use it.
* app/makefile.{cygwin,msc}: Add new files.
* */makefile.{cygwin,msc}: Use libintl extracted from glibc from a
separate directory, not from gettext, because of licensing issues
(we want to use the LGPL version in GTk+, so use it here, too).
Sun Aug 15 20:42:04 PDT 1999 Manish Singh <yosh@gimp.org>
* app/appenv.h: added a G_PI_2
......
......@@ -12,11 +12,19 @@ or gcc without the produced executables depending on the cygwin dll
necessary for building with gcc, what version you want and where to
get it, etc, read README.win32 in the GLib 1.3 distribution.
The GIMP wants to be built with the GNU gettext library for
The GIMP wants to be built with the GNU "intl" library for
internationalisation (i18n). Get the version ported to Win32 (not a
very big deal) from tml's web site mentioned above. If you don't want
any i18n stuff, undefine ENABLE_NLS in the config.h.win32 file, and
remove references to the gnu-intl library from the makefiles.
very big deal) from tml's web site mentioned above. We build the
"intl" library to a DLL called gnu-intl.dll to reduce name clash
risks. If you don't want any i18n stuff, undefine ENABLE_NLS in the
config.h.win32 file, and remove references to the gnu-intl library
from the makefiles.
Note that while the GNU gettext package is under the GPL, the "intl"
library part as distributed with GNU libc is under the LGPL (like GTk+
or GLib). We want the LGPL one, even if they are the same, more or
less. It doesn't matter much for the GIMP which itself is under the
GPL, but does a bit for GTk+, which is under the LGPL.
First, build in the libgimp directory, then in tools/gcg, then in app,
plug-ins, and finally in modules. Check the makefile.msc or
......
......@@ -51,6 +51,9 @@
#ifndef G_PI_4 /* As will G_PI_4 */
#define G_PI_4 0.78539816339744830962
#endif
#ifndef G_SQRT2 /* As will G_SQRT2 */
#define G_SQRT2 1.4142135623730951
#endif
#ifdef HAVE_RINT
#define RINT(x) rint(x)
......
......@@ -1209,7 +1209,7 @@ precalculate_arrays (void)
for (i = 0; i < 256; i++)
{
/* The diagonal weight array */
diagonal_weight [i] = (int) (i * M_SQRT2);
diagonal_weight [i] = (int) (i * G_SQRT2);
/* The direction value array */
direction_value [i][0] = (127 - abs (127 - i)) * 2;
......
......@@ -24,9 +24,9 @@ GLIB_VER = 1.3
GTK = ../../gtk+
GLIB = ../../glib
GMODULE = $(GLIB)/gmodule
GETTEXT = ../../gettext-0.10.35
INTL = ../../intl
CFLAGS = $(OPTIMIZE) -DREGEX_MALLOC -DHAVE_CONFIG_H -I. -I.. -I$(GLIB) -I$(GMODULE) -I$(GTK)/gdk/win32 -I$(GTK) -I$(GETTEXT)/intl
CFLAGS = $(OPTIMIZE) -DREGEX_MALLOC -DHAVE_CONFIG_H -I. -I.. -I$(GLIB) -I$(GMODULE) -I$(GTK)/gdk/win32 -I$(GTK) -I$(INTL)
GCG = ../tools/gcg/gcg -I. -I../tools/gcg/gh
......@@ -177,10 +177,12 @@ gimp_OBJECTS = \
lut_funcs.o \
magnify.o \
main.o \
measure.o \
menus.o \
misc_cmds.o \
module_db.o \
move.o \
nav_window.o \
ops_buttons.o \
palette.o \
palette_cmds.o \
......@@ -253,16 +255,21 @@ gimp.def: gimp.sym
gimp.exe : ../config.h $(gimp_OBJECTS) libgimpim.a gimp.def gimpres.o
# This is sickening.
$(CC) $(CFLAGS) -Wl,--base-file,gimp.base -mwindows -o gimp.exe $(gimp_OBJECTS) -L . -lgimpim -L ../libgimp -lgimpi -L $(GTK)/gtk -lgtk-$(GTK_VER) -L $(GTK)/gdk/win32 -lgdk-$(GTK_VER) -L $(GETTEXT)/intl -lgnu-intl -L $(GLIB) -lglib-$(GLIB_VER) -lgmodule-$(GLIB_VER) gimpres.o -lgdi32 -luser32
$(CC) $(CFLAGS) -Wl,--base-file,gimp.base -mwindows -o gimp.exe $(gimp_OBJECTS) -L . -lgimpim -L ../libgimp -lgimpi -L $(GTK)/gtk -lgtk-$(GTK_VER) -L $(GTK)/gdk/win32 -lgdk-$(GTK_VER) -L $(INTL) -lgnu-intl -L $(GLIB) -lglib-$(GLIB_VER) -lgmodule-$(GLIB_VER) gimpres.o -lgdi32 -luser32
$(DLLTOOL) --base-file gimp.base --input-def gimp.def --output-exp gimp.exp
$(CC) $(CFLAGS) -Wl,--base-file,gimp.base,gimp.exp -mwindows -o gimp.exe $(gimp_OBJECTS) -L . -lgimpim -L ../libgimp -lgimpi -L $(GTK)/gtk -lgtk-$(GTK_VER) -L $(GTK)/gdk/win32 -lgdk-$(GTK_VER) -L $(GETTEXT)/intl -lgnu-intl -L $(GLIB) -lglib-$(GLIB_VER) -lgmodule-$(GLIB_VER) gimpres.o -lgdi32 -luser32
$(CC) $(CFLAGS) -Wl,--base-file,gimp.base,gimp.exp -mwindows -o gimp.exe $(gimp_OBJECTS) -L . -lgimpim -L ../libgimp -lgimpi -L $(GTK)/gtk -lgtk-$(GTK_VER) -L $(GTK)/gdk/win32 -lgdk-$(GTK_VER) -L $(INTL) -lgnu-intl -L $(GLIB) -lglib-$(GLIB_VER) -lgmodule-$(GLIB_VER) gimpres.o -lgdi32 -luser32
$(DLLTOOL) --base-file gimp.base --input-def gimp.def --output-exp gimp.exp
$(CC) -v $(CFLAGS) -Wl,gimp.exp -mwindows -o gimp.exe $(gimp_OBJECTS) -L. -lgimpim -L ../libgimp -lgimpi -L $(GTK)/gtk -lgtk-$(GTK_VER) -L $(GTK)/gdk/win32 -lgdk-$(GTK_VER) -L $(GETTEXT)/intl -lgnu-intl -L $(GLIB) -lglib-$(GLIB_VER) -lgmodule-$(GLIB_VER) gimpres.o -lgdi32 -luser32
$(CC) -v $(CFLAGS) -Wl,gimp.exp -mwindows -o gimp.exe $(gimp_OBJECTS) -L. -lgimpim -L ../libgimp -lgimpi -L $(GTK)/gtk -lgtk-$(GTK_VER) -L $(GTK)/gdk/win32 -lgdk-$(GTK_VER) -L $(INTL) -lgnu-intl -L $(GLIB) -lglib-$(GLIB_VER) -lgmodule-$(GLIB_VER) gimpres.o -lgdi32 -luser32
$(DLLTOOL) --dllname gimp.exe gimp.def --output-lib libgimp.a $(gimp_OBJECTS)
.SUFFIXES: .c .o .i
# General rule for building $(gimp_OBJECTS)
.c.o:
$(CC) $(CFLAGS) -c $<
.c.i:
$(CC) $(CFLAGS) -E $< >$@
clean:
-rm *.exe *.a *.o *.base *.exp
......@@ -31,9 +31,9 @@ GLIB_VER = 1.3
GTK = ..\..\gtk+
GLIB = ..\..\glib
GMODULE = $(GLIB)\gmodule
GETTEXT = ..\..\gettext-0.10.35
INTL = ..\..\intl
CFLAGS = -DREGEX_MALLOC -DHAVE_CONFIG_H -I. -I.. -I$(GLIB) -I$(GMODULE) -I$(GTK)\gdk\win32 -I$(GTK) -I$(GETTEXT)\intl
CFLAGS = -DREGEX_MALLOC -DHAVE_CONFIG_H -I. -I.. -I$(GLIB) -I$(GMODULE) -I$(GTK)\gdk\win32 -I$(GTK) -I$(INTL)
GCG = ..\tools\gcg\gcg -I. -I ..\tools\gcg\gh
......@@ -188,10 +188,12 @@ gimp_OBJECTS = \
lut_funcs.obj \
magnify.obj \
main.obj \
measure.obj \
menus.obj \
misc_cmds.obj \
module_db.obj \
move.obj \
nav_window.obj \
ops_buttons.obj \
palette.obj \
palette_cmds.obj \
......@@ -263,7 +265,7 @@ gimp.def: gimp.sym
copy /y $@+gimp.sym $@
gimp.exe : ..\config.h $(gimp_OBJECTS) gimpim.lib gimp.def gimp.res ..\libgimp\gimpi.lib
$(CC) $(CFLAGS) -Fegimp.exe $(gimp_OBJECTS) gimpim.lib ..\libgimp\gimpi.lib $(GTK)\gtk\gtk-$(GTK_VER).lib $(GTK)\gdk\win32\gdk-$(GTK_VER).lib $(GETTEXT)\intl\gnu-intl.lib $(GLIB)\glib-$(GLIB_VER).lib $(GLIB)\gmodule-$(GLIB_VER).lib $(LDFLAGS) gimp.res gdi32.lib user32.lib /def:gimp.def
$(CC) $(CFLAGS) -Fegimp.exe $(gimp_OBJECTS) gimpim.lib ..\libgimp\gimpi.lib $(GTK)\gtk\gtk-$(GTK_VER).lib $(GTK)\gdk\win32\gdk-$(GTK_VER).lib $(INTL)\gnu-intl.lib $(GLIB)\glib-$(GLIB_VER).lib $(GLIB)\gmodule-$(GLIB_VER).lib $(LDFLAGS) gimp.res gdi32.lib user32.lib /def:gimp.def
# General rule for building $(gimp_OBJECTS)
.c.obj:
......
......@@ -1209,7 +1209,7 @@ precalculate_arrays (void)
for (i = 0; i < 256; i++)
{
/* The diagonal weight array */
diagonal_weight [i] = (int) (i * M_SQRT2);
diagonal_weight [i] = (int) (i * G_SQRT2);
/* The direction value array */
direction_value [i][0] = (127 - abs (127 - i)) * 2;
......
......@@ -1209,7 +1209,7 @@ precalculate_arrays (void)
for (i = 0; i < 256; i++)
{
/* The diagonal weight array */
diagonal_weight [i] = (int) (i * M_SQRT2);
diagonal_weight [i] = (int) (i * G_SQRT2);
/* The direction value array */
direction_value [i][0] = (127 - abs (127 - i)) * 2;
......
......@@ -29,11 +29,11 @@ GIMP_VER = 1.1
GTK = ../../gtk+
GLIB = ../../glib
GETTEXT = ../../gettext-0.10.35
INTL = ../../intl
GIMP_VER = 1.1
CFLAGS = $(OPTIMIZE) -I.. -I$(GLIB) -I$(GTK)/gdk/win32 -I$(GTK) -I$(GETTEXT)/intl -DGIMPDIR=\"$(GIMPDIR)\"
CFLAGS = $(OPTIMIZE) -I.. -I$(GLIB) -I$(GTK)/gdk/win32 -I$(GTK) -I$(INTL) -DGIMPDIR=\"$(GIMPDIR)\"
all : \
../config.h \
......@@ -85,7 +85,7 @@ gimp_OBJECTS = \
parasite.o
gimp-$(GIMP_VER).dll : $(gimp_OBJECTS) gimp.def
$(GLIB)/build-dll gimp $(GIMP_VER) gimp.def -s $(gimp_OBJECTS) -L $(GETTEXT)/intl -lgnu-intl -L $(GLIB) -lglib-$(GLIB_VER) -luser32
$(GLIB)/build-dll gimp $(GIMP_VER) gimp.def -s $(gimp_OBJECTS) -L $(INTL) -lgnu-intl -L $(GLIB) -lglib-$(GLIB_VER) -luser32
# Pass -DLIBGIMP_COMPILATION when compiling gimp_OBJECTS
......@@ -134,7 +134,7 @@ gimpui_OBJECTS = \
gimppatternmenu.o
gimpui-$(GIMP_VER).dll : $(gimpui_OBJECTS) gimpui.def
$(GLIB)/build-dll gimpui $(GIMP_VER) gimpui.def -s $(gimpui_OBJECTS) -L . -lgimp-$(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)
$(GLIB)/build-dll gimpui $(GIMP_VER) gimpui.def -s $(gimpui_OBJECTS) -L . -lgimp-$(GIMP_VER) -L $(GTK)/gtk -lgtk-$(GTK_VER) -L $(GTK)/gdk/win32 -lgdk-$(GTK_VER) -L $(INTL) -lgnu-intl -L $(GLIB) -lglib-$(GLIB_VER)
# General rule for compiling, used by the objects that don't go into
# gimp-$(GIMP_VER).dll.
......
......@@ -37,9 +37,9 @@ GLIB_VER = 1.3
GTK = ..\..\gtk+
GLIB = ..\..\glib
GETTEXT = ..\..\gettext-0.10.35
INTL = ..\..\intl
CFLAGS = -I.. -I$(GLIB) -I$(GTK)\gdk\win32 -I$(GTK) -I$(GETTEXT)\intl -DGIMPDIR=\"$(GIMPDIR)\"
CFLAGS = -I.. -I$(GLIB) -I$(GTK)\gdk\win32 -I$(GTK) -I$(INTL) -DGIMPDIR=\"$(GIMPDIR)\"
all : \
..\config.h \
......@@ -91,7 +91,7 @@ gimp_OBJECTS = \
parasite.obj
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
$(CC) $(CFLAGS) -LD -Fegimp-$(GIMP_VER).dll $(gimp_OBJECTS) $(INTL)\gnu-intl.lib $(GLIB)\glib-$(GLIB_VER).lib $(LDFLAGS) user32.lib /def:gimp.def
# Pass -DLIBGIMP_COMPILATION when compiling gimp_OBJECTS
......@@ -140,7 +140,7 @@ gimpui_OBJECTS = \
gimppatternmenu.obj
gimpui-$(GIMP_VER).dll : $(gimpui_OBJECTS) gimpui.def
$(CC) $(CFLAGS) -LD -Fegimpui-$(GIMP_VER).dll $(gimpui_OBJECTS) gimp-$(GIMP_VER).lib $(GTK)\gtk\gtk-$(GTK_VER).lib $(GTK)\gdk\win32\gdk-$(GTK_VER).lib $(GETTEXT)\intl\gnu-intl.lib $(GLIB)\glib-$(GLIB_VER).lib $(LDFLAGS) /def:gimpui.def
$(CC) $(CFLAGS) -LD -Fegimpui-$(GIMP_VER).dll $(gimpui_OBJECTS) gimp-$(GIMP_VER).lib $(GTK)\gtk\gtk-$(GTK_VER).lib $(GTK)\gdk\win32\gdk-$(GTK_VER).lib $(INTL)\gnu-intl.lib $(GLIB)\glib-$(GLIB_VER).lib $(LDFLAGS) /def:gimpui.def
gimpmenu.obj : gimpmenu.c
$(CC) $(CFLAGS) -GD -c gimpmenu.c
......
......@@ -379,7 +379,7 @@ GLIB_VER = 1.3
GTK = $(TOP)/../gtk+
GLIB = $(TOP)/../glib
GETTEXT = $(TOP)/../gettext-0.10.35
INTL = $(TOP)/../intl
PLUGINDIR = $(TOP)/plug-ins
......@@ -387,7 +387,7 @@ OPTIMIZE = -O
CC = gcc $(OPTIMIZE) -mno-cygwin -mpentium -fnative-struct
CFLAGS = -DHAVE_CONFIG_H $(EXTRACFLAGS) -I. -I$(TOP) -I$(PLUGINDIR) -I$(PLUGINDIR)/libgck -I$(GLIB) -I$(GTK)/gdk/win32 -I$(GTK) -I$(GETTEXT)/intl
CFLAGS = -DHAVE_CONFIG_H $(EXTRACFLAGS) -I. -I$(TOP) -I$(PLUGINDIR) -I$(PLUGINDIR)/libgck -I$(GLIB) -I$(GTK)/gdk/win32 -I$(GTK) -I$(INTL)
ifdef PLUGIN
......@@ -412,7 +412,7 @@ 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)
$(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 $(INTL) -lgnu-intl -L $(GLIB) -lglib-$(GLIB_VER) $(EXTRALIBS) $(LDFLAGS)
# Kludge to get the path to the win32 headers
WIN32APIHEADERS = $(shell echo "\#include <winver.h>" | $(CC) -M -E - | tail -1 | sed -e 's!/winver.h!!')
......
......@@ -404,7 +404,7 @@ GLIB_VER = 1.3
GTK = $(TOP)\..\gtk+
GLIB = $(TOP)\..\glib
GETTEXT = $(TOP)\..\gettext-0.10.35
INTL = $(TOP)\..\intl
PLUGINDIR = $(TOP)\plug-ins
......@@ -426,7 +426,7 @@ RTL = -MDd
CC = cl -nologo -G5 -GF $(OPTIMIZE) $(RTL) -W2 -Zm200
CFLAGS = -DHAVE_CONFIG_H $(EXTRACFLAGS) -I. -I$(TOP) -I$(PLUGINDIR) -I$(PLUGINDIR)\libgck -I$(GLIB) -I$(GTK)\gdk\win32 -I$(GTK) -I$(GETTEXT)\intl
CFLAGS = -DHAVE_CONFIG_H $(EXTRACFLAGS) -I. -I$(TOP) -I$(PLUGINDIR) -I$(PLUGINDIR)\libgck -I$(GLIB) -I$(GTK)\gdk\win32 -I$(GTK) -I$(INTL)
LDFLAGS = /link /subsystem:windows /machine:ix86 $(LINKDEBUG)
......@@ -453,7 +453,7 @@ RESOURCE = ..\..\app\gimp.res
!ENDIF
$(PLUGIN).exe : $(OBJECTS) $(RESOURCE)
$(CC) $(CFLAGS) -MD -Fe$(PLUGIN).exe $(OBJECTS) $(RESOURCE) $(PLUGINDIR)\megawidget\megawidget.lib $(PLUGINDIR)\gpc\gpc.lib $(PLUGINDIR)\libgck\gck\gck.lib ..\..\libgimp\gimp-$(GIMP_VER).lib ..\..\libgimp\gimpui-$(GIMP_VER).lib $(GTK)\gtk\gtk-$(GTK_VER).lib $(GTK)\gdk\win32\gdk-$(GTK_VER).lib $(GETTEXT)\intl\gnu-intl.lib $(GLIB)\glib-$(GLIB_VER).lib $(EXTRALIBS) $(LDFLAGS)
$(CC) $(CFLAGS) -MD -Fe$(PLUGIN).exe $(OBJECTS) $(RESOURCE) $(PLUGINDIR)\megawidget\megawidget.lib $(PLUGINDIR)\gpc\gpc.lib $(PLUGINDIR)\libgck\gck\gck.lib ..\..\libgimp\gimp-$(GIMP_VER).lib ..\..\libgimp\gimpui-$(GIMP_VER).lib $(GTK)\gtk\gtk-$(GTK_VER).lib $(GTK)\gdk\win32\gdk-$(GTK_VER).lib $(INTL)\gnu-intl.lib $(GLIB)\glib-$(GLIB_VER).lib $(EXTRALIBS) $(LDFLAGS)
$(PLUGIN).res : $(PLUGIN).rc
rc -r -fo $(PLUGIN).res $(PLUGIN).rc
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment