Skip to content

Commit 4980bad

Browse files
aafeijoo-susejohannbg
authored andcommitted
fix(configure): misleading error if C compiler is not installed
While preparing a new system for development, `./configure` reaches a point where it fails with: ``` $ ./configure dracut needs fts development files. ``` After installing the fts library, `./configure` keeps throwing the same error: ``` $ rpm -qf /usr/include/fts.h glibc-devel-2.38-6.1.x86_64 $ ./configure dracut needs fts development files. ``` The problem is `${CC} $CFLAGS $LDFLAGS conftest.c` can also fail if the compiler referenced by `$CC` is not installed.
1 parent de8ac63 commit 4980bad

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

configure

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@ if ! ${PKG_CONFIG} --exists --print-errors " libkmod >= 23 "; then
6060
exit 1
6161
fi
6262

63+
if ! command -v "${CC}" > /dev/null; then
64+
echo "dracut needs a C compiler (${CC} not found)." >&2
65+
exit 1
66+
fi
67+
6368
cat << EOF > conftest.c
6469
#include <fts.h>
6570
int main() {

0 commit comments

Comments
 (0)