configure: only check in the watt library if WATT_ROOT is set

Only look for gethostbyname in libwatt in $WATT_ROOT/lib if WATT_ROOT
has actually been set. This avoids configure trying to search in /lib,
which won't every succeed and can cause problems in cross builds which
check that host paths are not being searched.

Closes #22380
This commit is contained in:
Ross Burton 2026-07-23 13:09:13 +01:00 committed by Daniel Stenberg
parent 8734b08883
commit 090056522b
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2

View file

@ -1277,7 +1277,7 @@ if test "$HAVE_GETHOSTBYNAME" != "1"; then
)
fi
if test "$HAVE_GETHOSTBYNAME" != "1"; then
if test "$HAVE_GETHOSTBYNAME" != "1" && test -n "$WATT_ROOT"; then
dnl gethostbyname in the watt lib?
clean_CPPFLAGS=$CPPFLAGS
clean_LDFLAGS=$LDFLAGS