source: filezilla/trunk/fuentes/m4/check_time.m4 @ 130

Last change on this file since 130 was 130, checked in by jrpelegrina, 4 years ago

First release to xenial

File size: 1.6 KB
Line 
1dnl We need the threadsafe variants of localtime
2AC_DEFUN([CHECK_THREADSAFE_LOCALTIME],
3[
4  AC_CHECK_FUNCS(localtime_r, [], [
5    AC_MSG_CHECKING([for localtime_s])
6    dnl Checking for localtime_s is a bit more complex as it is a macro
7    AC_LINK_IFELSE([
8      AC_LANG_PROGRAM([[
9       #include <time.h>
10       ]], [[
11         time_t t;
12         struct tm m;
13         localtime_s(&m, &t);
14         return 0;
15      ]])
16    ], [
17      AC_MSG_RESULT([yes])
18      AC_DEFINE([HAVE_LOCALTIME_S], [1], [localtime_s can be used])
19    ], [
20      AC_MSG_RESULT([no])
21      AC_MSG_ERROR([No threadsafe variant of localtime found])
22    ])
23  ])
24])
25
26dnl We need the threadsafe variants of gmtime
27AC_DEFUN([CHECK_THREADSAFE_GMTIME], [
28  AC_CHECK_FUNCS(gmtime_r, [], [
29    AC_MSG_CHECKING([for gmtime_s])
30    dnl Checking for gmtime_s is a bit more complex as it is a macro
31    AC_LINK_IFELSE([
32      AC_LANG_PROGRAM([[
33       #include <time.h>
34       ]], [[
35         time_t t;
36         struct tm m;
37         gmtime_s(&m, &t);
38         return 0;
39      ]])
40    ], [
41      AC_MSG_RESULT([yes])
42      AC_DEFINE([HAVE_GMTIME_S], [1], [gmtime_s can be used])
43    ], [
44      AC_MSG_RESULT([no])
45      AC_MSG_ERROR([No threadsafe variant of gmtime found])
46    ])
47  ])
48])
49
50dnl We need an inverse for gmtime, either timegm or _mkgmtime
51AC_DEFUN([CHECK_INVERSE_GMTIME], [
52  # We need an inverse for gmtime, either timegm or _mkgmtime
53  AC_CHECK_FUNCS(timegm, [], [
54    if ! echo "${WX_CPPFLAGS}" | grep __WXMSW__ > /dev/null 2>&1; then
55      AC_MSG_ERROR([No inverse function for gmtime was found])
56    fi
57  ])
58])
Note: See TracBrowser for help on using the repository browser.