gperftools/m4/acx_nanosleep.m4
csilvers edd03a831f Wed Mar 11 11:25:34 2009 Google Inc. <opensource@google.com>
* google-perftools: version 1.1 release
	* Dynamically resize thread caches -- nice perf. improvement (kash)
	* Add VDSO support to give better stacktraces in linux (ppluzhnikov)
	* Improve heap-profiling sampling algorithm (ford)
	* Rewrite leak-checking code: should be faster and more robust (sanjay)
	* Use ps2 instead of ps for dot: better page cropping for gv (csilvers)
	* Disable malloc-failure warning messages by default (csilvers)
	* Update config/Makefile to disable tests on a per-OS basis (csilvers)
	* PORTING: Get perftools compiling under MSVC 7.1 again (csilvers)
	* PORTING: Get perftools compiling under cygwin again (csilvers)
	* PORTING: automatically set library flags for solaris x86 (csilvers)
	* Add TCMALLOC_SKIP_SBRK to mirror TCMALLOC_SKIP_MMAP (csilvers)
	* Add --enable flags to allow selective building (csilvers)
	* Put addr2line-pdb and nm-pdb in proper output directory (csilvers)
	* Remove deprecated DisableChecksIn (sanjay)
	* DOCUMENTATION: Document most MallocExtension routines (csilvers)


git-svn-id: http://gperftools.googlecode.com/svn/trunk@66 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
2009-03-11 20:50:03 +00:00

36 lines
1.1 KiB
Plaintext

# Check for support for nanosleep. It's defined in <time.h>, but on
# some systems, such as solaris, you need to link in a library to use it.
# We set acx_nanosleep_ok if nanosleep is supported; in that case,
# NANOSLEEP_LIBS is set to whatever libraries are needed to support
# nanosleep.
AC_DEFUN([ACX_NANOSLEEP],
[AC_MSG_CHECKING(if nanosleep requires any libraries)
AC_LANG_SAVE
AC_LANG_C
acx_nanosleep_ok="no"
NANOSLEEP_LIBS=
# For most folks, this should just work
AC_TRY_LINK([#include <time.h>],
[static struct timespec ts; nanosleep(&ts, NULL);],
[acx_nanosleep_ok=yes])
# For solaris, we may need -lrt
if test "x$acx_nanosleep_ok" != "xyes"; then
OLD_LIBS="$LIBS"
LIBS="-lrt $LIBS"
AC_TRY_LINK([#include <time.h>],
[static struct timespec ts; nanosleep(&ts, NULL);],
[acx_nanosleep_ok=yes])
if test "x$acx_nanosleep_ok" = "xyes"; then
NANOSLEEP_LIBS="-lrt"
fi
LIBS="$OLD_LIBS"
fi
if test "x$acx_nanosleep_ok" != "xyes"; then
AC_MSG_ERROR([cannot find the nanosleep function])
else
AC_MSG_RESULT(${NANOSLEEP_LIBS:-no})
fi
AC_LANG_RESTORE
])