From: Dieter Verfaillie Date: Sun, 18 Mar 2012 03:10:01 +0000 (-0400) Subject: Fix out of tree build for MinGW/MSYS X-Git-Tag: 2.31.22~13 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e2b47ae9e0ff4402253c5ca854b3a5229513a12e;p=platform%2Fupstream%2Fglib.git Fix out of tree build for MinGW/MSYS When building with MinGW/MSYS with srcdir != builddir the build fails: - to locate the generated .def files - creating libglib-gdb.py - creating libgobject-gdb.py Solved this by explicitly instructing these files to be generated in $(builddir)/... https://bugzilla.gnome.org/show_bug.cgi?id=653167 --- diff --git a/gio/Makefile.am b/gio/Makefile.am index dc57ded38..69db690bb 100644 --- a/gio/Makefile.am +++ b/gio/Makefile.am @@ -24,8 +24,8 @@ 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) > gio.def.tmp && \ - mv gio.def.tmp gio.def + $(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 @@ -464,14 +464,14 @@ no_undefined = -no-undefined endif if OS_WIN32_AND_DLL_COMPILATION -export_symbols = -export-symbols gio.def +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) gio.def $(DESTDIR)$(libdir)/gio-2.0.def + $(INSTALL) $(builddir)/gio.def $(DESTDIR)$(libdir)/gio-2.0.def uninstall-def-file: -rm $(DESTDIR)$(libdir)/gio-2.0.def @@ -640,7 +640,7 @@ gioenumtypes.c: $(gio_headers) gioenumtypes.c.template gioenumtypes.c.tmp && mv gioenumtypes.c.tmp gioenumtypes.c 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:gio.def -out:$@ + lib -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 1d7fb6e0f..4b75c65d2 100644 --- a/glib/Makefile.am +++ b/glib/Makefile.am @@ -48,7 +48,7 @@ AM_CPPFLAGS = \ -DPCRE_STATIC glib.def: glib.symbols - $(AM_V_GEN) (echo EXPORTS; $(CPP) -P -DG_OS_WIN32 - <$(srcdir)/glib.symbols | sed -e '/^$$/d' -e 's/^/ /') > glib.def + $(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 @@ -343,7 +343,7 @@ no_undefined = -no-undefined endif if OS_WIN32_AND_DLL_COMPILATION -export_symbols = -export-symbols glib.def +export_symbols = -export-symbols $(builddir)/glib.def glib_win32_res = glib-win32-res.o glib_win32_res_ldflag = -Wl,$(glib_win32_res) @@ -351,7 +351,7 @@ glib_win32_res_ldflag = -Wl,$(glib_win32_res) glib_def = glib.def install-def-file: - $(INSTALL) glib.def $(DESTDIR)$(libdir)/glib-2.0.def + $(INSTALL) $(builddir)/glib.def $(DESTDIR)$(libdir)/glib-2.0.def uninstall-def-file: -rm $(DESTDIR)$(libdir)/glib-2.0.def @@ -457,7 +457,7 @@ install-exec-hook: endif 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:glib.def -out:$@ + lib -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)'; \ @@ -501,22 +501,17 @@ dist-hook: $(BUILT_EXTRA_DIST) ../build/win32/vs9/glib.vcproj ../build/win32/vs1 $(CPP) -P - <$(top_srcdir)/build/win32/vs10/glib.vcxproj.filtersin >$@ rm libglib.vs10.sourcefiles.filters -distclean-local: - if test $(srcdir) = .; then :; else \ - rm -f libglib-gdb.py; \ - fi - # install gdb scripts gdbdir = $(datadir)/glib-2.0/gdb dist_gdb_SCRIPTS = glib.py libglib-gdb.py: libglib-gdb.py.in - $(AM_V_GEN) $(SED) -e "s|\@datadir\@|$(datadir)|" $(srcdir)/libglib-gdb.py.in > libglib-gdb.py + $(AM_V_GEN) $(SED) -e "s|\@datadir\@|$(datadir)|" $(srcdir)/libglib-gdb.py.in > $(builddir)/libglib-gdb.py install-data-hook: libglib-gdb.py mkdir -p $(DESTDIR)$(datadir)/gdb/auto-load$(ABS_GLIB_RUNTIME_LIBDIR) - $(INSTALL) libglib-gdb.py $(DESTDIR)$(datadir)/gdb/auto-load$(ABS_GLIB_RUNTIME_LIBDIR)/libglib-2.0.so.0.$(LT_CURRENT).$(LT_REVISION)-gdb.py + $(INSTALL) $(builddir)/libglib-gdb.py $(DESTDIR)$(datadir)/gdb/auto-load$(ABS_GLIB_RUNTIME_LIBDIR)/libglib-2.0.so.0.$(LT_CURRENT).$(LT_REVISION)-gdb.py if HAVE_GLIB_RUNTIME_LIBDIR mkdir -p $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR) mv $(DESTDIR)$(libdir)/libglib-2.0.so.0 $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR) diff --git a/gmodule/Makefile.am b/gmodule/Makefile.am index 4eb5ed75f..5e08c1132 100644 --- a/gmodule/Makefile.am +++ b/gmodule/Makefile.am @@ -8,7 +8,7 @@ AM_CPPFLAGS = \ -DG_DISABLE_DEPRECATED gmodule.def: gmodule.symbols - $(AM_V_GEN) (echo EXPORTS; $(CPP) -P - <$(srcdir)/gmodule.symbols | sed -e '/^$$/d' -e 's/^/ /') > gmodule.def + $(AM_V_GEN) (echo EXPORTS; $(CPP) -P - <$(srcdir)/gmodule.symbols | sed -e '/^$$/d' -e 's/^/ /') > $(builddir)/gmodule.def EXTRA_DIST += \ makefile.msc.in \ @@ -61,14 +61,14 @@ no_undefined = -no-undefined endif if OS_WIN32_AND_DLL_COMPILATION -export_symbols = -export-symbols gmodule.def +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) gmodule.def $(DESTDIR)$(libdir)/gmodule-2.0.def + $(INSTALL) $(builddir)/gmodule.def $(DESTDIR)$(libdir)/gmodule-2.0.def uninstall-def-file: -rm $(DESTDIR)$(libdir)/gmodule-2.0.def @@ -92,7 +92,7 @@ gmodule-win32-res.o: gmodule.rc $(AM_V_GEN) $(WINDRES) gmodule.rc $@ 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:gmodule.def -out:$@ + lib -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 5c84699eb..2bdb80a71 100644 --- a/gobject/Makefile.am +++ b/gobject/Makefile.am @@ -16,7 +16,7 @@ AM_CPPFLAGS = \ -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) > gobject.def + $(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 @@ -49,14 +49,14 @@ no_undefined = -no-undefined endif if OS_WIN32_AND_DLL_COMPILATION -export_symbols = -export-symbols gobject.def +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) gobject.def $(DESTDIR)$(libdir)/gobject-2.0.def + $(INSTALL) $(builddir)/gobject.def $(DESTDIR)$(libdir)/gobject-2.0.def uninstall-def-file: -rm $(DESTDIR)$(libdir)/gobject-2.0.def @@ -240,7 +240,7 @@ gobject-win32-res.o: gobject.rc $(AM_V_GEN) $(WINDRES) gobject.rc $@ 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:gobject.def -out:$@ + lib -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)'; \ @@ -285,7 +285,6 @@ uninstall-local: uninstall-ms-lib uninstall-def-file uninstall-gdb distclean-local: if test $(srcdir) = .; then :; else \ rm -f $(BUILT_EXTRA_DIST); \ - rm -f libgobject-gdb.py; \ fi # install gdb scripts @@ -293,14 +292,14 @@ gdbdir = $(datadir)/glib-2.0/gdb dist_gdb_SCRIPTS = gobject.py libgobject-gdb.py: libgobject-gdb.py.in - $(AM_V_GEN) $(SED) -e "s|\@datadir\@|$(datadir)|" $(srcdir)/libgobject-gdb.py.in > libgobject-gdb.py + $(AM_V_GEN) $(SED) -e "s|\@datadir\@|$(datadir)|" $(srcdir)/libgobject-gdb.py.in > $(builddir)/libgobject-gdb.py uninstall-gdb: -rm -r $(DESTDIR)$(datadir)/gdb install-data-hook: libgobject-gdb.py mkdir -p $(DESTDIR)$(datadir)/gdb/auto-load/$(ABS_GLIB_RUNTIME_LIBDIR) - $(INSTALL) libgobject-gdb.py $(DESTDIR)$(datadir)/gdb/auto-load/$(ABS_GLIB_RUNTIME_LIBDIR)/libgobject-2.0.so.0.$(LT_CURRENT).$(LT_REVISION)-gdb.py + $(INSTALL) $(builddir)/libgobject-gdb.py $(DESTDIR)$(datadir)/gdb/auto-load/$(ABS_GLIB_RUNTIME_LIBDIR)/libgobject-2.0.so.0.$(LT_CURRENT).$(LT_REVISION)-gdb.py if HAVE_GLIB_RUNTIME_LIBDIR mkdir -p $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR) mv $(DESTDIR)$(libdir)/libgobject-2.0.so.0 $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR)