package/libselinux: allow building on !glibc using musl-fts
authorThomas Petazzoni <thomas.petazzoni@bootlin.com>
Sun, 22 Sep 2019 09:06:26 +0000 (11:06 +0200)
committerArnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Wed, 9 Oct 2019 21:10:37 +0000 (23:10 +0200)
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
package/libselinux/Config.in
package/libselinux/libselinux.mk

index 6be816db7778999b4e90dbdfb523f3a8e555fbe2..8cebd34fb24b41670f15ed650d282a57d1cd3265 100644 (file)
@@ -2,12 +2,11 @@ config BR2_PACKAGE_LIBSELINUX
        bool "libselinux"
        depends on BR2_TOOLCHAIN_HAS_THREADS
        depends on !BR2_STATIC_LIBS
-       # Uses <fts.h>, not available in musl or uClibc
-       depends on BR2_TOOLCHAIN_USES_GLIBC
        # Toolchain issue: "fixup not contained within frag"
        depends on !BR2_arc
        select BR2_PACKAGE_LIBSEPOL
        select BR2_PACKAGE_PCRE
+       select BR2_PACKAGE_MUSL_FTS if !BR2_TOOLCHAIN_USES_GLIBC
        help
          libselinux is the runtime SELinux library that provides
          interfaces (e.g. library functions for the SELinux kernel
@@ -19,7 +18,6 @@ config BR2_PACKAGE_LIBSELINUX
 
          http://selinuxproject.org/page/Main_Page
 
-comment "libselinux needs a glibc toolchain w/ threads, dynamic library"
+comment "libselinux needs a toolchain w/ threads, dynamic library"
        depends on !BR2_arc
-       depends on !BR2_TOOLCHAIN_HAS_THREADS || BR2_STATIC_LIBS || \
-               !BR2_TOOLCHAIN_USES_GLIBC
+       depends on !BR2_TOOLCHAIN_HAS_THREADS || BR2_STATIC_LIBS
index 977f9e2e8b593eb87213fd0364731a9998d358e4..c707c8a25e388c5c0f384f727324728e3c4f1327 100644 (file)
@@ -25,6 +25,11 @@ LIBSELINUX_MAKE_OPTS = \
 
 LIBSELINUX_MAKE_INSTALL_TARGETS = install
 
+ifeq ($(BR2_TOOLCHAIN_USES_GLIBC),)
+LIBSELINUX_DEPENDENCIES += musl-fts
+LIBSELINUX_MAKE_OPTS += FTS_LDLIBS=-lfts
+endif
+
 ifeq ($(BR2_PACKAGE_PYTHON)$(BR2_PACKAGE_PYTHON3),y)
 ifeq ($(BR2_PACKAGE_PYTHON3),y)
 LIBSELINUX_DEPENDENCIES += python3 host-swig