aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2011-01-14 19:18:38 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2011-01-14 19:18:38 +0000
commited4ebabc902c38b6d93c8d88405fa38cbb081498 (patch)
treeb06d52ec11eb4a047cce6d629203450c13c1d9c3
parent3ad3790dc05e42b3539ffc8167b1cadd65e5ad7f (diff)
downloadgcc-ed4ebabc902c38b6d93c8d88405fa38cbb081498.zip
gcc-ed4ebabc902c38b6d93c8d88405fa38cbb081498.tar.gz
gcc-ed4ebabc902c38b6d93c8d88405fa38cbb081498.tar.bz2
libgo: Check whether we need -lrt for sched_yield.
From Rainer Orth. From-SVN: r168816
-rw-r--r--libgo/configure57
-rw-r--r--libgo/configure.ac3
2 files changed, 60 insertions, 0 deletions
diff --git a/libgo/configure b/libgo/configure
index 9b8aeaa..edc6c1a 100644
--- a/libgo/configure
+++ b/libgo/configure
@@ -13635,6 +13635,63 @@ fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing sched_yield" >&5
+$as_echo_n "checking for library containing sched_yield... " >&6; }
+if test "${ac_cv_search_sched_yield+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char sched_yield ();
+int
+main ()
+{
+return sched_yield ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' rt; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_sched_yield=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if test "${ac_cv_search_sched_yield+set}" = set; then :
+ break
+fi
+done
+if test "${ac_cv_search_sched_yield+set}" = set; then :
+
+else
+ ac_cv_search_sched_yield=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_sched_yield" >&5
+$as_echo "$ac_cv_search_sched_yield" >&6; }
+ac_res=$ac_cv_search_sched_yield
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5
$as_echo_n "checking whether byte ordering is bigendian... " >&6; }
if test "${ac_cv_c_bigendian+set}" = set; then :
diff --git a/libgo/configure.ac b/libgo/configure.ac
index 7d348dc..3d272ec 100644
--- a/libgo/configure.ac
+++ b/libgo/configure.ac
@@ -274,6 +274,9 @@ PTHREAD_LIBS=
AC_CHECK_LIB([pthread], [pthread_create], PTHREAD_LIBS=-lpthread)
AC_SUBST(PTHREAD_LIBS)
+dnl Test if -lrt is required for sched_yield.
+AC_SEARCH_LIBS([sched_yield], [rt])
+
AC_C_BIGENDIAN
GCC_CHECK_UNWIND_GETIPINFO