From: Damjan Jovanovic Subject: [2/3] configure.ac: fix libm detection on Haiku Message-Id: Date: Fri, 22 Jul 2011 05:20:52 +0200 Changelog: * configure.ac: fix libm detection on Haiku Avoids using "-lm" as a linker flag in configure, because that causes compilation to fail for some configure tests, causing duplicate definition of isinf() and isnan() which later breaks compilation of Wine code. Also stores the LIBM for use by winegcc in the next patch. Damjan Jovanovic From 9a3f63281e8f22f2d4ff3b7cc36aef5e836d79da Mon Sep 17 00:00:00 2001 From: Damjan Jovanovic Date: Fri, 22 Jul 2011 05:11:04 +0200 Subject: [PATCH 2/3] configure.ac: fix libm detection on Haiku --- configure.ac | 29 +++++++++++++++++++++-------- 1 files changed, 21 insertions(+), 8 deletions(-) diff --git a/configure.ac b/configure.ac index 0290cb5..8352c21 100644 --- a/configure.ac +++ b/configure.ac @@ -899,6 +899,19 @@ then fi fi +dnl **** Check for libm **** + +ac_save_LIBS="$LIBS" +AC_SEARCH_LIBS(sin,m) +WINE_ERROR_WITH(m,[test "$ac_cv_search_sin" = "no"],[libm ${notice_platform}development files not found. +Wine cannot compile without libm.]) +if test "$ac_cv_search_sin" != "none required" +then + AC_SUBST(LIBM,"$ac_cv_search_sin") +fi +AC_DEFINE_UNQUOTED(LIBM,"$LIBM","") +LIBS="$ac_save_LIBS" + dnl **** Check for pthread **** if test "$ac_cv_header_pthread_h" = "yes" @@ -1094,11 +1107,11 @@ This probably prevents linking to OpenGL. Try deleting the file and restarting c else opengl_msg="No OpenGL library found on this system." fi], - $X_LIBS $XLIB -lm $X_EXTRA_LIBS -dylib_file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib)], - $X_LIBS $XLIB -lm $X_EXTRA_LIBS) + $X_LIBS $XLIB $LIBM $X_EXTRA_LIBS -dylib_file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib)], + $X_LIBS $XLIB $LIBM $X_EXTRA_LIBS) if test "$ac_cv_header_GL_glu_h" = "yes" then - WINE_CHECK_SONAME(GLU,gluLookAt,,,[$OPENGL_LIBS $X_LIBS $X_PRE_LIBS $XLIB -lm $X_EXTRA_LIBS]) + WINE_CHECK_SONAME(GLU,gluLookAt,,,[$OPENGL_LIBS $X_LIBS $X_PRE_LIBS $XLIB $LIBM $X_EXTRA_LIBS]) fi WINE_NOTICE_WITH(glu,[test "x$ac_cv_lib_soname_GLU" = "x"], [libGLU ${notice_platform}development files not found, GLU won't be supported.]) @@ -1582,10 +1595,10 @@ WINE_WARNING_WITH(jpeg,[test "x$ac_cv_lib_soname_jpeg" = "x"], dnl **** Check for libpng **** if test "$ac_cv_header_png_h" = "yes" then - WINE_CHECK_SONAME(png,png_create_read_struct,,,-lm -lz,[[libpng[[0-9]]*]]) + WINE_CHECK_SONAME(png,png_create_read_struct,,,$LIBM -lz,[[libpng[[0-9]]*]]) AC_CHECK_LIB(png,png_set_expand_gray_1_2_4_to_8, [AC_DEFINE(HAVE_PNG_SET_EXPAND_GRAY_1_2_4_TO_8,1,[Define to 1 if libpng has the png_set_expand_gray_1_2_4_to_8 function.])] - ,,-lm -lz) + ,,$LIBM -lz) elif test -n "$X_CFLAGS" -a "x$with_png" != "xno" then dnl libpng is in the X directory on Mac OS X @@ -1597,9 +1610,9 @@ then if test "$ac_cv_header_png_h" = "yes" then AC_SUBST(PNGINCL,"$X_CFLAGS") - WINE_CHECK_SONAME(png,png_create_read_struct,,,[$X_LIBS -lm -lz],[[libpng[[0-9]]*]]) + WINE_CHECK_SONAME(png,png_create_read_struct,,,[$X_LIBS $LIBM -lz],[[libpng[[0-9]]*]]) AC_CHECK_LIB(png,png_set_expand_gray_1_2_4_to_8, - [AC_DEFINE(HAVE_PNG_SET_EXPAND_GRAY_1_2_4_TO_8,1)],,[$X_LIBS -lm -lz]) + [AC_DEFINE(HAVE_PNG_SET_EXPAND_GRAY_1_2_4_TO_8,1)],,[$X_LIBS $LIBM -lz]) fi fi WINE_WARNING_WITH(png,[test "x$ac_cv_lib_soname_png" = "x"], @@ -2286,7 +2299,7 @@ fi dnl Check for isinf ac_save_LIBS="$LIBS" -LIBS="$LIBS -lm" +LIBS="$LIBS $LIBM" AC_CACHE_CHECK([for isinf], ac_cv_have_isinf, AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], [[float f = 0.0; return isinf(f)]])],[ac_cv_have_isinf="yes"],[ac_cv_have_isinf="no"])) if test "$ac_cv_have_isinf" = "yes" -- 1.7.4.1