aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorEvgeny Grin (Karlson2k) <k2k@narod.ru>2021-08-29 22:07:13 +0300
committerEvgeny Grin (Karlson2k) <k2k@narod.ru>2021-08-29 22:07:13 +0300
commite544cf36300563fc4ed790b80a80b52669529bbb (patch)
treee72915540a2e8a6ffed09e94fec76fd8d876cb87 /configure.ac
parentcc650acad6f6777b35045c3387a264a6dcc5ffab (diff)
downloadlibmicrohttpd-e544cf36300563fc4ed790b80a80b52669529bbb.tar.gz
libmicrohttpd-e544cf36300563fc4ed790b80a80b52669529bbb.zip
Added fallback functions for MHD_monotonic_msec_counter() values
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac57
1 files changed, 57 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 0cf4e43f..6478b67c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1479,6 +1479,63 @@ AC_LINK_IFELSE(
1479 [AC_MSG_RESULT([[no]]) 1479 [AC_MSG_RESULT([[no]])
1480 ]) 1480 ])
1481 1481
1482AS_VAR_IF([ac_cv_header_time_h], ["yes"],
1483 [
1484 AC_CACHE_CHECK([[for C11 timespec_get()]], [mhd_cv_func_timespec_get],
1485 [
1486 AC_LINK_IFELSE(
1487 [
1488 AC_LANG_PROGRAM(
1489 [[
1490#include <time.h>
1491
1492#ifndef TIME_UTC
1493#error TIME_UTC must be defined to use timespec_get()
1494choke me now
1495#endif
1496 ]],
1497 [[
1498 struct timespec ts;
1499 if (TIME_UTC != timespec_get (&ts, TIME_UTC))
1500 return 1;
1501 ]]
1502 )
1503 ], [[mhd_cv_func_timespec_get="yes"]], [[mhd_cv_func_timespec_get="no"]]
1504 )
1505 ]
1506 )
1507 AS_VAR_IF([mhd_cv_func_timespec_get], ["yes"],
1508 [AC_DEFINE([HAVE_TIMESPEC_GET], [1], [Define to 1 if you have C11 `mhd_cv_func_timespec_get' function and TIME_UTC macro.])]
1509 )
1510 ]
1511)
1512
1513AS_VAR_SET_IF([ac_cv_func_gettimeofday], [mhd_cv_func_gettimeofday="${ac_cv_func_gettimeofday}"])
1514AC_CACHE_CHECK([[for gettimeofday(2)]], [mhd_cv_func_gettimeofday], [
1515 AC_LINK_IFELSE(
1516 [
1517 AC_LANG_PROGRAM(
1518 [[
1519#ifdef HAVE_SYS_TIME_H
1520#include <sys/time.h>
1521#endif /* HAVE_SYS_TIME_H */
1522#ifdef HAVE_TIME_H
1523#include <time.h>
1524#endif /* HAVE_TIME_H */
1525 ]],
1526 [[
1527 struct timeval tv;
1528 if (0 != gettimeofday (&tv, (void*) 0))
1529 return 1;
1530 ]]
1531 )
1532 ], [[mhd_cv_func_gettimeofday="yes"]], [[mhd_cv_func_gettimeofday="no"]]
1533 )
1534])
1535AS_VAR_IF([mhd_cv_func_gettimeofday], ["yes"],
1536 [AC_DEFINE([HAVE_GETTIMEOFDAY], [1], [Define to 1 if you have `gettimeofday' function.])]
1537)
1538
1482# IPv6 1539# IPv6
1483AC_MSG_CHECKING(for IPv6) 1540AC_MSG_CHECKING(for IPv6)
1484AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ 1541AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[