From 9884923a9cbcd9d69e0758951ec3f6a34d436edb Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Fri, 3 Dec 2004 18:48:07 +0000 Subject: [PATCH] Add TIME_WITH_SYS_TIME_H --- config.h.in | 12 ++++----- configure | 73 ++++++++++++++++++++++++++++++++++++++++++++++++++-- configure.in | 9 +++++-- 3 files changed, 84 insertions(+), 10 deletions(-) diff --git a/config.h.in b/config.h.in index be7c2109a..796b7e727 100644 --- a/config.h.in +++ b/config.h.in @@ -88,7 +88,7 @@ /* Define to 1 if you have the `dispcrypt' function. */ #undef HAVE_DISPCRYPT -/* [Define to 1 if your glob.h defines the GLOB_BRACE and GLOB_TILDE flags. */ +/* Define to 1 if your glob.h defines the GLOB_BRACE and GLOB_TILDE flags. */ #undef HAVE_EXTENDED_GLOB /* Define to 1 if you have the `flock' function. */ @@ -251,9 +251,6 @@ /* Define to 1 if you use SecurID for authentication. */ #undef HAVE_SECURID -/* Define to 1 if you have the `seteuid' function. */ -#undef HAVE_SETEUID - /* Define to 1 if you have the `setproctitle' function. */ #undef HAVE_SETPROCTITLE @@ -371,8 +368,8 @@ /* Define to 1 if you have struct timespec in sys/time.h */ #undef HAVE_TIMESPEC -/* Define to 1 if you have a timespecsub macro or function that takes - two arguments (not three) */ +/* Define to 1 if you have a timespecsub macro or function that takes two + arguments (not three) */ #undef HAVE_TIMESPECSUB2 /* Define to 1 if you have the `tzset' function. */ @@ -513,6 +510,9 @@ /* The number of minutes before sudo asks for a password again. */ #undef TIMEOUT +/* Define to 1 if you can safely include both and . */ +#undef TIME_WITH_SYS_TIME + /* The number of tries a user gets to enter their password. */ #undef TRIES_FOR_PASSWORD diff --git a/configure b/configure index f9bfca621..1c597e0d1 100755 --- a/configure +++ b/configure @@ -24101,6 +24101,71 @@ fi fi +echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5 +echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6 +if test "${ac_cv_header_time+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include + +int +main () +{ +if ((struct tm *) 0) +return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_header_time=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_header_time=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5 +echo "${ECHO_T}$ac_cv_header_time" >&6 +if test $ac_cv_header_time = yes; then + +cat >>confdefs.h <<\_ACEOF +#define TIME_WITH_SYS_TIME 1 +_ACEOF + +fi + @@ -25034,8 +25099,12 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include -#include -#include +#if TIME_WITH_SYS_TIME +# include +# include +#else +# include +#endif int main () diff --git a/configure.in b/configure.in index 8337bf653..d393a526d 100644 --- a/configure.in +++ b/configure.in @@ -1627,6 +1627,7 @@ dnl Header file checks dnl AC_HEADER_STDC AC_HEADER_DIRENT +AC_HEADER_TIME AC_CHECK_HEADERS(malloc.h paths.h utime.h netgroup.h sys/sockio.h sys/bsdtypes.h sys/select.h) dnl ultrix termio/termios are broken if test "$OS" != "ultrix"; then @@ -1653,8 +1654,12 @@ AC_CHECK_TYPES([sig_atomic_t], , [AC_DEFINE(sig_atomic_t, int)], [#include #include ]) AC_CHECK_TYPE([struct timespec], [AC_DEFINE(HAVE_TIMESPEC)], , [#include -#include -#include ]) +#if TIME_WITH_SYS_TIME +# include +# include +#else +# include +#endif]) SUDO_TYPE_SIZE_T SUDO_TYPE_SSIZE_T SUDO_TYPE_DEV_T -- 2.40.0