浏览代码

Add check for sched_yield in librt

In Solaris, sched_yield lives in librt, rather than libc. This patch adds a
check which will link in librt if necessary.
William Orr 11 年之前
父节点
当前提交
38b8494647
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      configure.ac

+ 3 - 0
configure.ac

@@ -139,6 +139,9 @@ AM_CONDITIONAL([USE_EXTERNAL_PROTOC], [test "$with_protoc" != "no"])
 ACX_PTHREAD
 AC_CXX_STL_HASH
 
+# Need to link against rt on Solaris
+AC_SEARCH_LIBS([sched_yield], [rt], [], [AC_MSG_FAILURE([sched_yield was not found on your system])])
+
 # HACK:  Make gtest's configure script pick up our copy of CFLAGS and CXXFLAGS,
 #   since the flags added by ACX_CHECK_SUNCC must be used when compiling gtest
 #   too.