]> www.ginac.de Git - cln.git/blob - m4/gettimeofday.m4
Enable modifying operators by default.
[cln.git] / m4 / gettimeofday.m4
1 dnl -*- Autoconf -*-
2 dnl Copyright (C) 1993-2003, 2006 Free Software Foundation, Inc.
3 dnl This file is free software, distributed under the terms of the GNU
4 dnl General Public License.  As a special exception to the GNU General
5 dnl Public License, this file may be distributed as part of a program
6 dnl that contains a configuration script generated by Autoconf, under
7 dnl the same distribution terms as the rest of that program.
8
9 dnl From Bruno Haible, Marcus Daniels, Sam Steingold.
10
11 AC_PREREQ(2.57)
12
13 AC_DEFUN([CL_GETTIMEOFDAY],
14 [AC_BEFORE([$0], [CL_TIMES_CLOCK])
15 AC_CHECK_FUNCS(gettimeofday)dnl
16 if test $ac_cv_func_gettimeofday = yes; then
17 dnl HAVE_GETTIMEOFDAY is defined
18 CL_PROTO([gettimeofday], [
19 CL_PROTO_TRY([
20 #include <sys/types.h>
21 #include <sys/time.h>
22 ], [int gettimeofday (struct timeval * tp, struct timezone * tzp);],
23 [int gettimeofday();],
24 cl_cv_proto_gettimeofday_dots=no
25 cl_cv_proto_gettimeofday_arg2="struct timezone *", [
26 CL_PROTO_TRY([
27 #include <sys/types.h>
28 #include <sys/time.h>
29 ], [int gettimeofday (struct timeval * tp, void * tzp);],
30 [int gettimeofday();],
31 cl_cv_proto_gettimeofday_dots=no
32 cl_cv_proto_gettimeofday_arg2="void *",
33 cl_cv_proto_gettimeofday_dots=yes
34 cl_cv_proto_gettimeofday_arg2="...")])
35 ], [extern int gettimeofday (struct timeval *, $cl_cv_proto_gettimeofday_arg2);])
36 if test $cl_cv_proto_gettimeofday_dots = yes; then
37 AC_DEFINE(GETTIMEOFDAY_DOTS,,[declaration of gettimeofday() needs dots])
38 else
39 AC_DEFINE_UNQUOTED(GETTIMEOFDAY_TZP_T,$cl_cv_proto_gettimeofday_arg2,[type of `tzp' in gettimeofday() declaration])
40 fi
41 fi
42 ])