X-Git-Url: http://git.sourceforge.jp/view?p=pf3gnuchains%2Fgcc-fork.git;a=blobdiff_plain;f=lto-plugin%2FMakefile.am;h=b24015e137bf73156371ce0efc5bea2efb51d8d6;hp=778f99c6746d9901828c23893deda20f1c6ccb63;hb=3ebb9d0b5b601b6872c9a6cac88a55133efef47b;hpb=1934055be6f2fb4018b479616a0c5300d9d90120 diff --git a/lto-plugin/Makefile.am b/lto-plugin/Makefile.am index 778f99c6746..b24015e137b 100644 --- a/lto-plugin/Makefile.am +++ b/lto-plugin/Makefile.am @@ -8,21 +8,31 @@ target_noncanonical := @target_noncanonical@ libexecsubdir := $(libexecdir)/gcc/$(target_noncanonical)/$(gcc_version) AM_CPPFLAGS = -I$(top_srcdir)/../include $(DEFS) -AM_CFLAGS = -Wall -Werror +AM_CFLAGS = @ac_lto_plugin_warn_cflags@ +AM_LIBTOOLFLAGS = --tag=disable-static 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, liblto_plugin_la_SOURCES = lto-plugin.c -liblto_plugin_la_DEPENDENCIES = \ - $(if $(wildcard ../libiberty/pic/libiberty.a),../libiberty/pic/libiberty.a,) liblto_plugin_la_LIBADD = \ - $(if $(wildcard ../libiberty/pic/libiberty.a),-L../libiberty/pic -liberty,) + $(if $(wildcard ../libiberty/pic/libiberty.a),$(Wc)../libiberty/pic/libiberty.a,) # Note that we intentionally override the bindir supplied by ACX_LT_HOST_FLAGS -liblto_plugin_la_LDFLAGS = $(lt_host_flags) -bindir $(libexecsubdir) \ - $(if $(wildcard ../libiberty/pic/libiberty.a),,-L../libiberty -liberty) - -all: copy_lto_plugin - -copy_lto_plugin: all-am - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $(libexecsub_LTLIBRARIES) `pwd`/../gcc/ - +liblto_plugin_la_LDFLAGS = $(lt_host_flags) -module -bindir $(libexecsubdir) \ + $(if $(wildcard ../libiberty/pic/libiberty.a),,-Wc,../libiberty/libiberty.a) +liblto_plugin_la_DEPENDENCIES = $(if $(wildcard \ + ../libiberty/pic/libiberty.a),../libiberty/pic/libiberty.a,) + +all-local: $(in_gcc_libs) + +$(in_gcc_libs) : $(gcc_build_dir)/%: % + @if test "X`dlname=; . ./$*; echo dlname:$$dlname`" = "Xdlname:"; then \ + echo WARNING: $* is static, not copying to $@ >&2 ; \ + else \ + $(mkinstalldirs) $(gcc_build_dir) && \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $* `pwd`/$@ ; \ + fi