[gedit] W32: Override libtool internal variables to produce a delay-load import library
- From: Руслан Ижбулатов <ruslanizhb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gedit] W32: Override libtool internal variables to produce a delay-load import library
- Date: Thu, 10 Apr 2014 13:54:07 +0000 (UTC)
commit a321118ab702597d8edbd69ce7e0d6797d8ae350
Author: Руслан Ижбулатов <lrn1986 gmail com>
Date: Sat Apr 5 12:49:22 2014 +0000
W32: Override libtool internal variables to produce a delay-load import library
We remove --out-implib, add --output-def (where needed), and add extra call
to dlltool to generate delay-load import library (name's the same as normal
import library, so tools/applications won't notice the change).
When application is linked to libgedit via such import library, the DLL is
only loaded when first function from it is called. This gives us time to
influence W32 runtime linker.
https://bugzilla.gnome.org/show_bug.cgi?id=727663
configure.ac | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index e576ac2..118abea 100644
--- a/configure.ac
+++ b/configure.ac
@@ -57,6 +57,17 @@ dnl check for win32 platform
AC_MSG_CHECKING([for Win32 platform])
case "$host" in
*-*-mingw*|*-*-cygwin*)
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname
${wl}--enable-auto-image-base -Xlinker --output-def -Xlinker $lib.def && $DLLTOOL --dllname $soname --def
$lib.def --output-delaylib $lib'
+ # If the export-symbols file already is a .def file (1st line
+ # is EXPORTS), use it as is; otherwise, prepend...
+ archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname
${wl}--enable-auto-image-base;
+ $DLLTOOL --dllname $soname --def $output_objdir/$soname.def --output-delaylib $lib'
platform_win32=yes
;;
*)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]