From: Todd C. Miller Date: Sat, 7 Jan 2012 01:02:12 +0000 (-0500) Subject: Need -lsocket -lnsl for getaddrinfo(3) on Solaris at least. X-Git-Tag: SUDO_1_8_4~76^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c1a9cc9ab1d3ae3593ccc56a72779eb032c8a95b;p=sudo Need -lsocket -lnsl for getaddrinfo(3) on Solaris at least. --- diff --git a/configure b/configure index 5b99394e0..d2ff16bef 100755 --- a/configure +++ b/configure @@ -16816,19 +16816,6 @@ esac fi -ac_fn_c_check_func "$LINENO" "getaddrinfo" "ac_cv_func_getaddrinfo" -if test "x$ac_cv_func_getaddrinfo" = xyes; then : - $as_echo "#define HAVE_GETADDRINFO 1" >>confdefs.h - -else - case " $LIBOBJS " in - *" getaddrinfo.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS getaddrinfo.$ac_objext" - ;; -esac - -fi - ac_fn_c_check_func "$LINENO" "memrchr" "ac_cv_func_memrchr" if test "x$ac_cv_func_memrchr" = xyes; then : $as_echo "#define HAVE_MEMRCHR 1" >>confdefs.h @@ -17478,6 +17465,17 @@ fi fi +for ac_func in getaddrinfo +do : + ac_fn_c_check_func "$LINENO" "getaddrinfo" "ac_cv_func_getaddrinfo" +if test "x$ac_cv_func_getaddrinfo" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_GETADDRINFO 1 +_ACEOF + +fi +done + for ac_func in getprogname do : ac_fn_c_check_func "$LINENO" "getprogname" "ac_cv_func_getprogname" diff --git a/configure.in b/configure.in index ebfa325bc..db51f66fa 100644 --- a/configure.in +++ b/configure.in @@ -2137,7 +2137,7 @@ AC_CHECK_FUNCS(utimes, [AC_CHECK_FUNCS(futimes futimesat, [break])], [AC_CHECK_F AC_CHECK_FUNCS(killpg, [], [AC_LIBOBJ(killpg)]) SUDO_FUNC_FNMATCH([AC_DEFINE(HAVE_FNMATCH)], [AC_LIBOBJ(fnmatch)]) SUDO_FUNC_ISBLANK -AC_REPLACE_FUNCS(getaddrinfo memrchr strlcpy strlcat setenv) +AC_REPLACE_FUNCS(memrchr strlcpy strlcat setenv) AC_CHECK_FUNCS(nanosleep, [], [ # On Solaris, nanosleep is in librt AC_CHECK_LIB(rt, nanosleep, [REPLAY_LIBS="${REPLAY_LIBS} -lrt"], [AC_LIBOBJ(nanosleep)]) @@ -2188,6 +2188,10 @@ dnl If syslog(3) not in libc, check -lsocket, -lnsl and -linet dnl AC_CHECK_FUNC(syslog, , [AC_CHECK_LIB(socket, syslog, [NET_LIBS="${NET_LIBS} -lsocket"; LIBS="${LIBS} -lsocket"], AC_CHECK_LIB(nsl, syslog, [NET_LIBS="${NET_LIBS} -lnsl"; LIBS="${LIBS} -lnsl"], AC_CHECK_LIB(inet, syslog, [NET_LIBS="${NET_LIBS} -linet"; LIBS="${LIBS} -linet"])))]) dnl +dnl Defer getaddrinfo(3) check until after network libs are added to LIBS +dnl +AC_CHECK_FUNCS(getaddrinfo) +dnl dnl Check for getprogname() or __progname dnl AC_CHECK_FUNCS(getprogname, , [