--- freeciv-2.6.6/configure.ac.orig 2022-04-15 22:10:01.560412321 +0200 +++ freeciv-2.6.6/configure.ac 2022-04-15 22:31:30.240097611 +0200 @@ -1236,7 +1236,7 @@ if test "x$server" = "xyes"; then SERVER_LIBS="-lm ${SERVER_LIBS}" dnl Some systems (e.g., BeOS) need this lib - AC_CHECK_LIB(bind, gethostbyaddr, SERVER_LIBS="-lbind $SERVER_LIBS") + AC_CHECK_FUNC(gethostbyaddr,,[AC_CHECK_LIB(bind, gethostbyaddr, SERVER_LIBS="-lbind $SERVER_LIBS")]) dnl Readline library and header files. FC_HAS_READLINE() @@ -1364,13 +1364,13 @@ dnl Check for extra socket libraries. dnl If the AC_CHECK_FUNCS check finds the function, we don't look any dnl further. This is rumoured to prevent choosing the wrong libs on IRIX. if test $ac_cv_func_gethostbyname = no; then - AC_CHECK_LIB(nsl, gethostbyname, LIBS="-lnsl $LIBS") + AC_SEARCH_LIBS(gethostbyname, nsl) fi if test $ac_cv_func_connect = no; then - AC_CHECK_LIB(socket, connect, LIBS="-lsocket $LIBS") + AC_SEARCH_LIBS(connect, socket) fi if test $ac_cv_func_bind = no; then - AC_CHECK_LIB(bind, gethostbyaddr, LIBS="-lbind $LIBS") + AC_SEARCH_LIBS(gethostbyaddr, bind) fi dnl Windows fdopen does not work with sockets.