Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit ef704ec

Browse files
committed
Test -lrt for sched_yield
Apparently, this is needed in some Solaris versions. Author: Oskari Saarenmaa
1 parent 7dc7218 commit ef704ec

File tree

2 files changed

+59
-0
lines changed

2 files changed

+59
-0
lines changed

configure

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8155,6 +8155,63 @@ if test "$ac_res" != no; then :
81558155

81568156
fi
81578157

8158+
# Required for thread_test.c on Solaris
8159+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing sched_yield" >&5
8160+
$as_echo_n "checking for library containing sched_yield... " >&6; }
8161+
if ${ac_cv_search_sched_yield+:} false; then :
8162+
$as_echo_n "(cached) " >&6
8163+
else
8164+
ac_func_search_save_LIBS=$LIBS
8165+
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8166+
/* end confdefs.h. */
8167+
8168+
/* Override any GCC internal prototype to avoid an error.
8169+
Use char because int might match the return type of a GCC
8170+
builtin and then its argument prototype would still apply. */
8171+
#ifdef __cplusplus
8172+
extern "C"
8173+
#endif
8174+
char sched_yield ();
8175+
int
8176+
main ()
8177+
{
8178+
return sched_yield ();
8179+
;
8180+
return 0;
8181+
}
8182+
_ACEOF
8183+
for ac_lib in '' rt; do
8184+
if test -z "$ac_lib"; then
8185+
ac_res="none required"
8186+
else
8187+
ac_res=-l$ac_lib
8188+
LIBS="-l$ac_lib $ac_func_search_save_LIBS"
8189+
fi
8190+
if ac_fn_c_try_link "$LINENO"; then :
8191+
ac_cv_search_sched_yield=$ac_res
8192+
fi
8193+
rm -f core conftest.err conftest.$ac_objext \
8194+
conftest$ac_exeext
8195+
if ${ac_cv_search_sched_yield+:} false; then :
8196+
break
8197+
fi
8198+
done
8199+
if ${ac_cv_search_sched_yield+:} false; then :
8200+
8201+
else
8202+
ac_cv_search_sched_yield=no
8203+
fi
8204+
rm conftest.$ac_ext
8205+
LIBS=$ac_func_search_save_LIBS
8206+
fi
8207+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_sched_yield" >&5
8208+
$as_echo "$ac_cv_search_sched_yield" >&6; }
8209+
ac_res=$ac_cv_search_sched_yield
8210+
if test "$ac_res" != no; then :
8211+
test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
8212+
8213+
fi
8214+
81588215
# Required for thread_test.c on Solaris 2.5:
81598216
# Other ports use it too (HP-UX) so test unconditionally
81608217
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing gethostbyname_r" >&5

configure.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -929,6 +929,8 @@ AC_SEARCH_LIBS(shm_open, rt)
929929
AC_SEARCH_LIBS(shm_unlink, rt)
930930
# Solaris:
931931
AC_SEARCH_LIBS(fdatasync, [rt posix4])
932+
# Required for thread_test.c on Solaris
933+
AC_SEARCH_LIBS(sched_yield, rt)
932934
# Required for thread_test.c on Solaris 2.5:
933935
# Other ports use it too (HP-UX) so test unconditionally
934936
AC_SEARCH_LIBS(gethostbyname_r, nsl)

0 commit comments

Comments
 (0)