Similar additions for Win32 as in the other libgimp*/Makefile.am files:
2002-12-23 Tor Lillqvist <tml@iki.fi> * libgimpwidgets/Makefile.am: Similar additions for Win32 as in the other libgimp*/Makefile.am files: Use -no-undefined. Use the .def file. Produce MS style import library if possible. Install and uninstall import libraries. (AM_CPPFLAGS) Define LT_RELEASE and LT_CURRENT_MINUS_AGE. (libgimpwidgets_1_3_la_sources) Include libgimp-glue.c * libgimpwidgets/libgimp-glue.c: Bypass whole file unless Win32. (dynamic_resolve): Try both the libtool style DLL name and Hans Breuer's naming scheme. (gimp_*) Replace duplicated code snippets with calls of a preprocessor macro.
This commit is contained in:

committed by
Tor Lillqvist

parent
94a198e5a7
commit
f2c42c9459
13
ChangeLog
13
ChangeLog
@ -15,6 +15,19 @@
|
|||||||
* libgimpmodule/Makefile.am (INCLUDES): Add GMODULE_CFLAGS.
|
* libgimpmodule/Makefile.am (INCLUDES): Add GMODULE_CFLAGS.
|
||||||
(LIBADD): Add GMODULE_LIBS.
|
(LIBADD): Add GMODULE_LIBS.
|
||||||
|
|
||||||
|
* libgimpwidgets/Makefile.am: Similar additions for Win32 as in
|
||||||
|
the other libgimp*/Makefile.am files: Use -no-undefined. Use the
|
||||||
|
.def file. Produce MS style import library if possible. Install
|
||||||
|
and uninstall import libraries.
|
||||||
|
(AM_CPPFLAGS) Define LT_RELEASE and LT_CURRENT_MINUS_AGE.
|
||||||
|
(libgimpwidgets_1_3_la_sources) Include libgimp-glue.c
|
||||||
|
|
||||||
|
* libgimpwidgets/libgimp-glue.c: Bypass whole file unless Win32.
|
||||||
|
(dynamic_resolve): Try both the libtool style DLL name and Hans
|
||||||
|
Breuer's naming scheme.
|
||||||
|
(gimp_*) Replace duplicated code snippets with calls of a
|
||||||
|
preprocessor macro.
|
||||||
|
|
||||||
2002-12-21 Maurits Rijk <lpeek.mrijk@consunet.nl>
|
2002-12-21 Maurits Rijk <lpeek.mrijk@consunet.nl>
|
||||||
|
|
||||||
* plug-ins/imagemap/imap_csim.l: add "<string.h> to remove warning.
|
* plug-ins/imagemap/imap_csim.l: add "<string.h> to remove warning.
|
||||||
|
@ -1,9 +1,52 @@
|
|||||||
## Process this file with automake to produce Makefile.in
|
## Process this file with automake to produce Makefile.in
|
||||||
|
|
||||||
|
if PLATFORM_WIN32
|
||||||
|
no_undefined = -no-undefined
|
||||||
|
conditional_libgimpcolor_la = ../libgimpcolor/libgimpcolor-1.3.la
|
||||||
|
endif
|
||||||
|
|
||||||
|
if PLATFORM_WIN32
|
||||||
|
else
|
||||||
|
libm = -lm
|
||||||
|
endif
|
||||||
|
|
||||||
|
if OS_WIN32
|
||||||
|
gimpwidgets_def = gimpwidgets.def
|
||||||
|
libgimpwidgets_export_symbols = -export-symbols gimpwidgets.def
|
||||||
|
|
||||||
|
install-libtool-import-lib:
|
||||||
|
$(INSTALL) .libs/libgimpwidgets-1.3.dll.a $(DESTDIR)$(libdir)
|
||||||
|
|
||||||
|
uninstall-libtool-import-lib:
|
||||||
|
-rm $(DESTDIR)$(libdir)/libgimpwidgets-1.3.dll.a
|
||||||
|
else
|
||||||
|
install-libtool-import-lib:
|
||||||
|
uninstall-libtool-import-lib:
|
||||||
|
endif
|
||||||
|
|
||||||
|
if MS_LIB_AVAILABLE
|
||||||
|
noinst_DATA = gimpwidgets-1.3.lib
|
||||||
|
|
||||||
|
install-ms-lib:
|
||||||
|
$(INSTALL) gimpwidgets-1.3.lib $(DESTDIR)$(libdir)
|
||||||
|
|
||||||
|
uninstall-ms-lib:
|
||||||
|
-rm $(DESTDIR)$(libdir)/gimpwidgets-1.3.lib
|
||||||
|
|
||||||
|
gimpwidgets-1.3.lib: gimpwidgets.def
|
||||||
|
lib -name:libgimpwidgets-1.3-@LT_CURRENT_MINUS_AGE@.dll -def:gimpwidgets.def -out:$@
|
||||||
|
|
||||||
|
else
|
||||||
|
install-ms-lib:
|
||||||
|
uninstall-ms-lib:
|
||||||
|
endif
|
||||||
|
|
||||||
libgimpwidgetsincludedir = $(includedir)/gimp-$(LT_RELEASE)/libgimpwidgets
|
libgimpwidgetsincludedir = $(includedir)/gimp-$(LT_RELEASE)/libgimpwidgets
|
||||||
|
|
||||||
AM_CPPFLAGS = \
|
AM_CPPFLAGS = \
|
||||||
-DG_LOG_DOMAIN=\"LibGimpWidgets\" \
|
-DG_LOG_DOMAIN=\"LibGimpWidgets\" \
|
||||||
|
-DLT_RELEASE=\"@LT_RELEASE@\" \
|
||||||
|
-DLT_CURRENT_MINUS_AGE=\"@LT_CURRENT_MINUS_AGE@\" \
|
||||||
@GIMP_THREAD_FLAGS@
|
@GIMP_THREAD_FLAGS@
|
||||||
|
|
||||||
INCLUDES = \
|
INCLUDES = \
|
||||||
@ -58,7 +101,8 @@ libgimpwidgets_1_3_la_sources = \
|
|||||||
gimpstock.c \
|
gimpstock.c \
|
||||||
gimpstock.h \
|
gimpstock.h \
|
||||||
gimpunitmenu.c \
|
gimpunitmenu.c \
|
||||||
gimpunitmenu.h
|
gimpunitmenu.h \
|
||||||
|
libgimp-glue.c
|
||||||
|
|
||||||
libgimpwidgets_1_3_la_built_sources = \
|
libgimpwidgets_1_3_la_built_sources = \
|
||||||
gimpwidgetsmarshal.c \
|
gimpwidgetsmarshal.c \
|
||||||
@ -67,8 +111,6 @@ libgimpwidgets_1_3_la_built_sources = \
|
|||||||
libgimpwidgets_1_3_la_extra_sources = gimpwidgetsmarshal.list
|
libgimpwidgets_1_3_la_extra_sources = gimpwidgetsmarshal.list
|
||||||
|
|
||||||
EXTRA_DIST = \
|
EXTRA_DIST = \
|
||||||
makefile.mingw \
|
|
||||||
makefile.mingw.in \
|
|
||||||
makefile.msc \
|
makefile.msc \
|
||||||
gimpwidgets.def \
|
gimpwidgets.def \
|
||||||
$(libgimpwidgets_1_3_la_extra_sources)
|
$(libgimpwidgets_1_3_la_extra_sources)
|
||||||
@ -103,9 +145,13 @@ libgimpwidgetsinclude_HEADERS = \
|
|||||||
gimpunitmenu.h
|
gimpunitmenu.h
|
||||||
|
|
||||||
libgimpwidgets_1_3_la_LDFLAGS = \
|
libgimpwidgets_1_3_la_LDFLAGS = \
|
||||||
-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
|
-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
|
||||||
|
$(no_undefined) \
|
||||||
|
$(libgimpwidgets_export_symbols)
|
||||||
|
|
||||||
libgimpwidgets_1_3_la_LIBADD = $(GLIB_LIBS) -lm
|
libgimpwidgets_1_3_la_LIBADD = $(conditional_libgimpcolor_la) $(GTK_LIBS) $(libm)
|
||||||
|
|
||||||
|
libgimpwidgets_1_3_la_DEPENDENCIES = $(gimpwidgets_def)
|
||||||
|
|
||||||
#
|
#
|
||||||
# rules to generate built sources
|
# rules to generate built sources
|
||||||
@ -125,3 +171,6 @@ $(srcdir)/gimpwidgetsmarshal.c: $(srcdir)/gimpwidgetsmarshal.h
|
|||||||
&& cp xgen-gwmc $(@F) \
|
&& cp xgen-gwmc $(@F) \
|
||||||
&& rm -f xgen-gwmc xgen-gwmc~
|
&& rm -f xgen-gwmc xgen-gwmc~
|
||||||
|
|
||||||
|
install-data-local: install-ms-lib install-libtool-import-lib
|
||||||
|
|
||||||
|
uninstall-local: uninstall-ms-lib uninstall-libtool-import-lib
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
/*
|
/*
|
||||||
* Supports dynamic linking at run-time against
|
* Supports dynamic linking at run-time against
|
||||||
* libgimp (if used by a plug-in, or gimp.exe
|
* libgimp (if used by a plug-in, or gimp.exe
|
||||||
* if used by itself)
|
* if used by gimp.exe itself)
|
||||||
*
|
*
|
||||||
|
|
||||||
gimp_palette_get_background
|
gimp_palette_get_background
|
||||||
@ -42,6 +42,8 @@ gimp_unit_get_symbol
|
|||||||
|
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
|
|
||||||
|
#ifdef G_OS_WIN32 /* Bypass whole file otherwise */
|
||||||
|
|
||||||
#include "libgimpcolor/gimpcolortypes.h"
|
#include "libgimpcolor/gimpcolortypes.h"
|
||||||
#include "libgimpbase/gimpbasetypes.h"
|
#include "libgimpbase/gimpbasetypes.h"
|
||||||
#include "libgimpbase/gimpunit.h"
|
#include "libgimpbase/gimpunit.h"
|
||||||
@ -55,13 +57,15 @@ gimp_unit_get_symbol
|
|||||||
|
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
|
||||||
|
typedef int voidish;
|
||||||
|
|
||||||
/* function pointer prototypes */
|
/* function pointer prototypes */
|
||||||
typedef gboolean (* PFN_QueryColor) (GimpRGB *color);
|
typedef gboolean (* PFN_QueryColor) (GimpRGB *color);
|
||||||
typedef gchar* (* PFN_GetUnitStr) (GimpUnit);
|
typedef gchar* (* PFN_GetUnitStr) (GimpUnit);
|
||||||
typedef gdouble (* PFN_GetUnitInt) (GimpUnit);
|
typedef gdouble (* PFN_GetUnitInt) (GimpUnit);
|
||||||
typedef gdouble (* PFN_GetUnitDouble) (GimpUnit);
|
typedef gdouble (* PFN_GetUnitDouble) (GimpUnit);
|
||||||
typedef gint (* PFN_GetNumber) (void);
|
typedef gint (* PFN_GetNumber) (void);
|
||||||
typedef void (* PFN_Help) (const char*);
|
typedef voidish (* PFN_Help) (const char*);
|
||||||
|
|
||||||
static FARPROC
|
static FARPROC
|
||||||
dynamic_resolve (const gchar* name, HMODULE* hMod)
|
dynamic_resolve (const gchar* name, HMODULE* hMod)
|
||||||
@ -74,7 +78,11 @@ dynamic_resolve (const gchar* name, HMODULE* hMod)
|
|||||||
|
|
||||||
if (!fn)
|
if (!fn)
|
||||||
{
|
{
|
||||||
*hMod = LoadLibrary ("gimp-1.3.dll");
|
/* First try the libtool style name */
|
||||||
|
*hMod = LoadLibrary ("libgimp-" LT_RELEASE "-" LT_CURRENT_MINUS_AGE ".dll");
|
||||||
|
/* If that didn't work, try the name style used by Hans Breuer */
|
||||||
|
if (!hMod)
|
||||||
|
*hMod = LoadLibrary ("gimp-1.3.dll");
|
||||||
fn = GetProcAddress (*hMod, name);
|
fn = GetProcAddress (*hMod, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -84,154 +92,41 @@ dynamic_resolve (const gchar* name, HMODULE* hMod)
|
|||||||
return fn;
|
return fn;
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
#define ENTRY(type, name, parlist, defaultval, fntype, arglist) \
|
||||||
gimp_palette_get_foreground (GimpRGB *color)
|
type \
|
||||||
{
|
name parlist \
|
||||||
HMODULE h = NULL;
|
{ \
|
||||||
gboolean ret = FALSE;
|
HMODULE h = NULL; \
|
||||||
PFN_QueryColor fn = (PFN_QueryColor) dynamic_resolve ("gimp_palette_get_foreground", &h);
|
type ret = defaultval; \
|
||||||
if (fn)
|
fntype fn = (fntype) dynamic_resolve (#name, &h); \
|
||||||
ret = fn (color);
|
if (fn) \
|
||||||
|
ret = fn arglist; \
|
||||||
if (h)
|
\
|
||||||
FreeLibrary (h);
|
if (h) \
|
||||||
return ret;
|
FreeLibrary (h); \
|
||||||
|
return ret; \
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
ENTRY (gboolean, gimp_palette_get_foreground, (GimpRGB *color), FALSE, PFN_QueryColor, (color));
|
||||||
gimp_palette_get_background (GimpRGB *color)
|
|
||||||
{
|
|
||||||
HMODULE h = NULL;
|
|
||||||
gboolean ret = FALSE;
|
|
||||||
PFN_QueryColor fn = (PFN_QueryColor) dynamic_resolve ("gimp_palette_get_background", &h);
|
|
||||||
if (fn)
|
|
||||||
ret = fn (color);
|
|
||||||
|
|
||||||
if (h)
|
ENTRY (gboolean, gimp_palette_get_background, (GimpRGB *color), FALSE, PFN_QueryColor, (color));
|
||||||
FreeLibrary (h);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
ENTRY (voidish, gimp_standard_help_func, (const gchar *help_data), 0, PFN_Help, (help_data));
|
||||||
gimp_standard_help_func (const gchar *help_data)
|
|
||||||
{
|
|
||||||
HMODULE h = NULL;
|
|
||||||
PFN_Help fn = (PFN_Help) dynamic_resolve ("gimp_standard_help_func", &h);
|
|
||||||
if (fn)
|
|
||||||
fn (help_data);
|
|
||||||
|
|
||||||
if (h)
|
ENTRY (const gchar *, gimp_unit_get_abbreviation, (GimpUnit unit), NULL, PFN_GetUnitStr, (unit));
|
||||||
FreeLibrary (h);
|
|
||||||
}
|
|
||||||
|
|
||||||
const gchar *
|
ENTRY (const gchar *, gimp_unit_get_singular, (GimpUnit unit), NULL, PFN_GetUnitStr, (unit));
|
||||||
gimp_unit_get_abbreviation (GimpUnit unit)
|
|
||||||
{
|
|
||||||
HMODULE h = NULL;
|
|
||||||
gchar* ret = NULL;
|
|
||||||
PFN_GetUnitStr fn = (PFN_GetUnitStr) dynamic_resolve ("gimp_unit_get_abbreviation", &h);
|
|
||||||
if (fn)
|
|
||||||
ret = fn (unit);
|
|
||||||
|
|
||||||
if (h)
|
ENTRY (const gchar *, gimp_unit_get_plural, (GimpUnit unit), NULL, PFN_GetUnitStr, (unit));
|
||||||
FreeLibrary (h);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
const gchar *
|
ENTRY (gint, gimp_unit_get_digits, (GimpUnit unit), 0, PFN_GetUnitInt, (unit));
|
||||||
gimp_unit_get_singular (GimpUnit unit)
|
|
||||||
{
|
|
||||||
HMODULE h = NULL;
|
|
||||||
gchar* ret = NULL;
|
|
||||||
PFN_GetUnitStr fn = (PFN_GetUnitStr) dynamic_resolve ("gimp_unit_get_singular", &h);
|
|
||||||
if (fn)
|
|
||||||
ret = fn (unit);
|
|
||||||
|
|
||||||
if (h)
|
ENTRY (gdouble, gimp_unit_get_factor, (GimpUnit unit), 0., PFN_GetUnitDouble, (unit));
|
||||||
FreeLibrary (h);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
const gchar *
|
ENTRY (gint, gimp_unit_get_number_of_built_in_units, (void), 0, PFN_GetNumber, ());
|
||||||
gimp_unit_get_plural (GimpUnit unit)
|
|
||||||
{
|
|
||||||
HMODULE h = NULL;
|
|
||||||
gchar* ret = NULL;
|
|
||||||
PFN_GetUnitStr fn = (PFN_GetUnitStr) dynamic_resolve ("gimp_unit_get_plural", &h);
|
|
||||||
if (fn)
|
|
||||||
ret = fn (unit);
|
|
||||||
|
|
||||||
if (h)
|
ENTRY (gint, gimp_unit_get_number_of_units, (void), 0, PFN_GetNumber, ());
|
||||||
FreeLibrary (h);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
gint
|
ENTRY (const gchar *, gimp_unit_get_symbol, (GimpUnit unit), NULL, PFN_GetUnitStr, (unit));
|
||||||
gimp_unit_get_digits (GimpUnit unit)
|
|
||||||
{
|
|
||||||
HMODULE h = NULL;
|
|
||||||
gint ret = 0;
|
|
||||||
PFN_GetUnitInt fn = (PFN_GetUnitInt) dynamic_resolve ("gimp_unit_get_digits", &h);
|
|
||||||
if (fn)
|
|
||||||
ret = fn (unit);
|
|
||||||
|
|
||||||
if (h)
|
#endif /* G_OS_WIN32 */
|
||||||
FreeLibrary (h);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
gdouble
|
|
||||||
gimp_unit_get_factor (GimpUnit unit)
|
|
||||||
{
|
|
||||||
HMODULE h = NULL;
|
|
||||||
gdouble ret = 0.0;
|
|
||||||
PFN_GetUnitDouble fn = (PFN_GetUnitDouble) dynamic_resolve ("gimp_unit_get_factor", &h);
|
|
||||||
if (fn)
|
|
||||||
ret = fn (unit);
|
|
||||||
|
|
||||||
if (h)
|
|
||||||
FreeLibrary (h);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
gint
|
|
||||||
gimp_unit_get_number_of_built_in_units (void)
|
|
||||||
{
|
|
||||||
HMODULE h = NULL;
|
|
||||||
gint ret = 0;
|
|
||||||
PFN_GetNumber fn = (PFN_GetNumber) dynamic_resolve ("gimp_unit_get_number_of_built_in_units", &h);
|
|
||||||
if (fn)
|
|
||||||
ret = fn ();
|
|
||||||
|
|
||||||
if (h)
|
|
||||||
FreeLibrary (h);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
gint
|
|
||||||
gimp_unit_get_number_of_units (void)
|
|
||||||
{
|
|
||||||
HMODULE h = NULL;
|
|
||||||
gint ret = 0;
|
|
||||||
PFN_GetNumber fn = (PFN_GetNumber) dynamic_resolve ("gimp_unit_get_number_of_units", &h);
|
|
||||||
if (fn)
|
|
||||||
ret = fn ();
|
|
||||||
|
|
||||||
if (h)
|
|
||||||
FreeLibrary (h);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
const gchar *
|
|
||||||
gimp_unit_get_symbol (GimpUnit unit)
|
|
||||||
{
|
|
||||||
HMODULE h = NULL;
|
|
||||||
gchar* ret = NULL;
|
|
||||||
PFN_GetUnitStr fn = (PFN_GetUnitStr) dynamic_resolve ("gimp_unit_get_symbol", &h);
|
|
||||||
if (fn)
|
|
||||||
ret = fn (unit);
|
|
||||||
|
|
||||||
if (h)
|
|
||||||
FreeLibrary (h);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
@ -1,4 +1,14 @@
|
|||||||
## Makefile for building the GIMP DLLs and LIBs with gcc on Win32.
|
################################
|
||||||
|
#
|
||||||
|
# Seriously out-of-date. Only Unix-style build supported now for gcc on Win32.
|
||||||
|
#
|
||||||
|
################################
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## Makefile for building the GIMP DLLs and libs with gcc on Win32.
|
||||||
## You should use GNU make running on cygwin.
|
## You should use GNU make running on cygwin.
|
||||||
## Use: make -f makefile.mingw
|
## Use: make -f makefile.mingw
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user