win32: build: stop using .def files

With visibility now under the control of __declspec(dllexport) we no
longer need to build .def files or use them for building our various
.dll files.

.def files used to be installed (even though it is only really useful
when creating the .dll or .lib file).  Don't do that anymore either.

The Makefiles still contain rules to create a .lib file for use with
Visual Studio and these rules require .def files.  There are special
requirements to using these rules (like having installed and setup
Microsoft tools for use during the build) and therefore the problem of
creating a .def file for use with them is left open to anyone willing to
make the effort.  Many options are available depending on which
toolchain is in use (dlltool, pexport, gendef, dumpbin.exe, just to name
a few).

If we can find a free tool for creating .lib files in the future, we
should probably revisit this issue and add proper support back to our
build system.
This commit is contained in:
Ryan Lortie 2013-01-13 15:41:03 -05:00
parent 2e7669f5cc
commit 068a119f74
4 changed files with 9 additions and 71 deletions

View File

@ -23,10 +23,6 @@ install-ms-lib:
uninstall-ms-lib: uninstall-ms-lib:
$(uninstall_ms_lib_cmd) $(uninstall_ms_lib_cmd)
gio.def: gio.symbols
$(AM_V_GEN) (echo 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) > $(builddir)/gio.def.tmp && \
mv $(builddir)/gio.def.tmp $(builddir)/gio.def
if OS_LINUX if OS_LINUX
if HAVE_GNUC_VISIBILITY if HAVE_GNUC_VISIBILITY
TESTS = abicheck.sh TESTS = abicheck.sh
@ -494,28 +490,16 @@ no_undefined = -no-undefined
endif endif
if OS_WIN32_AND_DLL_COMPILATION if OS_WIN32_AND_DLL_COMPILATION
export_symbols = -export-symbols $(builddir)/gio.def
gio_def = gio.def
gio_win32_res = gio-win32-res.o gio_win32_res = gio-win32-res.o
gio_win32_res_ldflag = -Wl,$(gio_win32_res) gio_win32_res_ldflag = -Wl,$(gio_win32_res)
install-def-file:
$(INSTALL) $(builddir)/gio.def $(DESTDIR)$(libdir)/gio-2.0.def
uninstall-def-file:
-rm $(DESTDIR)$(libdir)/gio-2.0.def
else else
install-def-file:
uninstall-def-file:
export_symbols = $(LIBTOOL_EXPORT_OPTIONS) export_symbols = $(LIBTOOL_EXPORT_OPTIONS)
endif endif
install-data-local: install-ms-lib install-def-file install-data-local: install-ms-lib
$(mkinstalldirs) $(DESTDIR)$(GIO_MODULE_DIR) $(mkinstalldirs) $(DESTDIR)$(GIO_MODULE_DIR)
uninstall-local: uninstall-ms-lib uninstall-def-file uninstall-local: uninstall-ms-lib
libgio_2_0_la_LDFLAGS = $(GLIB_LINK_FLAGS) \ libgio_2_0_la_LDFLAGS = $(GLIB_LINK_FLAGS) \
$(gio_win32_res_ldflag) \ $(gio_win32_res_ldflag) \

View File

@ -49,9 +49,6 @@ AM_CPPFLAGS = \
-DGLIB_COMPILATION \ -DGLIB_COMPILATION \
-DPCRE_STATIC -DPCRE_STATIC
glib.def: glib.symbols
$(AM_V_GEN) (echo EXPORTS; $(CPP) -P -DG_OS_WIN32 - <$(srcdir)/glib.symbols | sed -e '/^$$/d' -e 's/^/ /') > $(builddir)/glib.def
if OS_LINUX if OS_LINUX
if HAVE_GNUC_VISIBILITY if HAVE_GNUC_VISIBILITY
TESTS_ENVIRONMENT = GLIB_DEBUG_FLAGS="$(GLIB_DEBUG_FLAGS)" TESTS_ENVIRONMENT = GLIB_DEBUG_FLAGS="$(GLIB_DEBUG_FLAGS)"
@ -335,36 +332,23 @@ CLEANFILES += glib-public-headers.txt
all-local: glib-public-headers.txt all-local: glib-public-headers.txt
install-data-local: install-ms-lib install-def-file install-data-local: install-ms-lib
@if test -f $(glibincludedir)/glist.h ; then \ @if test -f $(glibincludedir)/glist.h ; then \
echo "*** Old headers found in $(glibincludedir). You should remove the" ; \ echo "*** Old headers found in $(glibincludedir). You should remove the" ; \
echo "*** contents of this directory and type 'make install' again." ; \ echo "*** contents of this directory and type 'make install' again." ; \
false ; \ false ; \
fi fi
uninstall-local: uninstall-ms-lib uninstall-def-file uninstall-gdb uninstall-local: uninstall-ms-lib uninstall-gdb
if PLATFORM_WIN32 if PLATFORM_WIN32
no_undefined = -no-undefined no_undefined = -no-undefined
endif endif
if OS_WIN32_AND_DLL_COMPILATION if OS_WIN32_AND_DLL_COMPILATION
export_symbols = -export-symbols $(builddir)/glib.def
glib_win32_res = glib-win32-res.o glib_win32_res = glib-win32-res.o
glib_win32_res_ldflag = -Wl,$(glib_win32_res) glib_win32_res_ldflag = -Wl,$(glib_win32_res)
glib_def = glib.def
install-def-file:
$(INSTALL) $(builddir)/glib.def $(DESTDIR)$(libdir)/glib-2.0.def
uninstall-def-file:
-rm $(DESTDIR)$(libdir)/glib-2.0.def
else else
install-def-file:
uninstall-def-file:
export_symbols = $(LIBTOOL_EXPORT_OPTIONS) export_symbols = $(LIBTOOL_EXPORT_OPTIONS)
endif endif

View File

@ -7,9 +7,6 @@ AM_CPPFLAGS = \
@GLIB_DEBUG_FLAGS@ \ @GLIB_DEBUG_FLAGS@ \
-DG_DISABLE_DEPRECATED -DG_DISABLE_DEPRECATED
gmodule.def: gmodule.symbols
$(AM_V_GEN) (echo EXPORTS; $(CPP) -P - <$(srcdir)/gmodule.symbols | sed -e '/^$$/d' -e 's/^/ /') > $(builddir)/gmodule.def
EXTRA_DIST += \ EXTRA_DIST += \
makefile.msc.in \ makefile.msc.in \
gmoduleconf.h.in \ gmoduleconf.h.in \
@ -61,20 +58,8 @@ no_undefined = -no-undefined
endif endif
if OS_WIN32_AND_DLL_COMPILATION if OS_WIN32_AND_DLL_COMPILATION
export_symbols = -export-symbols $(builddir)/gmodule.def
gmodule_def = gmodule.def
gmodule_win32_res = gmodule-win32-res.o gmodule_win32_res = gmodule-win32-res.o
gmodule_win32_res_ldflag = -Wl,$(gmodule_win32_res) gmodule_win32_res_ldflag = -Wl,$(gmodule_win32_res)
install-def-file:
$(INSTALL) $(builddir)/gmodule.def $(DESTDIR)$(libdir)/gmodule-2.0.def
uninstall-def-file:
-rm $(DESTDIR)$(libdir)/gmodule-2.0.def
else
install-def-file:
uninstall-def-file:
endif endif
libgmodule_2_0_la_SOURCES = gmodule.c libgmodule_2_0_la_SOURCES = gmodule.c
@ -111,9 +96,9 @@ dist-hook: $(BUILT_EXTRA_DIST)
cp $$d/$$f $(distdir) || exit 1; done cp $$d/$$f $(distdir) || exit 1; done
install-data-local: install-ms-lib install-def-file install-data-local: install-ms-lib
uninstall-local: uninstall-ms-lib uninstall-def-file uninstall-local: uninstall-ms-lib
if HAVE_GLIB_RUNTIME_LIBDIR if HAVE_GLIB_RUNTIME_LIBDIR
install-data-hook: install-data-hook:

View File

@ -18,9 +18,6 @@ AM_CPPFLAGS = \
$(GLIB_DEBUG_FLAGS) \ $(GLIB_DEBUG_FLAGS) \
-DGOBJECT_COMPILATION -DGOBJECT_COMPILATION
gobject.def: gobject.symbols
$(AM_V_GEN) (echo EXPORTS; $(CPP) -P -DINCLUDE_VARIABLES -DINCLUDE_INTERNAL_SYMBOLS -DG_OS_WIN32 -DALL_FILES - <$(srcdir)/gobject.symbols | $(SED) -e '/^$$/d' -e 's/^/ /' -e 's/G_GNUC_[^ ]*//g' | sort) > $(builddir)/gobject.def
if OS_LINUX if OS_LINUX
if HAVE_GNUC_VISIBILITY if HAVE_GNUC_VISIBILITY
TESTS = abicheck.sh TESTS = abicheck.sh
@ -52,21 +49,9 @@ no_undefined = -no-undefined
endif endif
if OS_WIN32_AND_DLL_COMPILATION if OS_WIN32_AND_DLL_COMPILATION
export_symbols = -export-symbols $(builddir)/gobject.def
gobject_def = gobject.def
gobject_win32_res = gobject-win32-res.o gobject_win32_res = gobject-win32-res.o
gobject_win32_res_ldflag = -Wl,$(gobject_win32_res) gobject_win32_res_ldflag = -Wl,$(gobject_win32_res)
install-def-file:
$(INSTALL) $(builddir)/gobject.def $(DESTDIR)$(libdir)/gobject-2.0.def
uninstall-def-file:
-rm $(DESTDIR)$(libdir)/gobject-2.0.def
else else
install-def-file:
uninstall-def-file:
export_symbols = $(LIBTOOL_EXPORT_OPTIONS) export_symbols = $(LIBTOOL_EXPORT_OPTIONS)
endif endif
@ -81,7 +66,7 @@ libgobject_2_0_la_CFLAGS = $(LIBFFI_CFLAGS)
libgobject_2_0_la_LIBADD = $(libglib) $(LIBFFI_LIBS) libgobject_2_0_la_LIBADD = $(libglib) $(LIBFFI_LIBS)
libgobject_2_0_la_DEPENDENCIES = $(gobject_win32_res) $(gobject_def) libgobject_2_0_la_DEPENDENCIES = $(gobject_win32_res)
# #
# setup source file variables # setup source file variables
@ -280,9 +265,9 @@ dist-hook: $(BUILT_EXTRA_DIST) ../build/win32/vs9/gobject.vcproj ../build/win32/
$(CPP) -P - <$(top_srcdir)/build/win32/vs10/gobject.vcxproj.filtersin >$@ $(CPP) -P - <$(top_srcdir)/build/win32/vs10/gobject.vcxproj.filtersin >$@
rm libgobject.vs10.sourcefiles.filters rm libgobject.vs10.sourcefiles.filters
install-data-local: install-ms-lib install-def-file install-data-local: install-ms-lib
uninstall-local: uninstall-ms-lib uninstall-def-file uninstall-gdb uninstall-local: uninstall-ms-lib uninstall-gdb
distclean-local: distclean-local:
if test $(srcdir) = .; then :; else \ if test $(srcdir) = .; then :; else \