qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 1/2] build: check if libm is needed in configure
@ 2012-02-20 12:11 Roger Pau Monne
  2012-02-20 12:11 ` [Qemu-devel] [PATCH 2/2] build: replace librt check function Roger Pau Monne
  0 siblings, 1 reply; 7+ messages in thread
From: Roger Pau Monne @ 2012-02-20 12:11 UTC (permalink / raw)
  To: xen-devel, qemu-devel; +Cc: Roger Pau Monne

Remove the hardcoded use of libm and instead rely on configure to
check for it. It is needed at least for qemu-ga and qemu-system.

Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>
---
 Makefile.target |    4 ----
 configure       |   14 ++++++++++++++
 2 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/Makefile.target b/Makefile.target
index a111521..1bfd419 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -33,10 +33,6 @@ endif
 PROGS=$(QEMU_PROG)
 STPFILES=
 
-ifndef CONFIG_HAIKU
-LIBS+=-lm
-endif
-
 config-target.h: config-target.h-timestamp
 config-target.h-timestamp: config-target.mak
 
diff --git a/configure b/configure
index b113f60..7bcd547 100755
--- a/configure
+++ b/configure
@@ -2447,6 +2447,20 @@ elif compile_prog "" "-lrt" ; then
   LIBS="-lrt $LIBS"
 fi
 
+##########################################
+# Do we need libm
+cat > $TMPC <<EOF
+#include <math.h>
+int main(void) { double a, b; return modf(a, &b);}
+EOF
+
+if compile_prog "" "" ; then
+  :
+elif compile_prog "" "-lm" ; then
+  LIBS="-lm $LIBS"
+  libs_qga="-lm $libs_qga"
+fi
+
 if test "$darwin" != "yes" -a "$mingw32" != "yes" -a "$solaris" != yes -a \
         "$aix" != "yes" -a "$haiku" != "yes" ; then
     libs_softmmu="-lutil $libs_softmmu"
-- 
1.7.9

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2012-02-27 12:43 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-20 12:11 [Qemu-devel] [PATCH 1/2] build: check if libm is needed in configure Roger Pau Monne
2012-02-20 12:11 ` [Qemu-devel] [PATCH 2/2] build: replace librt check function Roger Pau Monne
2012-02-22 19:25   ` Anthony Liguori
2012-02-23 13:34     ` Roger Pau Monné
2012-02-27  9:52       ` [Qemu-devel] [Xen-devel] " Ian Campbell
2012-02-27 10:07         ` Roger Pau Monné
2012-02-27 12:49         ` Stefano Stabellini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).