[gtk/wip/lantw/build-Move-gtk.def-to-builddir] build: Move gtk.def to builddir
- From: Ting-Wei Lan <lantw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/lantw/build-Move-gtk.def-to-builddir] build: Move gtk.def to builddir
- Date: Tue, 25 Aug 2020 17:06:42 +0000 (UTC)
commit 6e8220d1a303cc420e6b20429cbf8fc17a2c7cb4
Author: Ting-Wei Lan <lantw src gnome org>
Date: Wed Aug 26 01:01:56 2020 +0800
build: Move gtk.def to builddir
GTK2 uses different gtk.def files on 32-bit and 64-bit Windows. GTK2
source tarballs ship pre-generated gtk.def for 32-bit Windows. If the
user wants to build for 64-bit Windows, the pre-generated gtk.def must
be deleted before the build to force regeneration, or it will fail to
link with 'symbol not defined' errors because the 32-bit Windows build
includes more legacy functions than the 64-bit Windows build.
While users who want to build for 64-bit Windows can delete gtk.def in
the build script, which is currently what most build scripts do, doing
so breaks out-of-source build. On AUR, MinGW packages are usually built
and packaged in the following order:
1. Run 'configure' and 'make' to build for i686-w64-mingw32.
2. Run 'configure' and 'make' to build for x86_64-w64-mingw32.
3. Run 'make install' for i686-w64-mingw32.
4. Run 'make install' for x86_64-w64-mingw32.
It fails because step 3 sees gtk.def left by step 2, which is generated
for a different build. In step 3, make sees the gtk.def change and runs
libtool to relink libgtk-win32-2.0-0.dll. libtool fails to find a lot of
necessary libraries, decides that it is not possible to build a DLL with
-no-undefined, and produces only the static library. It then tries to
relink executables with the static library, and fails with undefined
reference to 'IID_IUnknown' because -Wl,--start-group isn't used and
the use of -Wl,-luuid prevents libtool from using the correct order.
To resolve the problem, move gtk.def to builddir so different builds can
have different gtk.def files while sharing the same source tree. This
also means that the source tarball will no longer include pre-generated
gtk.def file, which should be acceptable because it is already broken on
64-bit Windows.
Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/3029
gtk/Makefile.am | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
---
diff --git a/gtk/Makefile.am b/gtk/Makefile.am
index cdbbd8c8d9..93287c00bb 100644
--- a/gtk/Makefile.am
+++ b/gtk/Makefile.am
@@ -71,7 +71,7 @@ endif
if OS_WIN32
gtk_def = gtk.def
-gtk_win32_symbols = -export-symbols $(srcdir)/gtk.def
+gtk_win32_symbols = -export-symbols gtk.def
gtk_win32_res = gtk-win32-res.o
gtk_win32_res_ldflag = -Wl,gtk-win32-res.o
@@ -81,7 +81,7 @@ gtk-win32-res.o : gtk-win32.rc
install-def-file: gtk.def
$(mkinstalldirs) $(DESTDIR)$(libdir)
- $(INSTALL) $(srcdir)/gtk.def $(DESTDIR)$(libdir)/gtk-win32-2.0.def
+ $(INSTALL) gtk.def $(DESTDIR)$(libdir)/gtk-win32-2.0.def
uninstall-def-file:
-rm $(DESTDIR)$(libdir)/gtk-win32-2.0.def
else
@@ -109,7 +109,7 @@ endif
# This places the generated .def file in srcdir, since it is expected to be there.
# (The one from a tarball is)
gtk.def: gtk.symbols
- (echo -e EXPORTS; $(CPP) -P -DINCLUDE_VARIABLES -DG_OS_WIN32 -DALL_FILES - <$(srcdir)/gtk.symbols |
sed -e '/^$$/d' -e 's/^/ /' -e 's/G_GNUC_[^ ]*//g') > $(srcdir)/gtk.def
+ (echo -e EXPORTS; $(CPP) -P -DINCLUDE_VARIABLES -DG_OS_WIN32 -DALL_FILES - <$(srcdir)/gtk.symbols |
sed -e '/^$$/d' -e 's/^/ /' -e 's/G_GNUC_[^ ]*//g') > gtk.def
gtkalias.h: gtk.symbols
$(PERL) $(srcdir)/makegtkalias.pl < $(srcdir)/gtk.symbols > gtkalias.h
@@ -1463,7 +1463,6 @@ EXTRA_DIST += \
tree_minus.xbm \
tree_minus.xpm \
tree_plus.xpm \
- gtk.def \
gtk-builder-convert \
gtk-win32.rc \
gtk-win32.rc.in \
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]