From: Alvaro Herrera Date: Tue, 30 Jun 2015 17:20:38 +0000 (-0300) Subject: Test -lrt for sched_yield X-Git-Tag: REL9_5_ALPHA2~160 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ab93f90cd3a4fcdd891cee9478941c3cc65795b8;p=postgresql Test -lrt for sched_yield Apparently, this is needed in some Solaris versions. Author: Oskari Saarenmaa --- diff --git a/configure b/configure index c417bc7654..d8f21563f6 100755 --- a/configure +++ b/configure @@ -8227,6 +8227,63 @@ if test "$ac_res" != no; then : fi +# Required for thread_test.c on Solaris +{ $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 ${ac_cv_search_sched_yield+:} false; 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 ${ac_cv_search_sched_yield+:} false; then : + break +fi +done +if ${ac_cv_search_sched_yield+:} false; 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 + # Required for thread_test.c on Solaris 2.5: # Other ports use it too (HP-UX) so test unconditionally { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing gethostbyname_r" >&5 diff --git a/configure.in b/configure.in index 5ef6eda06f..21ba3a52f9 100644 --- a/configure.in +++ b/configure.in @@ -974,6 +974,8 @@ AC_SEARCH_LIBS(shm_open, rt) AC_SEARCH_LIBS(shm_unlink, rt) # Solaris: AC_SEARCH_LIBS(fdatasync, [rt posix4]) +# Required for thread_test.c on Solaris +AC_SEARCH_LIBS(sched_yield, rt) # Required for thread_test.c on Solaris 2.5: # Other ports use it too (HP-UX) so test unconditionally AC_SEARCH_LIBS(gethostbyname_r, nsl)