Skip to content

Commit 0e73863

Browse files
committed
configure.ac: WIN32 GetAdaptersInfo(): be careful about $NETLIBS_GETADDRS usage
Signed-off-by: Jim Klimov <[email protected]>
1 parent 4c32e6a commit 0e73863

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

configure.ac

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1918,7 +1918,9 @@ AS_IF([test x"${ac_cv_struct_pollfd}" = xyes],
19181918
]
19191919
)
19201920

1921-
NETLIBS_GETADDRS=""
1921+
dnl May be cached or not
1922+
NETLIBS_GETADDRS="${nut_cv_var_NETLIBS_GETADDRS}"
1923+
19221924
dnl For `nut-scanner -m auto` modes, see also:
19231925
dnl https://stackoverflow.com/a/41151132/4715872
19241926
dnl https://learn.microsoft.com/en-us/windows/win32/api/iphlpapi/nf-iphlpapi-getadaptersaddresses (since ~Windows Vista)
@@ -1965,7 +1967,7 @@ printf("%ld ", GetAdaptersAddresses(AF_INET6, GAA_FLAG_SKIP_ANYCAST, NULL, buf,
19651967
dnl e.g. add "-lws2_32" for mingw builds, maybe "-liphlpapi"
19661968
dnl the NETLIBS are set by NUT_CHECK_SOCKETLIB above
19671969
SAVED_LIBS="$LIBS"
1968-
LIBS="$LIBS $NETLIBS"
1970+
LIBS="$LIBS $NETLIBS $NETLIBS_GETADDRS"
19691971
AX_RUN_OR_LINK_IFELSE(
19701972
[AC_LANG_PROGRAM(
19711973
[${myIPHLPAPI_TEST_HEADERS}],
@@ -2058,7 +2060,7 @@ printf("%ld ", GetAdaptersInfo(buf, &bufsz))
20582060
)]
20592061
)
20602062
AC_SUBST([NETLIBS_GETADDRS])
2061-
2063+
AC_CACHE_VAL([nut_cv_var_NETLIBS_GETADDRS], [nut_cv_var_NETLIBS_GETADDRS="${NETLIBS_GETADDRS}"])
20622064

20632065
dnl ----------------------------------------------------------------------
20642066
dnl First remember if caller wants a custom Python package location?

0 commit comments

Comments
 (0)