Blame debuginfod/Makefile.am

Packit 032894
## Makefile.am for libdebuginfod library subdirectory in elfutils.
Packit 032894
##
Packit 032894
## Process this file with automake to create Makefile.in
Packit 032894
##
Packit 032894
## Copyright (C) 2019 Red Hat, Inc.
Packit 032894
## This file is part of elfutils.
Packit 032894
##
Packit 032894
## This file is free software; you can redistribute it and/or modify
Packit 032894
## it under the terms of either
Packit 032894
##
Packit 032894
##   * the GNU Lesser General Public License as published by the Free
Packit 032894
##     Software Foundation; either version 3 of the License, or (at
Packit 032894
##     your option) any later version
Packit 032894
##
Packit 032894
## or
Packit 032894
##
Packit 032894
##   * the GNU General Public License as published by the Free
Packit 032894
##     Software Foundation; either version 2 of the License, or (at
Packit 032894
##     your option) any later version
Packit 032894
##
Packit 032894
## or both in parallel, as here.
Packit 032894
##
Packit 032894
## elfutils is distributed in the hope that it will be useful, but
Packit 032894
## WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 032894
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 032894
## General Public License for more details.
Packit 032894
##
Packit 032894
## You should have received copies of the GNU General Public License and
Packit 032894
## the GNU Lesser General Public License along with this program.  If
Packit 032894
## not, see <http://www.gnu.org/licenses/>.
Packit 032894
##
Packit 032894
include $(top_srcdir)/config/eu.am
Packit 032894
AM_CPPFLAGS += -I$(srcdir) -I$(srcdir)/../libelf -I$(srcdir)/../libebl \
Packit 032894
	   -I$(srcdir)/../libdw -I$(srcdir)/../libdwelf \
Packit 032894
	   $(libmicrohttpd_CFLAGS) $(libcurl_CFLAGS) $(sqlite3_CFLAGS) \
Packit 032894
	   $(libarchive_CFLAGS)
Packit 032894
VERSION = 1
Packit 032894
Packit 032894
# Disable eu- prefixing for artifacts (binaries & man pages) in this
Packit 032894
# directory, since they do not conflict with binutils tools.
Packit 032894
program_prefix=
Packit 032894
program_transform_name = s,x,x,
Packit 032894
Packit 032894
if BUILD_STATIC
Packit 032894
libasm = ../libasm/libasm.a
Packit 032894
libdw = ../libdw/libdw.a -lz $(zip_LIBS) $(libelf) $(libebl) -ldl -lpthread
Packit 032894
libelf = ../libelf/libelf.a -lz
Packit 032894
libdebuginfod = ./libdebuginfod.a $(libcurl_LIBS)
Packit 032894
else
Packit 032894
libasm = ../libasm/libasm.so
Packit 032894
libdw = ../libdw/libdw.so
Packit 032894
libelf = ../libelf/libelf.so
Packit 032894
libdebuginfod = ./libdebuginfod.so
Packit 032894
endif
Packit 032894
libebl = ../libebl/libebl.a
Packit 032894
libeu = ../lib/libeu.a
Packit 032894
Packit 032894
AM_LDFLAGS = -Wl,-rpath-link,../libelf:../libdw:.
Packit 032894
Packit 032894
bin_PROGRAMS = debuginfod debuginfod-find
Packit 032894
debuginfod_SOURCES = debuginfod.cxx
Packit 032894
debuginfod_LDADD = $(libdw) $(libelf) $(libeu) $(libdebuginfod) $(libmicrohttpd_LIBS) $(libcurl_LIBS) $(sqlite3_LIBS) $(libarchive_LIBS) -lpthread -ldl
Packit 032894
Packit 032894
debuginfod_find_SOURCES = debuginfod-find.c
Packit Service 35cfd5
debuginfod_find_LDADD = $(libdw) $(libelf) $(libeu) $(libdebuginfod)
Packit 032894
Packit 032894
noinst_LIBRARIES = libdebuginfod.a
Packit 032894
noinst_LIBRARIES += libdebuginfod_pic.a
Packit 032894
Packit 032894
libdebuginfod_a_SOURCES = debuginfod-client.c
Packit 032894
libdebuginfod_pic_a_SOURCES = debuginfod-client.c
Packit 032894
am_libdebuginfod_pic_a_OBJECTS = $(libdebuginfod_a_SOURCES:.c=.os)
Packit 032894
Packit 032894
pkginclude_HEADERS = debuginfod.h
Packit 032894
Packit 032894
libdebuginfod_so_LIBS = libdebuginfod_pic.a
Packit 032894
libdebuginfod_so_LDLIBS = $(libcurl_LIBS)
Packit 032894
libdebuginfod.so$(EXEEXT): $(srcdir)/libdebuginfod.map $(libdebuginfod_so_LIBS)
Packit 032894
	$(AM_V_CCLD)$(LINK) $(dso_LDFLAGS) -o $@ \
Packit 032894
		-Wl,--soname,$@.$(VERSION) \
Packit 032894
		-Wl,--version-script,$<,--no-undefined \
Packit 032894
		-Wl,--whole-archive $(libdebuginfod_so_LIBS) -Wl,--no-whole-archive \
Packit 032894
		$(libdebuginfod_so_LDLIBS)
Packit 032894
	@$(textrel_check)
Packit 032894
	$(AM_V_at)ln -fs $@ $@.$(VERSION)
Packit 032894
Packit 032894
install: install-am libdebuginfod.so
Packit 032894
	$(mkinstalldirs) $(DESTDIR)$(libdir)
Packit 032894
	$(INSTALL_PROGRAM) libdebuginfod.so $(DESTDIR)$(libdir)/libdebuginfod-$(PACKAGE_VERSION).so
Packit 032894
	ln -fs libdebuginfod-$(PACKAGE_VERSION).so $(DESTDIR)$(libdir)/libdebuginfod.so.$(VERSION)
Packit 032894
	ln -fs libdebuginfod.so.$(VERSION) $(DESTDIR)$(libdir)/libdebuginfod.so
Packit 032894
Packit 032894
uninstall: uninstall-am
Packit 032894
	rm -f $(DESTDIR)$(libdir)/libdebuginfod-$(PACKAGE_VERSION).so
Packit 032894
	rm -f $(DESTDIR)$(libdir)/libdebuginfod.so.$(VERSION)
Packit 032894
	rm -f $(DESTDIR)$(libdir)/libdebuginfod.so
Packit 032894
	rmdir --ignore-fail-on-non-empty $(DESTDIR)$(includedir)/elfutils
Packit 032894
Packit 032894
EXTRA_DIST = libdebuginfod.map
Packit 032894
MOSTLYCLEANFILES = $(am_libdebuginfod_pic_a_OBJECTS) libdebuginfod.so.$(VERSION)
Packit 032894
CLEANFILES += $(am_libdebuginfod_pic_a_OBJECTS) libdebuginfod.so
Packit 032894
Packit 032894
# automake std-options override: arrange to pass LD_LIBRARY_PATH
Packit 032894
installcheck-binPROGRAMS: $(bin_PROGRAMS)
Packit 032894
	bad=0; pid=$$$$; list="$(bin_PROGRAMS)"; for p in $$list; do \
Packit 032894
	  case ' $(AM_INSTALLCHECK_STD_OPTIONS_EXEMPT) ' in \
Packit 032894
	   *" $$p "* | *" $(srcdir)/$$p "*) continue;; \
Packit 032894
	  esac; \
Packit 032894
	  f=`echo "$$p" | \
Packit 032894
	     sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
Packit 032894
	  for opt in --help --version; do \
Packit 032894
	    if LD_LIBRARY_PATH=$(DESTDIR)$(libdir) \
Packit 032894
	       $(DESTDIR)$(bindir)/$$f $$opt > c$${pid}_.out 2> c$${pid}_.err \
Packit 032894
		 && test -n "`cat c$${pid}_.out`" \
Packit 032894
		 && test -z "`cat c$${pid}_.err`"; then :; \
Packit 032894
	    else echo "$$f does not support $$opt" 1>&2; bad=1; fi; \
Packit 032894
	  done; \
Packit 032894
	done; rm -f c$${pid}_.???; exit $$bad