From 0b321028e4e0939ea8c4d39fa53bc34b19bc14c8 Mon Sep 17 00:00:00 2001 From: file Date: Mon, 15 Dec 2008 17:43:59 +0000 Subject: Use autoconf logic to determine whether the system has timersub or not. Do not blindly assume Solaris does not. (closes issue #13838) Reported by: ano git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@164343 f38db490-d61c-443f-a65b-d21fe96a405b --- configure.ac | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 44fff243e..1db2519ec 100644 --- a/configure.ac +++ b/configure.ac @@ -267,6 +267,15 @@ AC_FUNC_UTIME_NULL AC_FUNC_VPRINTF AC_CHECK_FUNCS([asprintf atexit bzero dup2 endpwent floor ftruncate getcwd gethostbyname gethostname getloadavg gettimeofday inet_ntoa isascii localtime_r memchr memmove memset mkdir munmap pow putenv re_comp regcomp rint select setenv socket sqrt strcasecmp strcasestr strchr strcspn strdup strerror strlcat strlcpy strncasecmp strndup strnlen strrchr strsep strspn strstr strtol strtoq unsetenv utime vasprintf ioperm]) +AC_MSG_CHECKING(for timersub in time.h) +AC_LINK_IFELSE( + AC_LANG_PROGRAM([#include ], + [struct timeval *zombies; timersub(zombies, zombies, zombies);]), + AC_MSG_RESULT(yes) + AC_DEFINE([HAVE_TIMERSUB], 1, [Define to 1 if your system has timersub in time.h]), + AC_MSG_RESULT(no) +) + # some systems already have gethostbyname_r so we don't need to build ours in main/utils.c AC_SEARCH_LIBS(gethostbyname_r, [socket nsl]) -- cgit v1.2.3