From: Todd C. Miller Date: Wed, 21 Sep 2011 16:34:13 +0000 (-0400) Subject: FreeBSD has libutil.h not util.h X-Git-Tag: SUDO_1_7_8~8 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9df24c138f048918363745923544697f3ac5c6a3;p=sudo FreeBSD has libutil.h not util.h --HG-- branch : 1.7 --- diff --git a/config.h.in b/config.h.in index 7f00536a8..8d1e22e53 100644 --- a/config.h.in +++ b/config.h.in @@ -311,6 +311,9 @@ /* Define to 1 if you have the `dl' library (-ldl). */ #undef HAVE_LIBDL +/* Define to 1 if you have the header file. */ +#undef HAVE_LIBUTIL_H + /* Define to 1 to enable Linux audit support. */ #undef HAVE_LINUX_AUDIT diff --git a/configure b/configure index 21d7d900a..87f4afb00 100755 --- a/configure +++ b/configure @@ -16197,7 +16197,7 @@ if test "x$ac_cv_func_openpty" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_OPENPTY 1 _ACEOF - for ac_header in util.h pty.h + for ac_header in libutil.h util.h pty.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" @@ -16250,7 +16250,7 @@ fi $as_echo "$ac_cv_lib_util_openpty" >&6; } if test "x$ac_cv_lib_util_openpty" = xyes; then : - for ac_header in util.h pty.h + for ac_header in libutil.h util.h pty.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" diff --git a/configure.in b/configure.in index 3342420f1..202040703 100644 --- a/configure.in +++ b/configure.in @@ -2024,9 +2024,9 @@ AC_CHECK_FUNCS(setsid, [], [ AC_CHECK_FUNCS(sysctl getutxid getutid, [break]) -AC_CHECK_FUNCS(openpty, [AC_CHECK_HEADERS(util.h pty.h, [break])], [ +AC_CHECK_FUNCS(openpty, [AC_CHECK_HEADERS(libutil.h util.h pty.h, [break])], [ AC_CHECK_LIB(util, openpty, [ - AC_CHECK_HEADERS(util.h pty.h, [break]) + AC_CHECK_HEADERS(libutil.h util.h pty.h, [break]) SUDO_LIBS="${SUDO_LIBS} -lutil" AC_DEFINE(HAVE_OPENPTY) ], [ diff --git a/get_pty.c b/get_pty.c index 854979428..0ba75b840 100644 --- a/get_pty.c +++ b/get_pty.c @@ -46,7 +46,9 @@ #include #include -#ifdef HAVE_UTIL_H +#if defined(HAVE_LIBUTIL_H) +# include +#elif defined(HAVE_UTIL_H) # include #endif #ifdef HAVE_PTY_H