win32: fixup lib.exe invocation
authorRyan Lortie <desrt@desrt.ca>
Sun, 12 Jan 2014 08:14:04 +0000 (03:14 -0500)
committerRyan Lortie <desrt@desrt.ca>
Sat, 15 Feb 2014 21:55:25 +0000 (16:55 -0500)
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
glib/Makefile.am
gmodule/Makefile.am
gobject/Makefile.am
gthread/Makefile.am

index 5b6cda1..e993e2f 100644 (file)
@@ -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
 
index a03d719..15377ec 100644 (file)
@@ -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)'; \
index 85d37db..95c7f09 100644 (file)
@@ -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
 
index 1509616..c683e84 100644 (file)
@@ -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)'; \
index f1ef78d..9760be4 100644 (file)
@@ -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)'; \