From b6c74b8739a49b7d01d8afae3b691e627a91a743 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Thu, 13 Mar 2008 17:10:04 +0000 Subject: [PATCH] Actually use the gio.def file when linking the library on Windows. Produce 2008-03-13 Tor Lillqvist * Makefile.am: Actually use the gio.def file when linking the library on Windows. Produce .lib library for Microsoft's toolchain when possible. Install the .lib and .def file like for the other libraries of GLib. svn path=/trunk/; revision=6700 --- gio/ChangeLog | 7 +++++++ gio/Makefile.am | 39 +++++++++++++++++++++++++++++++++++++-- 2 files changed, 44 insertions(+), 2 deletions(-) diff --git a/gio/ChangeLog b/gio/ChangeLog index 725a8317..b8ef15f5 100644 --- a/gio/ChangeLog +++ b/gio/ChangeLog @@ -1,3 +1,10 @@ +2008-03-13 Tor Lillqvist + + * Makefile.am: Actually use the gio.def file when linking the + library on Windows. Produce .lib library for Microsoft's toolchain + when possible. Install the .lib and .def file like for the other + libraries of GLib. + 2008-03-13 Tomas Bzatek * tests/live-g-file.c: diff --git a/gio/Makefile.am b/gio/Makefile.am index af583809..7c625aa1 100644 --- a/gio/Makefile.am +++ b/gio/Makefile.am @@ -8,6 +8,19 @@ if OS_UNIX SUBDIRS += xdgmime endif +if MS_LIB_AVAILABLE +noinst_DATA = gio-2.0.lib + +install-ms-lib: + $(INSTALL) gio-2.0.lib $(DESTDIR)$(libdir) + +uninstall-ms-lib: + -rm $(DESTDIR)$(libdir)/gio-2.0.lib +else +install-ms-lib: +uninstall-ms-lib: +endif + gio.def: gio.symbols (echo -e EXPORTS; $(CPP) -P -DINCLUDE_VARIABLES -DINCLUDE_INTERNAL_SYMBOLS -DG_OS_WIN32 -DALL_FILES - <$(srcdir)/gio.symbols | sed -e '/^$$/d' -e 's/^/ /' -e 's/G_GNUC_[^ ]*//g' | sort) > gio.def.tmp && \ mv gio.def.tmp gio.def @@ -205,11 +218,30 @@ libgio_2_0_la_LIBADD = \ $(XATTR_LIBS) \ $(NULL) -if OS_WIN32 +if PLATFORM_WIN32 no_undefined = -no-undefined endif -libgio_2_0_la_LDFLAGS= -export-dynamic $(no_undefined) -export-symbols-regex '^g_.*' +if OS_WIN32 +export_symbols = -export-symbols gio.def + +install-def-file: + $(INSTALL) gio.def $(DESTDIR)$(libdir)/gio-2.0.def + +uninstall-def-file: + -rm $(DESTDIR)$(libdir)/gio-2.0.def +else +install-def-file: +uninstall-def-file: + +export_symbols = -export-symbols-regex '^g_.*' +endif + +install-data-local: install-ms-lib install-def-file + +uninstall-local: uninstall-ms-lib uninstall-def-file + +libgio_2_0_la_LDFLAGS= -export-dynamic $(no_undefined) $(export_symbols) gio_headers = \ gappinfo.h \ @@ -292,3 +324,6 @@ gioenumtypes.c: $(gio_headers) gioenumtypes.c.template ( top_builddir=`cd $(top_builddir) && pwd`; \ cd $(srcdir) && $$top_builddir/gobject/glib-mkenums --template gioenumtypes.c.template $(gio_headers) ) > \ gioenumtypes.c.tmp && mv gioenumtypes.c.tmp gioenumtypes.c + +gio-2.0.lib: libgio-2.0.la gio.def + lib -name:libgio-2.0-$(LT_CURRENT_MINUS_AGE).dll -def:gio.def -out:$@ -- 2.34.1