@@ -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
@@ -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"
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(-)