build: add gperf check

Check for gperf in ./configure to provide a clear, user-friendly
error message if it's not found and required generated files are
missing, instead of failing at compile time.

Also fix an invalid package name ('install') in README.md for
Fedora/RHEL build.

Signed-off-by: Grigory Trenin <grigory.trenin@gmail.com>
This commit is contained in:
Grigory Trenin
2025-11-06 15:43:24 -05:00
parent 284f2ecde5
commit 49a807a25f
2 changed files with 14 additions and 2 deletions

View File

@@ -49,7 +49,7 @@ apt-get install -y ronn
## Fedora/RHEL:
```
# Basic build tools
yum install -y install make automake gcc pkgconf-pkg-config
yum install -y make automake gcc pkgconf-pkg-config
# Required
yum install -y gnutls-devel libev-devel readline-devel
# Optional functionality and testing
@@ -84,7 +84,7 @@ Note that the code coverage reported does not currently include tests which
are run within docker.
In addition to the prerequisites listed above, building from git requires
the following packages: autoconf, automake, and xz.
the following packages: autoconf, automake, gperf, and xz.
To build from the git repository use:
```

View File

@@ -22,6 +22,18 @@ if test "$GCC" = "yes" && ! expr "$CC" : clang >/dev/null 2>&1;then
CFLAGS="$CFLAGS -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wno-sign-compare -Wno-missing-field-initializers -Wno-implicit-fallthrough -Wno-stringop-truncation"
fi
AC_PATH_PROG([GPERF], [gperf])
if test -z "$GPERF"; then
GPERF_FILE="src/http-heads.h"
if test ! -f "$GPERF_FILE"; then
AC_MSG_ERROR([[
***
*** GNU gperf was not found. It is required to generate $GPERF_FILE
*** ]])
fi
fi
AC_CHECK_PROGS([IPCALC], [ipcalc ipcalc-ng], [:])
if test x"$IPCALC" = "x:"; then