summaryrefslogtreecommitdiff
path: root/gotools
diff options
context:
space:
mode:
authorro <ro@138bc75d-0d04-0410-961f-82ee72b054a4>2015-01-20 09:26:50 +0000
committerro <ro@138bc75d-0d04-0410-961f-82ee72b054a4>2015-01-20 09:26:50 +0000
commitb7450aac6c74faeba41e585ec092292482041003 (patch)
tree7cb07f2082bc60ac9f1a160134c2c066b0fc993e /gotools
parent703d60ea5161e01d15dd20970251078d17adf2bf (diff)
Link with -lrt on Solaris 10
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@219882 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gotools')
-rw-r--r--gotools/ChangeLog8
-rw-r--r--gotools/Makefile.am6
-rw-r--r--gotools/Makefile.in6
-rwxr-xr-xgotools/configure113
-rw-r--r--gotools/configure.ac4
5 files changed, 131 insertions, 6 deletions
diff --git a/gotools/ChangeLog b/gotools/ChangeLog
index 5746d2c725fc..11cb109f5e3d 100644
--- a/gotools/ChangeLog
+++ b/gotools/ChangeLog
@@ -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.
diff --git a/gotools/Makefile.am b/gotools/Makefile.am
index 41802efb8917..5e044d29056e 100644
--- a/gotools/Makefile.am
+++ b/gotools/Makefile.am
@@ -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
diff --git a/gotools/Makefile.in b/gotools/Makefile.in
index 295c68d98446..8279d9a7dce4 100644
--- a/gotools/Makefile.in
+++ b/gotools/Makefile.in
@@ -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
diff --git a/gotools/configure b/gotools/configure
index bc9332e1ed28..21be4655a3f6 100755
--- a/gotools/configure
+++ b/gotools/configure
@@ -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"
diff --git a/gotools/configure.ac b/gotools/configure.ac
index 24f4498d2790..e4528a4f31ee 100644
--- a/gotools/configure.ac
+++ b/gotools/configure.ac
@@ -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