iscsi-perf: Use gettimeofday if clock_gettime is unavailable

clock_gettime doesn't existing on OS X
(http://stackoverflow.com/questions/5167269/clock-gettime-alternative-in-mac-os-x
) so add an autoconf test to check if the platform has it and fall back
on gettimeofday if not.

Signed-off-by: Sitsofe Wheeler <sitsofe@yahoo.com>
This commit is contained in:
Sitsofe Wheeler
2015-03-01 16:06:38 +00:00
parent 5629afa364
commit 7c6a3e4a0b
3 changed files with 24 additions and 6 deletions

View File

@@ -128,6 +128,9 @@ AC_CHECK_MEMBER([struct CU_SuiteInfo.pSetUpFunc],
#include <CUnit/TestDB.h>
]])
AC_SEARCH_LIBS(clock_gettime, rt, [
AC_DEFINE([HAVE_CLOCK_GETTIME],1,[Define if clock_gettime is available])])
AC_CONFIG_FILES([Makefile]
[lib/Makefile]