]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
fix(configure): misleading error if C compiler is not installed
authorAntonio Alvarez Feijoo <antonio.feijoo@suse.com>
Thu, 7 Dec 2023 11:08:17 +0000 (12:08 +0100)
committerJóhann B. Guðmundsson <johannbg@gmail.com>
Thu, 4 Jan 2024 20:05:57 +0000 (20:05 +0000)
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.

configure

index 91af417098ffc204e945274e2300f11f999fa62e..8d1971b79aef09b0205cef9a5cf16789df5d5652 100755 (executable)
--- 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 <fts.h>
 int main() {