From 27ba904355575153308bdc0fa48344ef1be55ca1 Mon Sep 17 00:00:00 2001 From: Ross Burton Date: Fri, 10 Sep 2021 11:24:47 -0600 Subject: [PATCH] configure.ac: check for the library containing fts_open The musl C library doesn't provide fts.h[1], so libcgroup doesn't compile with musl. However, there is a standalone implementation of fts for musl users[2] which can be used. Use AC_SEARCH_LIBS to search for fts_open, which will check if it is part of libc, and if not look in libfts, then set LIBS if needed. [1] https://wiki.musl-libc.org/faq.html [2] https://github.com/void-linux/musl-fts Closes #61. Signed-off-by: Ross Burton [TJH: minor formatting changes to match existing configure.ac] Signed-off-by: Tom Hromatka --- configure.ac | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/configure.ac b/configure.ac index cbe5cef9..ebfd90a4 100644 --- a/configure.ac +++ b/configure.ac @@ -174,6 +174,12 @@ AC_FUNC_REALLOC AC_FUNC_STAT AC_CHECK_FUNCS([getmntent hasmntopt memset mkdir rmdir strdup]) +AC_SEARCH_LIBS( + [fts_open], + [fts], + [], + [AC_MSG_ERROR([Unable to find the fts_open() function])]) + if test x$with_pam = xtrue; then AC_CHECK_LIB( [pam], -- 2.47.2