X-Git-Url: http://git.silcnet.org/gitweb/?p=silc.git;a=blobdiff_plain;f=configure.in.pre;h=73dfd0d51009e50360a227cb4c925e3d3deb1039;hp=b0c9371bf2540f9b80a85f7b8f58602d328c8a8d;hb=fb8dbc2d9cd7ff5d197654f873ac18aa6ef9c5e3;hpb=e51f4e881515d5e6d69596c4b8fc5235159b3d56 diff --git a/configure.in.pre b/configure.in.pre index b0c9371b..73dfd0d5 100644 --- a/configure.in.pre +++ b/configure.in.pre @@ -94,12 +94,23 @@ AC_CHECK_SIZEOF(void *, 0) AC_DEFINE_UNQUOTED(SILC_SIZEOF_VOID_P, $ac_cv_sizeof_void_p) # Function and library checking -AC_CHECK_FUNCS(initscr) -AC_CHECK_LIB(ncurses, initscr, LIBS="$LIBS -lncurses") -AC_CHECK_FUNCS(gethostbyname) -#AC_CHECK_LIB(nsl, gethostbyname, LIBS="$LIBS -lnsl -lresolv") -AC_CHECK_FUNCS(socket) -AC_CHECK_LIB(socket, socket, LIBS="$LIBS -lsocket") +AC_CHECK_FUNC(initscr, ac_initscr_found=1, ac_initscr_found=0) +if test x$ac_initscr_found = x0; then + AC_CHECK_LIB(ncurses, initscr, LIBS="$LIBS -lncurses") +fi +AC_CHECK_FUNC(gethostbyname, ac_gethostbyname_found=1, +ac_gethostbyname_found=0) +if test x$ac_gethostbyname_found = x0; then + AC_CHECK_LIB(nsl, gethostbyname, LIBS="$LIBS -lnsl") + AC_CHECK_FUNC(res_gethostbyname, ac_res_ghbn_found=1, ac_res_ghbn_found=0) + if test x$ac_res_ghbn_found = x0; then + AC_CHECK_LIB(resolv, res_gethostbyname, LIBS="$LIBS -lresolv") + fi +fi +AC_CHECK_FUNC(socket, ac_socket_found=1, ac_socket_found=0) +if test x$ac_socket_found = x0; then + AC_CHECK_LIB(socket, socket, LIBS="$LIBS -lsocket") +fi AC_CHECK_FUNCS(gethostname gethostbyaddr getservbyname getservbyport) AC_CHECK_FUNCS(select listen bind shutdown close connect) AC_CHECK_FUNCS(fcntl setsockopt)