|
|
|
@ -7,6 +7,7 @@ prefix=/usr
@@ -7,6 +7,7 @@ prefix=/usr
|
|
|
|
|
|
|
|
|
|
enable_documentation=yes |
|
|
|
|
|
|
|
|
|
CC="${CC:-cc}" |
|
|
|
|
PKG_CONFIG="${PKG_CONFIG:-pkg-config}" |
|
|
|
|
|
|
|
|
|
# Little helper function for reading args from the commandline. |
|
|
|
@ -57,6 +58,48 @@ if ! ${PKG_CONFIG} --exists --print-errors " libkmod >= 23 "; then
@@ -57,6 +58,48 @@ if ! ${PKG_CONFIG} --exists --print-errors " libkmod >= 23 "; then
|
|
|
|
|
exit 1 |
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
cat <<EOF >conftest.c |
|
|
|
|
#include <fts.h> |
|
|
|
|
int main() { |
|
|
|
|
return 0; |
|
|
|
|
} |
|
|
|
|
EOF |
|
|
|
|
|
|
|
|
|
${CC} $CFLAGS $LDFLAGS conftest.c >/dev/null 2>&1 |
|
|
|
|
ret=$? |
|
|
|
|
rm -f conftest.c a.out |
|
|
|
|
|
|
|
|
|
# musl doesn't have fts.h included |
|
|
|
|
if test $ret -ne 0; then |
|
|
|
|
echo "dracut needs fts development files." >&2 |
|
|
|
|
exit 1 |
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
cat <<EOF >conftest.c |
|
|
|
|
#include <fts.h> |
|
|
|
|
int main(void) { |
|
|
|
|
fts_open(0, 0, 0); |
|
|
|
|
return 0; |
|
|
|
|
} |
|
|
|
|
EOF |
|
|
|
|
|
|
|
|
|
found=no |
|
|
|
|
for lib in "-lc" "-lfts"; do |
|
|
|
|
${CC} $CFLAGS -Wl,$lib $LDFLAGS conftest.c >/dev/null 2>&1 |
|
|
|
|
ret=$? |
|
|
|
|
if test $ret -eq 0; then |
|
|
|
|
FTS_LIBS="$lib" |
|
|
|
|
found=yes |
|
|
|
|
break; |
|
|
|
|
fi |
|
|
|
|
done |
|
|
|
|
rm -f conftest.c a.out |
|
|
|
|
|
|
|
|
|
if test $found = no; then |
|
|
|
|
echo "dracut couldn't find usable fts library" >&2 |
|
|
|
|
exit 1 |
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
cat > Makefile.inc.$$ <<EOF |
|
|
|
|
prefix ?= ${prefix} |
|
|
|
|
libdir ?= ${libdir:-${prefix}/lib} |
|
|
|
@ -68,6 +111,7 @@ enable_documentation ?= ${enable_documentation:-yes}
@@ -68,6 +111,7 @@ enable_documentation ?= ${enable_documentation:-yes}
|
|
|
|
|
bindir ?= ${bindir:-${prefix}/bin} |
|
|
|
|
KMOD_CFLAGS ?= $(${PKG_CONFIG} --cflags " libkmod >= 23 ") |
|
|
|
|
KMOD_LIBS ?= $(${PKG_CONFIG} --libs " libkmod >= 23 ") |
|
|
|
|
FTS_LIBS ?= ${FTS_LIBS} |
|
|
|
|
EOF |
|
|
|
|
|
|
|
|
|
{ |
|
|
|
|