diff options
-rw-r--r-- | libgo/Makefile.am | 4 | ||||
-rw-r--r-- | libgo/Makefile.in | 7 | ||||
-rw-r--r-- | libgo/configure | 48 | ||||
-rw-r--r-- | libgo/configure.ac | 5 | ||||
-rw-r--r-- | libgo/testsuite/Makefile.in | 1 |
5 files changed, 58 insertions, 7 deletions
diff --git a/libgo/Makefile.am b/libgo/Makefile.am index d73af0d7a79..506486285d0 100644 --- a/libgo/Makefile.am +++ b/libgo/Makefile.am @@ -1267,7 +1267,7 @@ libgo_go_objs = \ libgo_la_SOURCES = $(runtime_files) -libgo_la_LIBADD = $(libgo_go_objs) $(LIBFFI) $(PTHREAD_LIBS) +libgo_la_LIBADD = $(libgo_go_objs) $(LIBFFI) $(PTHREAD_LIBS) $(MATH_LIBS) libgobegin_a_SOURCES = \ runtime/go-main.c @@ -1283,7 +1283,7 @@ LTGOCOMPILE = $(LIBTOOL) --tag GO --mode=compile $(GOC) $(INCLUDES) \ GOLINK = $(LIBTOOL) --tag GO --mode-link $(GOC) \ $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_GOCFLAGS) $(LTLDFLAGS) \ - $(PTHREAD_LIBS) -o $@ + $(PTHREAD_LIBS) $(MATH_LIBS) -o $@ # Build a package. BUILDARCHIVE = \ diff --git a/libgo/Makefile.in b/libgo/Makefile.in index b2c6a75a2cc..3e527376bf5 100644 --- a/libgo/Makefile.in +++ b/libgo/Makefile.in @@ -121,7 +121,7 @@ libgobegin_a_OBJECTS = $(am_libgobegin_a_OBJECTS) LTLIBRARIES = $(toolexeclib_LTLIBRARIES) am__DEPENDENCIES_1 = libgo_la_DEPENDENCIES = $(libgo_go_objs) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am__libgo_la_SOURCES_DIST = runtime/go-append.c runtime/go-assert.c \ runtime/go-assert-interface.c \ runtime/go-byte-array-to-string.c runtime/go-breakpoint.c \ @@ -325,6 +325,7 @@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ +MATH_LIBS = @MATH_LIBS@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ @@ -1564,7 +1565,7 @@ libgo_go_objs = \ testing/libscript.la libgo_la_SOURCES = $(runtime_files) -libgo_la_LIBADD = $(libgo_go_objs) $(LIBFFI) $(PTHREAD_LIBS) +libgo_la_LIBADD = $(libgo_go_objs) $(LIBFFI) $(PTHREAD_LIBS) $(MATH_LIBS) libgobegin_a_SOURCES = \ runtime/go-main.c @@ -1576,7 +1577,7 @@ LTGOCOMPILE = $(LIBTOOL) --tag GO --mode=compile $(GOC) $(INCLUDES) \ GOLINK = $(LIBTOOL) --tag GO --mode-link $(GOC) \ $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_GOCFLAGS) $(LTLDFLAGS) \ - $(PTHREAD_LIBS) -o $@ + $(PTHREAD_LIBS) $(MATH_LIBS) -o $@ # Build a package. diff --git a/libgo/configure b/libgo/configure index b8d7e573184..cef86b2a1ee 100644 --- a/libgo/configure +++ b/libgo/configure @@ -607,6 +607,7 @@ HAVE_SYS_MMAN_H_FALSE HAVE_SYS_MMAN_H_TRUE PTHREAD_LIBS PTHREAD_CFLAGS +MATH_LIBS USING_SPLIT_STACK_FALSE USING_SPLIT_STACK_TRUE SPLIT_STACK @@ -10868,7 +10869,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 10871 "configure" +#line 10872 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -10974,7 +10975,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 10977 "configure" +#line 10978 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -13328,6 +13329,49 @@ $as_echo "#define LINKER_SUPPORTS_SPLIT_STACK 1" >>confdefs.h fi +MATH_LIBS= +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sqrt in -lm" >&5 +$as_echo_n "checking for sqrt in -lm... " >&6; } +if test "${ac_cv_lib_m_sqrt+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lm $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 sqrt (); +int +main () +{ +return sqrt (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_m_sqrt=yes +else + ac_cv_lib_m_sqrt=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_sqrt" >&5 +$as_echo "$ac_cv_lib_m_sqrt" >&6; } +if test "x$ac_cv_lib_m_sqrt" = x""yes; then : + MATH_LIBS=-lm +fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -pthread is supported" >&5 $as_echo_n "checking whether -pthread is supported... " >&6; } if test "${ac_cv_libgo_pthread_supported+set}" = set; then : diff --git a/libgo/configure.ac b/libgo/configure.ac index db7497415c0..d2cc290fdaf 100644 --- a/libgo/configure.ac +++ b/libgo/configure.ac @@ -187,6 +187,11 @@ if test "$ac_cv_libgo_linker_supports_split_stack" = yes; then [Define if the linker support split stack adjustments]) fi +dnl Test for the -lm library. +MATH_LIBS= +AC_CHECK_LIB([m], [sqrt], MATH_LIBS=-lm) +AC_SUBST(MATH_LIBS) + dnl Test whether the compiler supports the -pthread option. AC_CACHE_CHECK([whether -pthread is supported], [ac_cv_libgo_pthread_supported], diff --git a/libgo/testsuite/Makefile.in b/libgo/testsuite/Makefile.in index e1dfbe8c3c2..113df3b6abe 100644 --- a/libgo/testsuite/Makefile.in +++ b/libgo/testsuite/Makefile.in @@ -101,6 +101,7 @@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ +MATH_LIBS = @MATH_LIBS@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ |