From: fanquake Date: Wed, 16 Jun 2021 07:29:30 +0000 (+0800) Subject: build: test ac_cv_header_sys_time_h once, reformat timer* macro checks X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7ab3a06adacd71918d92b8dca2ff76116a187e0c;p=libevent build: test ac_cv_header_sys_time_h once, reformat timer* macro checks --- diff --git a/configure.ac b/configure.ac index 07709568..a68672be 100644 --- a/configure.ac +++ b/configure.ac @@ -208,59 +208,47 @@ if test "x$ac_cv_header_sys_queue_h" = "xyes"; then ) fi +dnl if we have sys/time.h, check for timer* macros if test "x$ac_cv_header_sys_time_h" = "xyes"; then - AC_MSG_CHECKING(for timeradd in sys/time.h) - AC_EGREP_CPP(yes, -[ -#include -#ifdef timeradd - yes -#endif -], [ AC_DEFINE(HAVE_TIMERADD, 1, - [Define if timeradd is defined in ]) - AC_MSG_RESULT(yes)] ,AC_MSG_RESULT(no) + +AC_MSG_CHECKING(for timeradd in sys/time.h) +AC_EGREP_CPP(yes, [ + #include + #ifdef timeradd + yes + #endif], + [AC_MSG_RESULT(yes); AC_DEFINE(HAVE_TIMERADD, 1, [Define if timeradd is defined in ])], + [AC_MSG_RESULT(no)] ) -fi -if test "x$ac_cv_header_sys_time_h" = "xyes"; then - AC_MSG_CHECKING(for timercmp in sys/time.h) - AC_EGREP_CPP(yes, -[ -#include -#ifdef timercmp - yes -#endif -], [ AC_DEFINE(HAVE_TIMERCMP, 1, - [Define if timercmp is defined in ]) - AC_MSG_RESULT(yes)] ,AC_MSG_RESULT(no) +AC_MSG_CHECKING(for timercmp in sys/time.h) +AC_EGREP_CPP(yes, [ + #include + #ifdef timercmp + yes + #endif], + [AC_MSG_RESULT(yes); AC_DEFINE(HAVE_TIMERCMP, 1,[Define if timercmp is defined in ])], + [AC_MSG_RESULT(no)] ) -fi -if test "x$ac_cv_header_sys_time_h" = "xyes"; then - AC_MSG_CHECKING(for timerclear in sys/time.h) - AC_EGREP_CPP(yes, -[ -#include -#ifdef timerclear - yes -#endif -], [ AC_DEFINE(HAVE_TIMERCLEAR, 1, - [Define if timerclear is defined in ]) - AC_MSG_RESULT(yes)] ,AC_MSG_RESULT(no) +AC_MSG_CHECKING(for timerclear in sys/time.h) +AC_EGREP_CPP(yes, [ + #include + #ifdef timerclear + yes + #endif], + [AC_MSG_RESULT(yes); AC_DEFINE(HAVE_TIMERCLEAR, 1, [Define if timerclear is defined in ])], + [AC_MSG_RESULT(no)] ) -fi -if test "x$ac_cv_header_sys_time_h" = "xyes"; then - AC_MSG_CHECKING(for timerisset in sys/time.h) - AC_EGREP_CPP(yes, -[ -#include -#ifdef timerisset - yes -#endif -], [ AC_DEFINE(HAVE_TIMERISSET, 1, - [Define if timerisset is defined in ]) - AC_MSG_RESULT(yes)] ,AC_MSG_RESULT(no) +AC_MSG_CHECKING(for timerisset in sys/time.h) +AC_EGREP_CPP(yes, [ + #include + #ifdef timerisset + yes + #endif], + [AC_MSG_RESULT(yes); AC_DEFINE(HAVE_TIMERISSET, 1, [Define if timerisset is defined in ])], + [AC_MSG_RESULT(no)] ) fi