diff mbox

[2/5] libselinux: enable linking to musl-fts

Message ID 20180517051117.48454-3-jason@perfinion.com (mailing list archive)
State Not Applicable
Headers show

Commit Message

Jason Zaman May 17, 2018, 5:11 a.m. UTC
Musl libc does not include the fts(3) functions so need to link to the
musl-fts library
https://github.com/pullmoll/musl-fts

Signed-off-by: Jason Zaman <jason@perfinion.com>
---
 libselinux/src/Makefile | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/libselinux/src/Makefile b/libselinux/src/Makefile
index 8af04aab..977b5c8c 100644
--- a/libselinux/src/Makefile
+++ b/libselinux/src/Makefile
@@ -98,6 +98,8 @@  LD_SONAME_FLAGS=-install_name,$(LIBSO)
 endif
 
 PCRE_LDLIBS ?= -lpcre
+# override with -lfts when building on Musl libc to use fts-standalone
+FTS_LDLIBS ?=
 
 override CFLAGS += -I../include -D_GNU_SOURCE $(DISABLE_FLAGS) $(PCRE_CFLAGS)
 
@@ -149,7 +151,7 @@  $(LIBA): $(OBJS)
 	$(RANLIB) $@
 
 $(LIBSO): $(LOBJS)
-	$(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $^ $(PCRE_LDLIBS) -ldl -Wl,$(LD_SONAME_FLAGS)
+	$(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $^ $(PCRE_LDLIBS) $(FTS_LDLIBS) -ldl -Wl,$(LD_SONAME_FLAGS)
 	ln -sf $@ $(TARGET)
 
 $(LIBPC): $(LIBPC).in ../VERSION