cpp: Deal with systems without sched_get_priority_{min,max} (OpenBSD)

Also make a few tweaks to configure.ac:
- Check for clock_gettime in librt since it seems to be more
  widely available.
- Make it clear which AC_CHECK_FUNCS are optional.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@776927 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/configure.ac b/configure.ac
index 8fd63d5..2c53ca0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -131,7 +131,12 @@
 AC_CHECK_HEADERS([malloc.h])
 
 AC_CHECK_LIB(pthread, pthread_create)
-AC_CHECK_LIB(rt, sched_get_priority_min)
+dnl NOTE(dreiss): I haven't been able to find any really solid docs
+dnl on what librt is and how it fits into various Unix systems.
+dnl My best guess is that it is where glibc stashes its implementation
+dnl of the POSIX Real-Time Extensions.  This seems necessary on Linux,
+dnl and we haven't yet found a system where this is a problem.
+AC_CHECK_LIB(rt, clock_gettime)
 
 AC_TYPE_INT16_T
 AC_TYPE_INT32_T
@@ -170,7 +175,6 @@
 AC_FUNC_VPRINTF
 AC_CHECK_FUNCS([strtoul])
 AC_CHECK_FUNCS([bzero])
-AC_CHECK_FUNCS([clock_gettime])
 AC_CHECK_FUNCS([ftruncate])
 AC_CHECK_FUNCS([gethostbyname])
 AC_CHECK_FUNCS([gettimeofday])
@@ -186,6 +190,10 @@
 AC_CHECK_FUNCS([strstr])
 AC_CHECK_FUNCS([strtol])
 AC_CHECK_FUNCS([sqrt])
+dnl The following functions are optional.
+AC_CHECK_FUNCS([clock_gettime])
+AC_CHECK_FUNCS([sched_get_priority_min])
+AC_CHECK_FUNCS([sched_get_priority_max])
 
 AX_SIGNED_RIGHT_SHIFT