[glib] win32: fixup lib.exe invocation



commit 7cbff954b926d97ce2f3ce08487866b668e7eafb
Author: Ryan Lortie <desrt desrt ca>
Date:   Sun Jan 12 03:14:04 2014 -0500

    win32: fixup lib.exe invocation
    
    We have a configure.ac check for lib.exe that attempts to enable
    creation of .lib files for our 5 public libraries.  That has been broken
    for a long time for two reasons:
    
     1) the Makefiles hardcode 'lib' instead of 'lib.exe'
    
     2) we dropped generation of .def files quite some time ago (except for
        in gthread where we have the two-symbol file under version control)
    
    Add new rules for creating .def files from dumpbin.exe (which you should
    have if you have lib.exe) and fix the .lib rules to use lib.exe.
    
    Add a bit of $(AM_V_GEN) all around, as well.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=722033

 gio/Makefile.am     |    5 ++++-
 glib/Makefile.am    |    5 ++++-
 gmodule/Makefile.am |    5 ++++-
 gobject/Makefile.am |    5 ++++-
 gthread/Makefile.am |    2 +-
 5 files changed, 17 insertions(+), 5 deletions(-)
---
diff --git a/gio/Makefile.am b/gio/Makefile.am
index 5b6cda1..e993e2f 100644
--- a/gio/Makefile.am
+++ b/gio/Makefile.am
@@ -683,8 +683,11 @@ gioenumtypes.c: $(gio_headers) gioenumtypes.c.template
        $(AM_V_GEN) $(top_builddir)/gobject/glib-mkenums --template $(filter %.template,$^) $(filter-out 
%.template,$^) > \
            gioenumtypes.c.tmp && mv gioenumtypes.c.tmp gioenumtypes.c
 
+gio.def: libgio-2.0.la
+       $(AM_V_GEN) dumpbin.exe -exports .libs/libgio-2.0-0.dll | awk 'BEGIN { print "EXPORTS" } / 
+[[:digit:]]+ +[[:xdigit:]]+ +[[:xdigit:]]+/{ print $$4 }' > gio.def.tmp && mv gio.def.tmp gio.def
+
 gio-2.0.lib: libgio-2.0.la gio.def
-       lib -machine:@LIB_EXE_MACHINE_FLAG@ -name:libgio-2.0-$(LT_CURRENT_MINUS_AGE).dll 
-def:$(builddir)/gio.def -out:$@
+       $(AM_V_GEN) lib.exe -machine:@LIB_EXE_MACHINE_FLAG@ -name:libgio-2.0-$(LT_CURRENT_MINUS_AGE).dll 
-def:$(builddir)/gio.def -out:$@
 
 bin_PROGRAMS = gio-querymodules glib-compile-schemas glib-compile-resources gsettings
 
diff --git a/glib/Makefile.am b/glib/Makefile.am
index a03d719..15377ec 100644
--- a/glib/Makefile.am
+++ b/glib/Makefile.am
@@ -439,8 +439,11 @@ install-exec-hook:
 
 endif
 
+glib.def: libglib-2.0.la
+       $(AM_V_GEN) dumpbin.exe -exports .libs/libglib-2.0-0.dll | awk 'BEGIN { print "EXPORTS" } / 
+[[:digit:]]+ +[[:xdigit:]]+ +[[:xdigit:]]+/{ print $$4 }' > glib.def.tmp && mv glib.def.tmp glib.def
+
 glib-2.0.lib: libglib-2.0.la glib.def
-       lib -machine:@LIB_EXE_MACHINE_FLAG@ -name:libglib-2.0-$(LT_CURRENT_MINUS_AGE).dll 
-def:$(builddir)/glib.def -out:$@
+       $(AM_V_GEN) lib.exe -machine:@LIB_EXE_MACHINE_FLAG@ -name:libglib-2.0-$(LT_CURRENT_MINUS_AGE).dll 
-def:$(builddir)/glib.def -out:$@
 
 dist-hook: $(BUILT_EXTRA_DIST) ../build/win32/vs9/glib.vcproj ../build/win32/vs10/glib.vcxproj 
../build/win32/vs10/glib.vcxproj.filters
        files='$(BUILT_EXTRA_DIST)'; \
diff --git a/gmodule/Makefile.am b/gmodule/Makefile.am
index 85d37db..95c7f09 100644
--- a/gmodule/Makefile.am
+++ b/gmodule/Makefile.am
@@ -75,8 +75,11 @@ libgmodule_2_0_la_DEPENDENCIES = $(gmodule_win32_res) $(gmodule_def)
 gmodule-win32-res.o: gmodule.rc
        $(AM_V_GEN) $(WINDRES) gmodule.rc $@
 
+gmodule.def: libgmodule-2.0.la
+       $(AM_V_GEN) dumpbin.exe -exports .libs/libgmodule-2.0-0.dll | awk 'BEGIN { print "EXPORTS" } / 
+[[:digit:]]+ +[[:xdigit:]]+ +[[:xdigit:]]+/{ print $$4 }' > gmodule.def.tmp && mv gmodule.def.tmp gmodule.def
+
 gmodule-2.0.lib: libgmodule-2.0.la gmodule.def
-       lib -machine:@LIB_EXE_MACHINE_FLAG@ -name:libgmodule-2.0-$(LT_CURRENT_MINUS_AGE).dll 
-def:$(builddir)/gmodule.def -out:$@
+       $(AM_V_GEN) lib.exe -machine:@LIB_EXE_MACHINE_FLAG@ -name:libgmodule-2.0-$(LT_CURRENT_MINUS_AGE).dll 
-def:$(builddir)/gmodule.def -out:$@
 
 .PHONY: files release
 
diff --git a/gobject/Makefile.am b/gobject/Makefile.am
index 1509616..c683e84 100644
--- a/gobject/Makefile.am
+++ b/gobject/Makefile.am
@@ -216,8 +216,11 @@ BUILT_EXTRA_DIST += \
 gobject-win32-res.o: gobject.rc
        $(AM_V_GEN) $(WINDRES) gobject.rc $@
 
+gobject.def: libgobject-2.0.la
+       $(AM_V_GEN) dumpbin.exe -exports .libs/libgobject-2.0-0.dll | awk 'BEGIN { print "EXPORTS" } / 
+[[:digit:]]+ +[[:xdigit:]]+ +[[:xdigit:]]+/{ print $$4 }' > gobject.def.tmp && mv gobject.def.tmp gobject.def
+
 gobject-2.0.lib: libgobject-2.0.la gobject.def
-       lib -machine:@LIB_EXE_MACHINE_FLAG@ -name:libgobject-2.0-$(LT_CURRENT_MINUS_AGE).dll 
-def:$(builddir)/gobject.def -out:$@
+       $(AM_V_GEN) lib.exe -machine:@LIB_EXE_MACHINE_FLAG@ -name:libgobject-2.0-$(LT_CURRENT_MINUS_AGE).dll 
-def:$(builddir)/gobject.def -out:$@
 
 dist-hook: $(BUILT_EXTRA_DIST) ../build/win32/vs9/gobject.vcproj ../build/win32/vs10/gobject.vcxproj 
../build/win32/vs10/gobject.vcxproj.filters
        files='$(BUILT_EXTRA_DIST)'; \
diff --git a/gthread/Makefile.am b/gthread/Makefile.am
index f1ef78d..9760be4 100644
--- a/gthread/Makefile.am
+++ b/gthread/Makefile.am
@@ -77,7 +77,7 @@ gthread-win32-res.o: gthread.rc
        $(AM_V_GEN) $(WINDRES) gthread.rc $@
 
 gthread-2.0.lib: libgthread-2.0.la gthread.def
-       lib -machine:@LIB_EXE_MACHINE_FLAG@ -name:libgthread-2.0-$(LT_CURRENT_MINUS_AGE).dll 
-def:$(srcdir)/gthread.def -out:$@
+       $(AM_V_GEN) lib.exe -machine:@LIB_EXE_MACHINE_FLAG@ -name:libgthread-2.0-$(LT_CURRENT_MINUS_AGE).dll 
-def:$(srcdir)/gthread.def -out:$@
 
 dist-hook: $(BUILT_EXTRA_DIST)
        files='$(BUILT_EXTRA_DIST)'; \


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