~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to m4/pandora_clock_gettime.m4

Fixed the clock_gettime test.

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
#--------------------------------------------------------------------
9
9
 
10
10
AC_DEFUN([PANDORA_CLOCK_GETTIME],[
11
 
  AC_CACHE_CHECK([for working clock_gettime],[ac_cv_have_clock_gettime],[
12
 
    AC_COMPILE_IFELSE([
13
 
      AC_LANG_PROGRAM([[
14
 
#if TIME_WITH_SYS_TIME
15
 
# include <sys/time.h>
16
 
# include <time.h>
17
 
#else
18
 
# if HAVE_SYS_TIME_H
19
 
#  include <sys/time.h>
20
 
# else
21
 
#  include <time.h>
22
 
# endif
23
 
#endif
24
 
      ]],[[
25
 
  struct timespec tp;
26
 
  int ret= clock_gettime(CLOCK_REALTIME, &tp);
27
 
    ]])],[
28
 
      ac_cv_have_clock_gettime=yes
29
 
    ],[
30
 
      ac_cv_have_clock_gettime=no
31
 
    ])
32
 
  ])
33
 
  AS_IF([test "x${ac_cv_have_clock_gettime}" = xyes],[
 
11
  AC_SEARCH_LIBS([clock_gettime],[rt])
 
12
  AS_IF([test "x${ac_cv_search_clock_gettime}" != "xno"],[
34
13
    AC_DEFINE([HAVE_CLOCK_GETTIME],[1],[Have a working clock_gettime function])
35
14
  ])
36
15
])