From: Antonio Alvarez Feijoo Date: Thu, 7 Dec 2023 11:08:17 +0000 (+0100) Subject: fix(configure): misleading error if C compiler is not installed X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4980bad34775da715a2639b736cba5e65a8a2604;p=thirdparty%2Fdracut.git 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. --- diff --git a/configure b/configure index 91af41709..8d1971b79 100755 --- a/configure +++ b/configure @@ -60,6 +60,11 @@ if ! ${PKG_CONFIG} --exists --print-errors " libkmod >= 23 "; then exit 1 fi +if ! command -v "${CC}" > /dev/null; then + echo "dracut needs a C compiler (${CC} not found)." >&2 + exit 1 +fi + cat << EOF > conftest.c #include int main() {