1da0c48c4Sopenharmony_ci## Makefile.am for libdebuginfod library subdirectory in elfutils.
2da0c48c4Sopenharmony_ci##
3da0c48c4Sopenharmony_ci## Process this file with automake to create Makefile.in
4da0c48c4Sopenharmony_ci##
5da0c48c4Sopenharmony_ci## Copyright (C) 2019 Red Hat, Inc.
6da0c48c4Sopenharmony_ci## This file is part of elfutils.
7da0c48c4Sopenharmony_ci##
8da0c48c4Sopenharmony_ci## This file is free software; you can redistribute it and/or modify
9da0c48c4Sopenharmony_ci## it under the terms of either
10da0c48c4Sopenharmony_ci##
11da0c48c4Sopenharmony_ci##   * the GNU Lesser General Public License as published by the Free
12da0c48c4Sopenharmony_ci##     Software Foundation; either version 3 of the License, or (at
13da0c48c4Sopenharmony_ci##     your option) any later version
14da0c48c4Sopenharmony_ci##
15da0c48c4Sopenharmony_ci## or
16da0c48c4Sopenharmony_ci##
17da0c48c4Sopenharmony_ci##   * the GNU General Public License as published by the Free
18da0c48c4Sopenharmony_ci##     Software Foundation; either version 2 of the License, or (at
19da0c48c4Sopenharmony_ci##     your option) any later version
20da0c48c4Sopenharmony_ci##
21da0c48c4Sopenharmony_ci## or both in parallel, as here.
22da0c48c4Sopenharmony_ci##
23da0c48c4Sopenharmony_ci## elfutils is distributed in the hope that it will be useful, but
24da0c48c4Sopenharmony_ci## WITHOUT ANY WARRANTY; without even the implied warranty of
25da0c48c4Sopenharmony_ci## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
26da0c48c4Sopenharmony_ci## General Public License for more details.
27da0c48c4Sopenharmony_ci##
28da0c48c4Sopenharmony_ci## You should have received copies of the GNU General Public License and
29da0c48c4Sopenharmony_ci## the GNU Lesser General Public License along with this program.  If
30da0c48c4Sopenharmony_ci## not, see <http://www.gnu.org/licenses/>.
31da0c48c4Sopenharmony_ci##
32da0c48c4Sopenharmony_ciinclude $(top_srcdir)/config/eu.am
33da0c48c4Sopenharmony_ciAM_CPPFLAGS += -I$(srcdir) -I$(srcdir)/../libelf -I$(srcdir)/../libebl \
34da0c48c4Sopenharmony_ci	   -I$(srcdir)/../libdw -I$(srcdir)/../libdwelf \
35da0c48c4Sopenharmony_ci	   $(libmicrohttpd_CFLAGS) $(libcurl_CFLAGS) $(sqlite3_CFLAGS) \
36da0c48c4Sopenharmony_ci	   $(libarchive_CFLAGS)
37da0c48c4Sopenharmony_ci
38da0c48c4Sopenharmony_ci# Disable eu- prefixing for artifacts (binaries & man pages) in this
39da0c48c4Sopenharmony_ci# directory, since they do not conflict with binutils tools.
40da0c48c4Sopenharmony_ciprogram_prefix=
41da0c48c4Sopenharmony_ciprogram_transform_name = s,x,x,
42da0c48c4Sopenharmony_ci
43da0c48c4Sopenharmony_ciif BUILD_STATIC
44da0c48c4Sopenharmony_cilibasm = ../libasm/libasm.a
45da0c48c4Sopenharmony_cilibdw = ../libdw/libdw.a -lz $(zip_LIBS) $(libelf) $(libebl) -ldl -lpthread
46da0c48c4Sopenharmony_cilibelf = ../libelf/libelf.a -lz
47da0c48c4Sopenharmony_ciif DUMMY_LIBDEBUGINFOD
48da0c48c4Sopenharmony_cilibdebuginfod = ./libdebuginfod.a
49da0c48c4Sopenharmony_cielse
50da0c48c4Sopenharmony_cilibdebuginfod = ./libdebuginfod.a -lpthread $(libcurl_LIBS)
51da0c48c4Sopenharmony_ciendif
52da0c48c4Sopenharmony_cielse
53da0c48c4Sopenharmony_cilibasm = ../libasm/libasm.so
54da0c48c4Sopenharmony_cilibdw = ../libdw/libdw.so
55da0c48c4Sopenharmony_cilibelf = ../libelf/libelf.so
56da0c48c4Sopenharmony_cilibdebuginfod = ./libdebuginfod.so
57da0c48c4Sopenharmony_ciendif
58da0c48c4Sopenharmony_cilibebl = ../libebl/libebl.a
59da0c48c4Sopenharmony_cilibeu = ../lib/libeu.a
60da0c48c4Sopenharmony_ci
61da0c48c4Sopenharmony_ciAM_LDFLAGS = -Wl,-rpath-link,../libelf:../libdw:.
62da0c48c4Sopenharmony_ci
63da0c48c4Sopenharmony_cibin_PROGRAMS =
64da0c48c4Sopenharmony_ciif DEBUGINFOD
65da0c48c4Sopenharmony_cibin_PROGRAMS += debuginfod
66da0c48c4Sopenharmony_ciendif
67da0c48c4Sopenharmony_ci
68da0c48c4Sopenharmony_ciif LIBDEBUGINFOD
69da0c48c4Sopenharmony_cibin_PROGRAMS += debuginfod-find
70da0c48c4Sopenharmony_ciendif
71da0c48c4Sopenharmony_ci
72da0c48c4Sopenharmony_cidebuginfod_SOURCES = debuginfod.cxx
73da0c48c4Sopenharmony_cidebuginfod_LDADD = $(libdw) $(libelf) $(libeu) $(libdebuginfod) $(argp_LDADD) $(fts_LIBS) $(libmicrohttpd_LIBS) $(sqlite3_LIBS) $(libarchive_LIBS) -lpthread -ldl
74da0c48c4Sopenharmony_ci
75da0c48c4Sopenharmony_cidebuginfod_find_SOURCES = debuginfod-find.c
76da0c48c4Sopenharmony_cidebuginfod_find_LDADD = $(libdw) $(libelf) $(libeu) $(libdebuginfod) $(argp_LDADD) $(fts_LIBS)
77da0c48c4Sopenharmony_ci
78da0c48c4Sopenharmony_ciif LIBDEBUGINFOD
79da0c48c4Sopenharmony_cinoinst_LIBRARIES = libdebuginfod.a
80da0c48c4Sopenharmony_cinoinst_LIBRARIES += libdebuginfod_pic.a
81da0c48c4Sopenharmony_ciendif
82da0c48c4Sopenharmony_ci
83da0c48c4Sopenharmony_cilibdebuginfod_a_SOURCES = debuginfod-client.c
84da0c48c4Sopenharmony_cilibdebuginfod_pic_a_SOURCES = debuginfod-client.c
85da0c48c4Sopenharmony_ciam_libdebuginfod_pic_a_OBJECTS = $(libdebuginfod_a_SOURCES:.c=.os)
86da0c48c4Sopenharmony_ci
87da0c48c4Sopenharmony_ciif DUMMY_LIBDEBUGINFOD
88da0c48c4Sopenharmony_ciAM_CPPFLAGS += -Wno-unused-parameter
89da0c48c4Sopenharmony_ciendif
90da0c48c4Sopenharmony_ci
91da0c48c4Sopenharmony_ciif LIBDEBUGINFOD
92da0c48c4Sopenharmony_cipkginclude_HEADERS = debuginfod.h
93da0c48c4Sopenharmony_ciendif
94da0c48c4Sopenharmony_ci
95da0c48c4Sopenharmony_ciif LIBDEBUGINFOD
96da0c48c4Sopenharmony_cilibdebuginfod_so_LIBS = libdebuginfod_pic.a
97da0c48c4Sopenharmony_ciif DUMMY_LIBDEBUGINFOD
98da0c48c4Sopenharmony_cilibdebuginfod_so_LDLIBS =
99da0c48c4Sopenharmony_cielse
100da0c48c4Sopenharmony_cilibdebuginfod_so_LDLIBS = -lpthread $(libcurl_LIBS) $(fts_LIBS) $(libelf)
101da0c48c4Sopenharmony_ciendif
102da0c48c4Sopenharmony_ci$(LIBDEBUGINFOD_SONAME): $(srcdir)/libdebuginfod.map $(libdebuginfod_so_LIBS)
103da0c48c4Sopenharmony_ci	$(AM_V_CCLD)$(LINK) $(dso_LDFLAGS) -o $@ \
104da0c48c4Sopenharmony_ci		-Wl,--soname,$(LIBDEBUGINFOD_SONAME) \
105da0c48c4Sopenharmony_ci		-Wl,--version-script,$<,--no-undefined \
106da0c48c4Sopenharmony_ci		-Wl,--whole-archive $(libdebuginfod_so_LIBS) -Wl,--no-whole-archive \
107da0c48c4Sopenharmony_ci		$(libdebuginfod_so_LDLIBS)
108da0c48c4Sopenharmony_ci	@$(textrel_check)
109da0c48c4Sopenharmony_ci
110da0c48c4Sopenharmony_cilibdebuginfod.so: $(LIBDEBUGINFOD_SONAME)
111da0c48c4Sopenharmony_ci	ln -fs $< $@
112da0c48c4Sopenharmony_ci
113da0c48c4Sopenharmony_ciinstall: install-am libdebuginfod.so
114da0c48c4Sopenharmony_ci	$(mkinstalldirs) $(DESTDIR)$(libdir)
115da0c48c4Sopenharmony_ci	$(INSTALL_PROGRAM) $(LIBDEBUGINFOD_SONAME) \
116da0c48c4Sopenharmony_ci		$(DESTDIR)$(libdir)/libdebuginfod-$(PACKAGE_VERSION).so
117da0c48c4Sopenharmony_ci	ln -fs libdebuginfod-$(PACKAGE_VERSION).so $(DESTDIR)$(libdir)/$(LIBDEBUGINFOD_SONAME)
118da0c48c4Sopenharmony_ci	ln -fs libdebuginfod-$(PACKAGE_VERSION).so $(DESTDIR)$(libdir)/libdebuginfod.so
119da0c48c4Sopenharmony_ci
120da0c48c4Sopenharmony_ciuninstall: uninstall-am
121da0c48c4Sopenharmony_ci	rm -f $(DESTDIR)$(libdir)/libdebuginfod-$(PACKAGE_VERSION).so
122da0c48c4Sopenharmony_ci	rm -f $(DESTDIR)$(libdir)/$(LIBDEBUGINFOD_SONAME)
123da0c48c4Sopenharmony_ci	rm -f $(DESTDIR)$(libdir)/libdebuginfod.so
124da0c48c4Sopenharmony_ci	rmdir --ignore-fail-on-non-empty $(DESTDIR)$(includedir)/elfutils
125da0c48c4Sopenharmony_ciendif
126da0c48c4Sopenharmony_ci
127da0c48c4Sopenharmony_ciEXTRA_DIST = libdebuginfod.map
128da0c48c4Sopenharmony_ciMOSTLYCLEANFILES = $(am_libdebuginfod_pic_a_OBJECTS) $(LIBDEBUGINFOD_SONAME)
129da0c48c4Sopenharmony_ciCLEANFILES += $(am_libdebuginfod_pic_a_OBJECTS) libdebuginfod.so
130da0c48c4Sopenharmony_ci
131da0c48c4Sopenharmony_ci# automake std-options override: arrange to pass LD_LIBRARY_PATH
132da0c48c4Sopenharmony_ciinstallcheck-binPROGRAMS: $(bin_PROGRAMS)
133da0c48c4Sopenharmony_ci	bad=0; pid=$$$$; list="$(bin_PROGRAMS)"; for p in $$list; do \
134da0c48c4Sopenharmony_ci	  case ' $(AM_INSTALLCHECK_STD_OPTIONS_EXEMPT) ' in \
135da0c48c4Sopenharmony_ci	   *" $$p "* | *" $(srcdir)/$$p "*) continue;; \
136da0c48c4Sopenharmony_ci	  esac; \
137da0c48c4Sopenharmony_ci	  f=`echo "$$p" | \
138da0c48c4Sopenharmony_ci	     sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
139da0c48c4Sopenharmony_ci	  for opt in --help --version; do \
140da0c48c4Sopenharmony_ci	    if LD_LIBRARY_PATH=$(DESTDIR)$(libdir) \
141da0c48c4Sopenharmony_ci	       $(DESTDIR)$(bindir)/$$f $$opt > c$${pid}_.out 2> c$${pid}_.err \
142da0c48c4Sopenharmony_ci		 && test -n "`cat c$${pid}_.out`" \
143da0c48c4Sopenharmony_ci		 && test -z "`cat c$${pid}_.err`"; then :; \
144da0c48c4Sopenharmony_ci	    else echo "$$f does not support $$opt" 1>&2; bad=1; fi; \
145da0c48c4Sopenharmony_ci	  done; \
146da0c48c4Sopenharmony_ci	done; rm -f c$${pid}_.???; exit $$bad
147