summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2006-01-19 08:31:08 +0000
committerReid Spencer <rspencer@reidspencer.com>2006-01-19 08:31:08 +0000
commit3484a99ba1ecddd221c9c77b321d66edb456a7fc (patch)
tree647c9f24ae3f997fe98c8085da83c7c675ed2fb0
parentf4bb9b1fa76564704a4ab6c27d5d72180b493e9a (diff)
downloadllvm-3484a99ba1ecddd221c9c77b321d66edb456a7fc.tar.gz
llvm-3484a99ba1ecddd221c9c77b321d66edb456a7fc.tar.bz2
llvm-3484a99ba1ecddd221c9c77b321d66edb456a7fc.tar.xz
Make sure that libm is used during config tests so that ceil, floor, and
friends are actually detected. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25454 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--autoconf/configure.ac2
-rwxr-xr-xconfigure73
-rw-r--r--include/llvm/Config/config.h.in3
3 files changed, 77 insertions, 1 deletions
diff --git a/autoconf/configure.ac b/autoconf/configure.ac
index 1ccef0ad97..2573f7ee2d 100644
--- a/autoconf/configure.ac
+++ b/autoconf/configure.ac
@@ -450,7 +450,7 @@ dnl===-----------------------------------------------------------------------===
dnl libelf is for sparc only; we can ignore it if we don't have it
AC_CHECK_LIB(elf, elf_begin)
-
+AC_CHECK_LIB(m,sin)
dnl lt_dlopen may be required for plugin support.
AC_SEARCH_LIBS(lt_dlopen,ltdl,AC_DEFINE([HAVE_LT_DLOPEN],[1],
diff --git a/configure b/configure
index 9daf472f1b..05d9b125a0 100755
--- a/configure
+++ b/configure
@@ -24981,6 +24981,79 @@ _ACEOF
fi
+echo "$as_me:$LINENO: checking for sin in -lm" >&5
+echo $ECHO_N "checking for sin in -lm... $ECHO_C" >&6
+if test "${ac_cv_lib_m_sin+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char sin ();
+int
+main ()
+{
+sin ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_m_sin=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_m_sin=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_m_sin" >&5
+echo "${ECHO_T}$ac_cv_lib_m_sin" >&6
+if test $ac_cv_lib_m_sin = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBM 1
+_ACEOF
+
+ LIBS="-lm $LIBS"
+
+fi
+
echo "$as_me:$LINENO: checking for library containing lt_dlopen" >&5
echo $ECHO_N "checking for library containing lt_dlopen... $ECHO_C" >&6
diff --git a/include/llvm/Config/config.h.in b/include/llvm/Config/config.h.in
index 2166163f48..92cdaaa1f7 100644
--- a/include/llvm/Config/config.h.in
+++ b/include/llvm/Config/config.h.in
@@ -172,6 +172,9 @@
/* Define to 1 if you have the `elf' library (-lelf). */
#undef HAVE_LIBELF
+/* Define to 1 if you have the `m' library (-lm). */
+#undef HAVE_LIBM
+
/* Define to 1 if you have the `pthread' library (-lpthread). */
#undef HAVE_LIBPTHREAD