You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
1.5 KiB

  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. dnl From Bruno Haible, Marcus Daniels, Sam Steingold.
  9. AC_PREREQ(2.57)
  10. AC_DEFUN([CL_GETTIMEOFDAY],
  11. [AC_BEFORE([$0], [CL_TIMES_CLOCK])
  12. AC_CHECK_FUNCS(gettimeofday)dnl
  13. if test $ac_cv_func_gettimeofday = yes; then
  14. dnl HAVE_GETTIMEOFDAY is defined
  15. CL_PROTO([gettimeofday], [
  16. CL_PROTO_TRY([
  17. #include <sys/types.h>
  18. #include <sys/time.h>
  19. ], [int gettimeofday (struct timeval * tp, struct timezone * tzp);],
  20. [int gettimeofday();],
  21. cl_cv_proto_gettimeofday_dots=no
  22. cl_cv_proto_gettimeofday_arg2="struct timezone *", [
  23. CL_PROTO_TRY([
  24. #include <sys/types.h>
  25. #include <sys/time.h>
  26. ], [int gettimeofday (struct timeval * tp, void * tzp);],
  27. [int gettimeofday();],
  28. cl_cv_proto_gettimeofday_dots=no
  29. cl_cv_proto_gettimeofday_arg2="void *",
  30. cl_cv_proto_gettimeofday_dots=yes
  31. cl_cv_proto_gettimeofday_arg2="...")])
  32. ], [extern int gettimeofday (struct timeval *, $cl_cv_proto_gettimeofday_arg2);])
  33. if test $cl_cv_proto_gettimeofday_dots = yes; then
  34. AC_DEFINE(GETTIMEOFDAY_DOTS,,[declaration of gettimeofday() needs dots])
  35. else
  36. AC_DEFINE_UNQUOTED(GETTIMEOFDAY_TZP_T,$cl_cv_proto_gettimeofday_arg2,[type of `tzp' in gettimeofday() declaration])
  37. fi
  38. fi
  39. ])