]> git.ipfire.org Git - thirdparty/libcgroup.git/commitdiff
configure.ac: check for the library containing fts_open
authorRoss Burton <ross.burton@arm.com>
Fri, 10 Sep 2021 17:42:20 +0000 (11:42 -0600)
committerTom Hromatka <tom.hromatka@oracle.com>
Tue, 14 Sep 2021 20:34:07 +0000 (14:34 -0600)
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 <ross.burton@arm.com>
[TJH: minor formatting changes to match existing configure.ac]
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
(cherry picked from commit 27ba904355575153308bdc0fa48344ef1be55ca1)

configure.ac

index cbe5cef91b05b3bf55030a432fc1c207a01c6976..ebfd90a4381fb6d39b66b49f23f0f5fe3c4c2658 100644 (file)
@@ -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],