diff options
author | jb <jb@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-01-31 20:52:00 +0000 |
---|---|---|
committer | jb <jb@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-01-31 20:52:00 +0000 |
commit | a2c0dc0f1141b57c2bbd2c6ce8ca6f4bed3f2b00 (patch) | |
tree | 218eeedfb68b9af80b02714d695e24e0effb0fbc /libgfortran/configure.ac | |
parent | f58707cd85257fb6095cd0bceed1882f348f78d0 (diff) | |
download | gcc-a2c0dc0f1141b57c2bbd2c6ce8ca6f4bed3f2b00.tar.gz |
Use clock_gettime in libgfortran timing intrinsics, cleanup
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@169449 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran/configure.ac')
-rw-r--r-- | libgfortran/configure.ac | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/libgfortran/configure.ac b/libgfortran/configure.ac index e8f842cf7f8..ed1e2cc31a1 100644 --- a/libgfortran/configure.ac +++ b/libgfortran/configure.ac @@ -252,6 +252,7 @@ AC_CHECK_FUNCS(sleep time ttyname signal alarm ctime clock access fork execl) AC_CHECK_FUNCS(wait setmode execvp pipe dup2 close fdopen strcasestr getrlimit) AC_CHECK_FUNCS(gettimeofday stat fstat lstat getpwuid vsnprintf dup getcwd) AC_CHECK_FUNCS(localtime_r gmtime_r strerror_r getpwuid_r ttyname_r ctime_r) +AC_CHECK_FUNCS(clock_gettime) # Check for glibc backtrace functions AC_CHECK_FUNCS(backtrace backtrace_symbols) @@ -483,6 +484,16 @@ LIBGFOR_CHECK_FLOAT128 # Check for GNU libc feenableexcept AC_CHECK_LIB([m],[feenableexcept],[have_feenableexcept=yes AC_DEFINE([HAVE_FEENABLEEXCEPT],[1],[libm includes feenableexcept])]) +# At least for glibc, clock_gettime is in librt. But don't pull that +# in if it still doesn't give us the function we want. +# This test is copied from libgomp. +if test $ac_cv_func_clock_gettime = no; then + AC_CHECK_LIB(rt, clock_gettime, + [LIBS="-lrt $LIBS" + AC_DEFINE(HAVE_CLOCK_GETTIME, 1, + [Define to 1 if you have the `clock_gettime' function.])]) +fi + # Check for SysV fpsetmask LIBGFOR_CHECK_FPSETMASK |