build: Give internal libraries higher precedence

Linking local libraries too late may cause preinstalled libraries to
get found earlier, due to external library paths in .la files.

https://bugzilla.gnome.org/show_bug.cgi?id=712314
This commit is contained in:
Michael Haubenwallner 2013-11-14 16:22:10 +01:00 committed by Colin Walters
parent 36f1a4ce7e
commit b1af471a3f
4 changed files with 28 additions and 25 deletions

View File

@ -482,9 +482,9 @@ libgio_2_0_la_SOURCES = \
EXTRA_DIST += strinfo.c
libgio_2_0_la_LIBADD = \
$(top_builddir)/glib/libglib-2.0.la \
$(top_builddir)/gobject/libgobject-2.0.la \
$(top_builddir)/gmodule/libgmodule-2.0.la \
$(top_builddir)/glib/libglib-2.0.la \
$(platform_libadd) \
$(ZLIB_LIBS) \
$(SELINUX_LIBS) \
@ -688,10 +688,10 @@ gio-2.0.lib: libgio-2.0.la gio.def
bin_PROGRAMS = gio-querymodules glib-compile-schemas glib-compile-resources gsettings
glib_compile_resources_LDADD = \
$(top_builddir)/glib/libglib-2.0.la \
glib_compile_resources_LDADD = libgio-2.0.la \
$(top_builddir)/gobject/libgobject-2.0.la \
libgio-2.0.la
$(top_builddir)/glib/libglib-2.0.la \
$(NULL)
glib_compile_resources_SOURCES = \
gvdb/gvdb-format.h \
@ -700,11 +700,10 @@ glib_compile_resources_SOURCES = \
glib-compile-resources.c
gio_querymodules_SOURCES = gio-querymodules.c
gio_querymodules_LDADD = \
$(top_builddir)/glib/libglib-2.0.la \
gio_querymodules_LDADD = libgio-2.0.la \
$(top_builddir)/gobject/libgobject-2.0.la \
$(top_builddir)/gmodule/libgmodule-2.0.la \
libgio-2.0.la \
$(top_builddir)/glib/libglib-2.0.la \
$(NULL)
gconstructor_as_data.h: $(top_srcdir)/glib/gconstructor.h data-to-c.pl
@ -718,10 +717,10 @@ glib_compile_schemas_SOURCES = \
gvdb/gvdb-builder.c \
glib-compile-schemas.c
gsettings_LDADD = \
$(top_builddir)/glib/libglib-2.0.la \
gsettings_LDADD = libgio-2.0.la \
$(top_builddir)/gobject/libgobject-2.0.la \
libgio-2.0.la
$(top_builddir)/glib/libglib-2.0.la \
$(NULL)
gsettings_SOURCES = gsettings-tool.c
schemadir = $(datadir)/glib-2.0/schemas
@ -733,8 +732,9 @@ dist_schema_DATA = gschema.dtd
bin_PROGRAMS += gdbus
gdbus_SOURCES = gdbus-tool.c
gdbus_LDADD = libgio-2.0.la \
$(top_builddir)/gobject/libgobject-2.0.la \
$(top_builddir)/glib/libglib-2.0.la \
$(top_builddir)/gobject/libgobject-2.0.la
$(NULL)
if OS_UNIX
# ------------------------------------------------------------------------
@ -742,8 +742,9 @@ if OS_UNIX
bin_PROGRAMS += gapplication
gapplication_SOURCES = gapplication-tool.c
gapplication_LDADD = libgio-2.0.la \
$(top_builddir)/gobject/libgobject-2.0.la \
$(top_builddir)/glib/libglib-2.0.la \
$(top_builddir)/gobject/libgobject-2.0.la
$(NULL)
endif
completiondir = $(datadir)/bash-completion/completions
@ -761,8 +762,8 @@ bin_PROGRAMS += gresource
gresource_SOURCES = gresource-tool.c
gresource_CPPFLAGS = $(LIBELF_CFLAGS) $(AM_CPPFLAGS)
gresource_LDADD = libgio-2.0.la \
$(top_builddir)/glib/libglib-2.0.la \
$(top_builddir)/gobject/libgobject-2.0.la \
$(top_builddir)/glib/libglib-2.0.la \
$(LIBELF_LIBS)
# ------------------------------------------------------------------------

View File

@ -6,10 +6,12 @@ test_ltlibraries =
SUBDIRS = gdbus-object-manager-example services
LDADD = \
$(top_builddir)/glib/libglib-2.0.la \
$(top_builddir)/gio/libgio-2.0.la \
$(top_builddir)/gobject/libgobject-2.0.la \
$(top_builddir)/gmodule/libgmodule-2.0.la \
$(top_builddir)/gio/libgio-2.0.la
$(top_builddir)/glib/libglib-2.0.la \
$(NULL)
AM_CPPFLAGS = $(gio_INCLUDES) $(GLIB_DEBUG_FLAGS) -I$(top_builddir)/gio -I$(top_srcdir)/gio
DEFS = -DG_LOG_DOMAIN=\"GLib-GIO\" -DTEST_SERVICES=\""$(abs_top_builddir)/gio/tests/services"\"
AM_CFLAGS = $(GLIB_WARN_CFLAGS)

View File

@ -88,21 +88,21 @@ TESTS_ENVIRONMENT = \
test_programs += module-test
module_test_DEPENDENCIES = libmoduletestplugin_a.la libmoduletestplugin_b.la
module_test_LDADD = $(LDADD) $(top_builddir)/gmodule/libgmodule-2.0.la
module_test_LDADD = $(top_builddir)/gmodule/libgmodule-2.0.la $(LDADD)
module_test_LDFLAGS = $(G_MODULE_LDFLAGS)
slice_test_SOURCES = slice-test.c memchunks.c
slice_color_SOURCES = slice-color.c memchunks.c
slice_threadinit_LDADD = $(LDADD) $(top_builddir)/gthread/libgthread-2.0.la
slice_threadinit_LDADD = $(top_builddir)/gthread/libgthread-2.0.la $(LDADD)
test_ltlibraries = libmoduletestplugin_a.la libmoduletestplugin_b.la
libmoduletestplugin_a_la_SOURCES = libmoduletestplugin_a.c
libmoduletestplugin_a_la_LDFLAGS = $(G_MODULE_LDFLAGS) -avoid-version -module $(no_undefined)
libmoduletestplugin_a_la_LIBADD = $(G_MODULE_LIBS) ../glib/libglib-2.0.la ../gmodule/libgmodule-2.0.la
libmoduletestplugin_a_la_LIBADD = $(G_MODULE_LIBS) ../gmodule/libgmodule-2.0.la ../glib/libglib-2.0.la
libmoduletestplugin_b_la_SOURCES = libmoduletestplugin_b.c
libmoduletestplugin_b_la_LDFLAGS = $(G_MODULE_LDFLAGS) -avoid-version -module $(no_undefined)
libmoduletestplugin_b_la_LIBADD = $(G_MODULE_LIBS) ../glib/libglib-2.0.la ../gmodule/libgmodule-2.0.la
libmoduletestplugin_b_la_LIBADD = $(G_MODULE_LIBS) ../gmodule/libgmodule-2.0.la ../glib/libglib-2.0.la
if !ENABLE_INSTALLED_TESTS
# see http://lists.gnu.org/archive/html/bug-libtool/2013-05/msg00009.html and gio/tests/Makefile.am

View File

@ -1,6 +1,6 @@
include $(top_srcdir)/glib.mk
LDADD = $(top_builddir)/glib/libglib-2.0.la $(top_builddir)/gobject/libgobject-2.0.la
LDADD = $(top_builddir)/gobject/libgobject-2.0.la $(top_builddir)/glib/libglib-2.0.la
AM_CPPFLAGS = $(gmodule_INCLUDES) $(GLIB_DEBUG_FLAGS)
DEFS = -DGLIB_DISABLE_DEPRECATION_WARNINGS -DG_LOG_DOMAIN=\"GLib\"
AM_CFLAGS = -g