summaryrefslogtreecommitdiff
path: root/lto-plugin/Makefile.am
diff options
context:
space:
mode:
authorThomas Schwinge <thomas@codesourcery.com>2014-06-13 16:30:46 +0200
committerThomas Schwinge <tschwinge@gcc.gnu.org>2014-06-13 16:30:46 +0200
commit2a7a8388e2e4b7caf08cdd67f1bcebbc49ac3133 (patch)
tree551e04841da61c4b5f65c73d0dcc899ddd993371 /lto-plugin/Makefile.am
parentbeb683ab93023d2e80edd30dd8630fb7ae89aae0 (diff)
downloadgcc-2a7a8388e2e4b7caf08cdd67f1bcebbc49ac3133.tar.gz
Allow overriding the libiberty used for building the LTO plugin.
lto-plugin/ * configure.ac (--with-libiberty): New configure option. * configure: Regenerate. * Makefile.am (libiberty, libiberty_noasan, libiberty_pic): New variables. (liblto_plugin_la_LIBADD, liblto_plugin_la_LDFLAGS) (liblto_plugin_la_DEPENDENCIES): Use them. * Makefile.in: Regenerate. From-SVN: r211642
Diffstat (limited to 'lto-plugin/Makefile.am')
-rw-r--r--lto-plugin/Makefile.am31
1 files changed, 17 insertions, 14 deletions
diff --git a/lto-plugin/Makefile.am b/lto-plugin/Makefile.am
index bbb92f98033..f3fb89bbb0f 100644
--- a/lto-plugin/Makefile.am
+++ b/lto-plugin/Makefile.am
@@ -18,22 +18,25 @@ libexecsub_LTLIBRARIES = liblto_plugin.la
gcc_build_dir = ../$(host_subdir)/gcc
in_gcc_libs = $(foreach lib, $(libexecsub_LTLIBRARIES), $(gcc_build_dir)/$(lib))
-# Can be removed when libiberty becomes a normal convenience library
-Wc=-Wc,
-LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS))
-
liblto_plugin_la_SOURCES = lto-plugin.c
-liblto_plugin_la_LIBADD = \
- $(if $(wildcard ../libiberty/noasan/libiberty.a),$(Wc)../libiberty/noasan/libiberty.a, \
- $(if $(wildcard ../libiberty/pic/libiberty.a),$(Wc)../libiberty/pic/libiberty.a,))
-# Note that we intentionally override the bindir supplied by ACX_LT_HOST_FLAGS
+# Note that we intentionally override the bindir supplied by ACX_LT_HOST_FLAGS.
liblto_plugin_la_LDFLAGS = $(AM_LDFLAGS) \
- $(lt_host_flags) -module -bindir $(libexecsubdir) \
- $(if $(wildcard ../libiberty/noasan/libiberty.a),, \
- $(if $(wildcard ../libiberty/pic/libiberty.a),,-Wc,../libiberty/libiberty.a))
-liblto_plugin_la_DEPENDENCIES = $(if $(wildcard \
- ../libiberty/noasan/libiberty.a),../libiberty/noasan/libiberty.a, \
- $(if $(wildcard ../libiberty/pic/libiberty.a),../libiberty/pic/libiberty.a,))
+ $(lt_host_flags) -module -bindir $(libexecsubdir)
+# Can be simplified when libiberty becomes a normal convenience library.
+libiberty = $(with_libiberty)/libiberty.a
+libiberty_noasan = $(with_libiberty)/noasan/libiberty.a
+libiberty_pic = $(with_libiberty)/pic/libiberty.a
+Wc=-Wc,
+liblto_plugin_la_LIBADD = \
+ $(if $(wildcard $(libiberty_noasan)),$(Wc)$(libiberty_noasan), \
+ $(if $(wildcard $(libiberty_pic)),$(Wc)$(libiberty_pic),))
+liblto_plugin_la_LDFLAGS += \
+ $(if $(wildcard $(libiberty_noasan)),, \
+ $(if $(wildcard $(libiberty_pic)),,-Wc,$(libiberty)))
+liblto_plugin_la_DEPENDENCIES = \
+ $(if $(wildcard $(libiberty_noasan)),$(libiberty_noasan), \
+ $(if $(wildcard $(libiberty_pic)),$(libiberty_pic),))
+LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS))
liblto_plugin_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(liblto_plugin_la_LDFLAGS) $(LTLDFLAGS) -o $@