[glib] win32: build: stop using .def files



commit 068a119f7401efe68c0fdbfaea86c5e55c0ed7d5
Author: Ryan Lortie <desrt desrt ca>
Date:   Sun Jan 13 15:41:03 2013 -0500

    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.

 gio/Makefile.am     |   20 ++------------------
 glib/Makefile.am    |   20 ++------------------
 gmodule/Makefile.am |   19 ++-----------------
 gobject/Makefile.am |   21 +++------------------
 4 files changed, 9 insertions(+), 71 deletions(-)
---
diff --git a/gio/Makefile.am b/gio/Makefile.am
index 2bb4450..b4edecf 100644
--- a/gio/Makefile.am
+++ b/gio/Makefile.am
@@ -23,10 +23,6 @@ install-ms-lib:
 uninstall-ms-lib:
 	$(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 HAVE_GNUC_VISIBILITY
 TESTS = abicheck.sh
@@ -494,28 +490,16 @@ no_undefined = -no-undefined
 endif
 
 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_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
-install-def-file:
-uninstall-def-file:
-
 export_symbols = $(LIBTOOL_EXPORT_OPTIONS)
 endif
 
-install-data-local: install-ms-lib install-def-file
+install-data-local: install-ms-lib
 	$(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) \
 	$(gio_win32_res_ldflag) \
diff --git a/glib/Makefile.am b/glib/Makefile.am
index 3168b1a..951d102 100644
--- a/glib/Makefile.am
+++ b/glib/Makefile.am
@@ -49,9 +49,6 @@ AM_CPPFLAGS = 				\
 	-DGLIB_COMPILATION 		\
 	-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 HAVE_GNUC_VISIBILITY
 TESTS_ENVIRONMENT = GLIB_DEBUG_FLAGS="$(GLIB_DEBUG_FLAGS)"
@@ -335,36 +332,23 @@ CLEANFILES += 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					\
 	  echo "*** Old headers found in $(glibincludedir). You should remove the" ;	\
 	  echo "*** contents of this directory and type 'make install' again." ;	\
 	  false ;									\
 	fi
 
-uninstall-local: uninstall-ms-lib uninstall-def-file uninstall-gdb
+uninstall-local: uninstall-ms-lib uninstall-gdb
 
 if PLATFORM_WIN32
 no_undefined = -no-undefined
 endif
 
 if OS_WIN32_AND_DLL_COMPILATION
-export_symbols = -export-symbols $(builddir)/glib.def
-
 glib_win32_res = glib-win32-res.o
 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
-install-def-file:
-uninstall-def-file:
-
 export_symbols = $(LIBTOOL_EXPORT_OPTIONS)
 endif
 
diff --git a/gmodule/Makefile.am b/gmodule/Makefile.am
index 5e08c11..19737fa 100644
--- a/gmodule/Makefile.am
+++ b/gmodule/Makefile.am
@@ -7,9 +7,6 @@ AM_CPPFLAGS = 				\
 	@GLIB_DEBUG_FLAGS@ 		\
 	-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 +=				\
 		makefile.msc.in 	\
 		gmoduleconf.h.in 	\
@@ -61,20 +58,8 @@ no_undefined = -no-undefined
 endif
 
 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_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
 
 libgmodule_2_0_la_SOURCES = gmodule.c
@@ -111,9 +96,9 @@ dist-hook: $(BUILT_EXTRA_DIST)
 	  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
 install-data-hook:
diff --git a/gobject/Makefile.am b/gobject/Makefile.am
index 40b1c5e..d9f3a09 100644
--- a/gobject/Makefile.am
+++ b/gobject/Makefile.am
@@ -18,9 +18,6 @@ AM_CPPFLAGS = 					\
 	$(GLIB_DEBUG_FLAGS)			\
 	-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 HAVE_GNUC_VISIBILITY
 TESTS = abicheck.sh
@@ -52,21 +49,9 @@ no_undefined = -no-undefined
 endif
 
 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_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
-install-def-file:
-uninstall-def-file:
-
 export_symbols = $(LIBTOOL_EXPORT_OPTIONS)
 endif
 
@@ -81,7 +66,7 @@ libgobject_2_0_la_CFLAGS = $(LIBFFI_CFLAGS)
 
 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
@@ -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 >$@
 	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:
 	if test $(srcdir) = .; then :; else \



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]