Skip to content

Commit

Permalink
fix(configure): misleading error if C compiler is not installed
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
aafeijoo-suse authored and johannbg committed Jan 4, 2024
1 parent de8ac63 commit 4980bad
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 4980bad

Please sign in to comment.