diff options
author | Mike Frysinger <vapier@gentoo.org> | 2011-10-19 21:28:27 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2011-10-19 21:28:27 +0000 |
commit | 4399a56be2e20b4a0862c6d67cf20a497571ac9d (patch) | |
tree | ac14ddec2889375d8e3fab152f08ac30ffb428c5 /sim/lm32 | |
parent | f05e2e1de66ff08f7551de7bb8e1411540c9fffa (diff) | |
download | gdb-4399a56be2e20b4a0862c6d67cf20a497571ac9d.zip gdb-4399a56be2e20b4a0862c6d67cf20a497571ac9d.tar.gz gdb-4399a56be2e20b4a0862c6d67cf20a497571ac9d.tar.bz2 |
sim: dv-cfi: check for log2 support in libm when enabled
The dv-cfi model uses log2() internally, so make sure we automatically
link in libm when required.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'sim/lm32')
-rwxr-xr-x | sim/lm32/ChangeLog | 4 | ||||
-rwxr-xr-x | sim/lm32/configure | 48 |
2 files changed, 52 insertions, 0 deletions
diff --git a/sim/lm32/ChangeLog b/sim/lm32/ChangeLog index 1dd5e64..d7e561c 100755 --- a/sim/lm32/ChangeLog +++ b/sim/lm32/ChangeLog @@ -1,3 +1,7 @@ +2011-10-19 Mike Frysinger <vapier@gentoo.org> + + * configure: Regenerate after common/acinclude.m4 update. + 2011-10-17 Mike Frysinger <vapier@gentoo.org> * configure.ac: Change include to common/acinclude.m4. diff --git a/sim/lm32/configure b/sim/lm32/configure index d4f6045..54a5c5a 100755 --- a/sim/lm32/configure +++ b/sim/lm32/configure @@ -5003,6 +5003,54 @@ if test x"$silent" != x"yes"; then fi fi +case " $hardware " in + *" cfi "*) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for log2 in -lm" >&5 +$as_echo_n "checking for log2 in -lm... " >&6; } +if test "${ac_cv_lib_m_log2+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 log2 (); +int +main () +{ +return log2 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_m_log2=yes +else + ac_cv_lib_m_log2=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_log2" >&5 +$as_echo "$ac_cv_lib_m_log2" >&6; } +if test "x$ac_cv_lib_m_log2" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBM 1 +_ACEOF + + LIBS="-lm $LIBS" + +fi +;; +esac + ac_sources="$sim_link_files" |