summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Seifert <soap@gentoo.org>2022-01-29 20:31:07 +0100
committerDodji Seketeli <dodji@redhat.com>2022-02-07 16:26:30 +0100
commit11987989859520541d785c0b3129b562b6672d4c (patch)
tree78c44fbef1d472b9e085b321087a323c013b961a
parentsymtab-reader: Fix typo in comment (diff)
downloadlibabigail-11987989859520541d785c0b3129b562b6672d4c.tar.gz
libabigail-11987989859520541d785c0b3129b562b6672d4c.tar.bz2
libabigail-11987989859520541d785c0b3129b562b6672d4c.tar.xz
Find fts-standalone on musl
When using the musl C library fts is optional. So we need to detect its presence by looking at the fts-standalone pkgconfig module. This patch does that. This comes from Gentoo bug https://bugs.gentoo.org/831571 * configure.ac: Invoke AC_CANONICAL_HOST to compute the host_cpu, host_vendor, host_os parts of the 'host" variable. Then if the host_os ends up with "musl" then, check for the fts-standalone pkgconfig module and record the fts library into FTS_{LIBS,CFLAGS}. * src/Makefile.am: Link to $FTS_LIBS and use $FTS_CFLAGS for compilation. * tools/Makefile.am: Likewise. * tools/abisym.cc: Include libgen.h * tools/kmidiff.cc: Remove useless fts.h header file. Signed-off-by: David Seifert <soap@gentoo.org> Signed-off-by: Dodji Seketeli <dodji@redhat.com>
-rw-r--r--configure.ac7
-rw-r--r--src/Makefile.am4
-rw-r--r--tools/Makefile.am3
-rw-r--r--tools/kmidiff.cc1
4 files changed, 11 insertions, 4 deletions
diff --git a/configure.ac b/configure.ac
index 29130175..019bdbac 100644
--- a/configure.ac
+++ b/configure.ac
@@ -161,6 +161,7 @@ dnl check for dependencies
161dnl ************************************************* 161dnl *************************************************
162 162
163AC_PROG_CXX 163AC_PROG_CXX
164AC_CANONICAL_HOST
164AC_USE_SYSTEM_EXTENSIONS 165AC_USE_SYSTEM_EXTENSIONS
165AC_PROG_INSTALL 166AC_PROG_INSTALL
166 167
@@ -219,6 +220,12 @@ AS_IF([test "x$ac_cv_bad_fts" = "xyes"],
219 [CFLAGS="$CFLAGS -DBAD_FTS=1", 220 [CFLAGS="$CFLAGS -DBAD_FTS=1",
220 CXXFLAGS="$CXXFLAGS -DBAD_FTS=1"]) 221 CXXFLAGS="$CXXFLAGS -DBAD_FTS=1"])
221 222
223dnl On musl, we need to find fts-standalone
224AS_CASE(
225 [${host_os}], [*-musl*], [
226 PKG_CHECK_MODULES([FTS], [fts-standalone])
227])
228
222dnl Check for dependency: libelf, libdw, libebl (elfutils) 229dnl Check for dependency: libelf, libdw, libebl (elfutils)
223dnl Note that we need to use at least elfutils 0.159 but 230dnl Note that we need to use at least elfutils 0.159 but
224dnl at that time elfutils didnt have pkgconfig capabilities 231dnl at that time elfutils didnt have pkgconfig capabilities
diff --git a/src/Makefile.am b/src/Makefile.am
index 29da1ecf..1591224f 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -46,12 +46,12 @@ if CTF_READER
46libabigail_la_SOURCES += abg-ctf-reader.cc 46libabigail_la_SOURCES += abg-ctf-reader.cc
47endif 47endif
48 48
49libabigail_la_LIBADD = $(DEPS_LIBS) 49libabigail_la_LIBADD = $(DEPS_LIBS) $(FTS_LIBS)
50libabigail_la_LDFLAGS = -lpthread -Wl,--as-needed -no-undefined 50libabigail_la_LDFLAGS = -lpthread -Wl,--as-needed -no-undefined
51 51
52CUSTOM_MACROS = -DABIGAIL_ROOT_SYSTEM_LIBDIR=\"${libdir}\" 52CUSTOM_MACROS = -DABIGAIL_ROOT_SYSTEM_LIBDIR=\"${libdir}\"
53 53
54AM_CPPFLAGS=\ 54AM_CPPFLAGS=\
55$(CUSTOM_MACROS) $(DEPS_CPPFLAGS) \ 55$(CUSTOM_MACROS) $(DEPS_CPPFLAGS) $(FTS_CFLAGS) \
56-Wall -I$(abs_top_srcdir) -I$(abs_top_srcdir)/include \ 56-Wall -I$(abs_top_srcdir) -I$(abs_top_srcdir)/include \
57-I$(abs_top_builddir)/include -I$(abs_top_builddir) 57-I$(abs_top_builddir)/include -I$(abs_top_builddir)
diff --git a/tools/Makefile.am b/tools/Makefile.am
index 648a71b5..f7592b60 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -37,7 +37,8 @@ abicompat_LDADD = $(abs_top_builddir)/src/libabigail.la
37 37
38abipkgdiff_SOURCES = abipkgdiff.cc 38abipkgdiff_SOURCES = abipkgdiff.cc
39abipkgdiffdir = $(bindir) 39abipkgdiffdir = $(bindir)
40abipkgdiff_LDADD = $(abs_top_builddir)/src/libabigail.la 40abipkgdiff_CPPFLAGS = $(FTS_CFLAGS)
41abipkgdiff_LDADD = $(abs_top_builddir)/src/libabigail.la $(FTS_LIBS)
41abipkgdiff_LDFLAGS = -pthread 42abipkgdiff_LDFLAGS = -pthread
42 43
43kmidiff_SOURCES = kmidiff.cc 44kmidiff_SOURCES = kmidiff.cc
diff --git a/tools/kmidiff.cc b/tools/kmidiff.cc
index b802348f..2e88baa7 100644
--- a/tools/kmidiff.cc
+++ b/tools/kmidiff.cc
@@ -11,7 +11,6 @@
11 11
12#include <sys/types.h> 12#include <sys/types.h>
13#include <dirent.h> 13#include <dirent.h>
14#include <fts.h>
15#include <cstring> 14#include <cstring>
16#include <string> 15#include <string>
17#include <vector> 16#include <vector>