1 ## Process this file with automake to produce Makefile.in.
3 ACLOCAL_AMFLAGS = -I .. -I ../config
4 AUTOMAKE_OPTIONS = no-dependencies
6 gcc_version := $(shell @get_gcc_base_ver@ $(top_srcdir)/../gcc/BASE-VER)
7 target_noncanonical := @target_noncanonical@
8 libexecsubdir := $(libexecdir)/gcc/$(real_target_noncanonical)/$(gcc_version)$(accel_dir_suffix)
10 AM_CPPFLAGS = -I$(top_srcdir)/../include $(DEFS)
11 AM_CFLAGS = @ac_lto_plugin_warn_cflags@ $(CET_HOST_FLAGS) -DBASE_VERSION='"$(gcc_version)"'
12 AM_LDFLAGS = @ac_lto_plugin_ldflags@ @ac_lto_plugin_extra_ldflags@
13 AM_LIBTOOLFLAGS = --tag=disable-static
14 override CFLAGS := $(filter-out -fsanitize=address -fsanitize=hwaddress,$(CFLAGS))
15 override LDFLAGS := $(filter-out -fsanitize=address -fsanitize=hwaddress,$(LDFLAGS))
17 libexecsub_LTLIBRARIES = liblto_plugin.la
18 gcc_build_dir = @gcc_build_dir@
19 in_gcc_libs = $(foreach lib, $(libexecsub_LTLIBRARIES), $(gcc_build_dir)/$(lib))
21 if LTO_PLUGIN_USE_SYMVER
22 if LTO_PLUGIN_USE_SYMVER_GNU
23 version_arg = -Wl,--version-script=$(srcdir)/lto-plugin.map
25 if LTO_PLUGIN_USE_SYMVER_SUN
26 version_arg = -Wl,-M,$(srcdir)/lto-plugin.map
28 version_dep = $(srcdir)/lto-plugin.map
30 version_arg = -export-symbols-regex onload
34 liblto_plugin_la_SOURCES = lto-plugin.c
35 # Note that we intentionally override the bindir supplied by ACX_LT_HOST_FLAGS.
36 liblto_plugin_la_LDFLAGS = $(AM_LDFLAGS) \
37 $(lt_host_flags) -module -avoid-version -bindir $(libexecsubdir) \
39 # Can be simplified when libiberty becomes a normal convenience library.
40 libiberty = $(with_libiberty)/libiberty.a
41 libiberty_noasan = $(with_libiberty)/noasan/libiberty.a
42 libiberty_pic = $(with_libiberty)/pic/libiberty.a
44 liblto_plugin_la_LIBADD = \
45 $(if $(wildcard $(libiberty_noasan)),$(Wc)$(libiberty_noasan), \
46 $(if $(wildcard $(libiberty_pic)),$(Wc)$(libiberty_pic),))
47 liblto_plugin_la_LDFLAGS += \
48 $(if $(wildcard $(libiberty_noasan)),, \
49 $(if $(wildcard $(libiberty_pic)),,-Wc,$(libiberty)))
50 liblto_plugin_la_DEPENDENCIES = \
51 $(if $(wildcard $(libiberty_noasan)),$(libiberty_noasan), \
52 $(if $(wildcard $(libiberty_pic)),$(libiberty_pic),)) \
54 LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS))
55 liblto_plugin_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
56 $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
57 $(liblto_plugin_la_LDFLAGS) $(LTLDFLAGS) -o $@
59 all-local: $(in_gcc_libs)
61 $(in_gcc_libs) : $(gcc_build_dir)/%: %
62 @if test "X`dlname=; . ./$*; echo dlname:$$dlname`" = "Xdlname:"; then \
63 echo WARNING: $* is static, not copying to $@ >&2 ; \
65 $(mkinstalldirs) $(gcc_build_dir) && \
66 $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $* `pwd`/$@ ; \