diff options
author | David Seifert <soap@gentoo.org> | 2022-01-29 20:31:07 +0100 |
---|---|---|
committer | Dodji Seketeli <dodji@redhat.com> | 2022-02-07 16:26:30 +0100 |
commit | 11987989859520541d785c0b3129b562b6672d4c (patch) | |
tree | 78c44fbef1d472b9e085b321087a323c013b961a | |
parent | symtab-reader: Fix typo in comment (diff) | |
download | libabigail-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.ac | 7 | ||||
-rw-r--r-- | src/Makefile.am | 4 | ||||
-rw-r--r-- | tools/Makefile.am | 3 | ||||
-rw-r--r-- | tools/kmidiff.cc | 1 |
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 | |||
161 | dnl ************************************************* | 161 | dnl ************************************************* |
162 | 162 | ||
163 | AC_PROG_CXX | 163 | AC_PROG_CXX |
164 | AC_CANONICAL_HOST | ||
164 | AC_USE_SYSTEM_EXTENSIONS | 165 | AC_USE_SYSTEM_EXTENSIONS |
165 | AC_PROG_INSTALL | 166 | AC_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 | ||
223 | dnl On musl, we need to find fts-standalone | ||
224 | AS_CASE( | ||
225 | [${host_os}], [*-musl*], [ | ||
226 | PKG_CHECK_MODULES([FTS], [fts-standalone]) | ||
227 | ]) | ||
228 | |||
222 | dnl Check for dependency: libelf, libdw, libebl (elfutils) | 229 | dnl Check for dependency: libelf, libdw, libebl (elfutils) |
223 | dnl Note that we need to use at least elfutils 0.159 but | 230 | dnl Note that we need to use at least elfutils 0.159 but |
224 | dnl at that time elfutils didnt have pkgconfig capabilities | 231 | dnl 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 | |||
46 | libabigail_la_SOURCES += abg-ctf-reader.cc | 46 | libabigail_la_SOURCES += abg-ctf-reader.cc |
47 | endif | 47 | endif |
48 | 48 | ||
49 | libabigail_la_LIBADD = $(DEPS_LIBS) | 49 | libabigail_la_LIBADD = $(DEPS_LIBS) $(FTS_LIBS) |
50 | libabigail_la_LDFLAGS = -lpthread -Wl,--as-needed -no-undefined | 50 | libabigail_la_LDFLAGS = -lpthread -Wl,--as-needed -no-undefined |
51 | 51 | ||
52 | CUSTOM_MACROS = -DABIGAIL_ROOT_SYSTEM_LIBDIR=\"${libdir}\" | 52 | CUSTOM_MACROS = -DABIGAIL_ROOT_SYSTEM_LIBDIR=\"${libdir}\" |
53 | 53 | ||
54 | AM_CPPFLAGS=\ | 54 | AM_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 | ||
38 | abipkgdiff_SOURCES = abipkgdiff.cc | 38 | abipkgdiff_SOURCES = abipkgdiff.cc |
39 | abipkgdiffdir = $(bindir) | 39 | abipkgdiffdir = $(bindir) |
40 | abipkgdiff_LDADD = $(abs_top_builddir)/src/libabigail.la | 40 | abipkgdiff_CPPFLAGS = $(FTS_CFLAGS) |
41 | abipkgdiff_LDADD = $(abs_top_builddir)/src/libabigail.la $(FTS_LIBS) | ||
41 | abipkgdiff_LDFLAGS = -pthread | 42 | abipkgdiff_LDFLAGS = -pthread |
42 | 43 | ||
43 | kmidiff_SOURCES = kmidiff.cc | 44 | kmidiff_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> |