root/trunk/m4/strftime.m4

Revision 1147 (checked in by pvanhoof, 2 years ago)

Build environment improvements

Line 
1 AC_DEFUN([AC_TNY_STRFTIME_CHECK],
2 [
3
4
5 dnl Check to see if strftime supports the use of %l and %k
6
7 AC_MSG_CHECKING(for %l and %k support in strftime)
8 AC_RUN_IFELSE([AC_LANG_SOURCE([[
9 #include <string.h>
10 #include <time.h>
11
12 int main(int argc, char **argv)
13 {
14         char buf[10];
15         time_t rawtime;
16         struct tm *timeinfo;
17
18         time(&rawtime);
19         timeinfo=localtime(&rawtime);
20         buf[0] = '\0';
21         strftime(buf, 10, "%lx%k", timeinfo);
22
23         if (buf[0] == '\0' || buf[0] == 'x' || strstr(buf, "l") || strstr(buf, "k"))
24                 exit(1);
25         else
26                 exit(0);
27 }]])],[
28 AC_DEFINE(HAVE_LKSTRFTIME, 1, [strftime supports use of l and k])
29 ac_cv_lkstrftime=yes
30 ],[ac_cv_lkstrftime=no],[ac_cv_lkstrftime=no])
31 AC_MSG_RESULT($ac_cv_lkstrftime)
32
33
34 ])
Note: See TracBrowser for help on using the browser.