Link with -lrt on Solaris 10
authorRainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
Tue, 20 Jan 2015 09:26:50 +0000 (09:26 +0000)
committerRainer Orth <ro@gcc.gnu.org>
Tue, 20 Jan 2015 09:26:50 +0000 (09:26 +0000)
* configure.ac: Check if sched_yield and/or nanosleep need -lrt.
* configure: Regenerate.
* Makefile.am (go$(EXEEXT), gofmt$(EXEEXT), cgo$(EXEEXT)): Link
with $(LIBS).
* Makefile.in: Regenerate.

From-SVN: r219882

gotools/ChangeLog
gotools/Makefile.am
gotools/Makefile.in
gotools/configure
gotools/configure.ac

index 5746d2c725fce3f096e6dcaf72a2a93e04ec7233..11cb109f5e3d75f49d55ff1f78952642e0cd03f3 100644 (file)
@@ -1,3 +1,11 @@
+2015-01-20  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+
+       * configure.ac: Check if sched_yield and/or nanosleep need -lrt.
+       * configure: Regenerate.
+       * Makefile.am (go$(EXEEXT), gofmt$(EXEEXT), cgo$(EXEEXT)): Link
+       with $(LIBS).
+       * Makefile.in: Regenerate.
+
 2015-01-15  Ian Lance Taylor  <iant@google.com>
 
        * configure.ac: Check for networking libraries; see NET_LIBS.
index 41802efb89177bf1faa0ab4352d4101872badbd8..5e044d29056e94be4725c8f3912dc74acafaf8f8 100644 (file)
@@ -108,11 +108,11 @@ bin_PROGRAMS = go$(EXEEXT) gofmt$(EXEEXT)
 libexecsub_PROGRAMS = cgo$(EXEEXT)
 
 go$(EXEEXT): $(go_cmd_go_files) zdefaultcc.go $(LIBGODEP)
-       $(GOLINK) $(go_cmd_go_files) zdefaultcc.go $(NET_LIBS)
+       $(GOLINK) $(go_cmd_go_files) zdefaultcc.go $(LIBS) $(NET_LIBS)
 gofmt$(EXEEXT): $(go_cmd_gofmt_files) $(LIBGODEP)
-       $(GOLINK) $(go_cmd_gofmt_files) $(NET_LIBS)
+       $(GOLINK) $(go_cmd_gofmt_files) $(LIBS) $(NET_LIBS)
 cgo$(EXEEXT): $(go_cmd_cgo_files) zdefaultcc.go $(LIBGODEP)
-       $(GOLINK) $(go_cmd_cgo_files) zdefaultcc.go $(NET_LIBS)
+       $(GOLINK) $(go_cmd_cgo_files) zdefaultcc.go $(LIBS) $(NET_LIBS)
 
 else
 
index 295c68d984461bae88707d8c0e4108128718f825..8279d9a7dce4bca36cce5d89610ca9d30b09430e 100644 (file)
@@ -590,11 +590,11 @@ s-zdefaultcc: Makefile
        $(STAMP) $@ 
 
 @NATIVE_TRUE@go$(EXEEXT): $(go_cmd_go_files) zdefaultcc.go $(LIBGODEP)
-@NATIVE_TRUE@  $(GOLINK) $(go_cmd_go_files) zdefaultcc.go $(NET_LIBS)
+@NATIVE_TRUE@  $(GOLINK) $(go_cmd_go_files) zdefaultcc.go $(LIBS) $(NET_LIBS)
 @NATIVE_TRUE@gofmt$(EXEEXT): $(go_cmd_gofmt_files) $(LIBGODEP)
-@NATIVE_TRUE@  $(GOLINK) $(go_cmd_gofmt_files) $(NET_LIBS)
+@NATIVE_TRUE@  $(GOLINK) $(go_cmd_gofmt_files) $(LIBS) $(NET_LIBS)
 @NATIVE_TRUE@cgo$(EXEEXT): $(go_cmd_cgo_files) zdefaultcc.go $(LIBGODEP)
-@NATIVE_TRUE@  $(GOLINK) $(go_cmd_cgo_files) zdefaultcc.go $(NET_LIBS)
+@NATIVE_TRUE@  $(GOLINK) $(go_cmd_cgo_files) zdefaultcc.go $(LIBS) $(NET_LIBS)
 
 # For a non-native build we have to build the programs using a
 # previously built host (or build -> host) Go compiler.  We should
index bc9332e1ed2862af638fdc1fa79d18018df23ae3..21be4655a3f66a582a9f26feb04a80e73ad21fbc 100755 (executable)
@@ -3907,6 +3907,119 @@ $as_echo "$gotools_cv_lib_sockets" >&6; }
 NET_LIBS="$gotools_cv_lib_sockets"
 
 
+{ $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 for library containing nanosleep" >&5
+$as_echo_n "checking for library containing nanosleep... " >&6; }
+if test "${ac_cv_search_nanosleep+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 nanosleep ();
+int
+main ()
+{
+return nanosleep ();
+  ;
+  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_nanosleep=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext
+  if test "${ac_cv_search_nanosleep+set}" = set; then :
+  break
+fi
+done
+if test "${ac_cv_search_nanosleep+set}" = set; then :
+
+else
+  ac_cv_search_nanosleep=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_nanosleep" >&5
+$as_echo "$ac_cv_search_nanosleep" >&6; }
+ac_res=$ac_cv_search_nanosleep
+if test "$ac_res" != no; then :
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+
 ac_config_files="$ac_config_files Makefile"
 
 
index 24f4498d27900bfcff38533ee5ded95e7b2e207d..e4528a4f31ee891c00317c90b022b1ccf3dcbf28 100644 (file)
@@ -79,6 +79,10 @@ AC_CACHE_CHECK([for socket libraries], gotools_cv_lib_sockets,
 NET_LIBS="$gotools_cv_lib_sockets"
 AC_SUBST(NET_LIBS)
 
+dnl Test if -lrt is required for sched_yield and/or nanosleep.
+AC_SEARCH_LIBS([sched_yield], [rt])
+AC_SEARCH_LIBS([nanosleep], [rt])
+
 AC_CONFIG_FILES(Makefile)
 
 AC_OUTPUT