--Boundary-00=_Z/WHG+jS5HLmRoj Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline The C99 standard says that isinf and isnan are macros, but reality is more complex. These might be functions in some systems (glibc has even both!) and might require -lm. At the moment we only check whether function exists and in the trunk we don't use -lm for check either. Attached are patches to fix the problem for both KDE3 and KDE4. As a side effect it also fixes detecting (_)finite in KDE4 for platforms where it requires -lm. Patches are tested on Linux and DragonFlyBSD. If noone objects, I will commit tomorrow. PS. The only thing now that makes out of box build fail on DragonFlyBSD is the fact that we use our own copy of libtool which is just very old. Any chance to update it? regards, -- Hasso Tepper KDE Estonian Team --Boundary-00=_Z/WHG+jS5HLmRoj Content-Type: text/x-diff; charset="iso-8859-15"; name="kjs3-isnan-isinf.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="kjs3-isnan-isinf.patch" Index: kjs/configure.in.in =================================================================== --- kjs/configure.in.in (revision 650631) +++ kjs/configure.in.in (working copy) @@ -1,19 +1,43 @@ dnl KDE JavaScript specific configure tests AC_CHECK_HEADERS(ieeefp.h float.h) -AC_CHECK_LIB(m, isinf, [ - AC_DEFINE_UNQUOTED(HAVE_FUNC_ISINF, 1, [Define if you have isinf]) -]) AC_CHECK_LIB(m, finite, [ AC_DEFINE_UNQUOTED(HAVE_FUNC_FINITE, 1, [Define if you have finite]) ]) AC_CHECK_LIB(m, _finite, [ AC_DEFINE_UNQUOTED(HAVE_FUNC__FINITE, 1, [Define if you have _finite]) ]) -AC_CHECK_LIB(m, isnan, [ - AC_DEFINE_UNQUOTED(HAVE_FUNC_ISNAN, 1, [Define if you have isnan]) + +dnl The C99 standard says that isinf and isnan are macros, but they might +dnl be functions on some platforms. +AC_DEFUN([AC_CHECK_ISNAN], +[ + ac_save_libs="$LIBS" + LIBS="-lm" + AC_MSG_CHECKING([for isnan with ]) + AC_TRY_LINK( + [#include ], [float f = 0.0; isnan(f)], + [AC_MSG_RESULT(yes) + AC_DEFINE([HAVE_FUNC_ISNAN], [1], [Define if you have isnan])], + AC_MSG_RESULT(no) + ) ]) +AC_DEFUN([AC_CHECK_ISINF], +[ + ac_save_libs="$LIBS" + LIBS="-lm" + AC_MSG_CHECKING([for isinf with ]) + AC_TRY_LINK( + [#include ], [float f = 0.0; isinf(f)], + [AC_MSG_RESULT(yes) + AC_DEFINE([HAVE_FUNC_ISINF], [1], [Define if you have isinf])], + AC_MSG_RESULT(no) + ) +]) +AC_CHECK_ISNAN +AC_CHECK_ISINF + AC_DEFUN([AC_CHECK_PCREPOSIX], [ dnl define the configure option that disables pcre --Boundary-00=_Z/WHG+jS5HLmRoj Content-Type: text/x-diff; charset="iso-8859-15"; name="kjs4-isnan-isinf.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="kjs4-isnan-isinf.patch" Index: kjs/CMakeLists.txt =================================================================== --- kjs/CMakeLists.txt (revision 652527) +++ kjs/CMakeLists.txt (working copy) @@ -1,3 +1,4 @@ +include(CheckCSourceCompiles) project(kjs) KDE4_NO_ENABLE_FINAL(kjs) @@ -10,12 +11,29 @@ check_include_files(ieeefp.h HAVE_IEEEFP_H) check_include_files("pthread.h;pthread_np.h" HAVE_PTHREAD_NP_H) check_include_files(valgrind/memcheck.h HAVE_MEMCHECK_H) + +set (CMAKE_REQUIRED_LIBRARIES "-lm") check_function_exists(_finite HAVE_FUNC__FINITE) check_function_exists(finite HAVE_FUNC_FINITE) -check_function_exists(isinf HAVE_FUNC_ISINF) -check_function_exists(isnan HAVE_FUNC_ISNAN) +check_c_source_compiles(" + #include + int main(){ + float f = 0.0; + isnan(f); + return 0; + } +" HAVE_FUNC_ISNAN ) +check_c_source_compiles(" + #include + int main(){ + float f = 0.0; + isinf(f); + return 0; + } +" HAVE_FUNC_ISINF ) +set (CMAKE_REQUIRED_LIBRARIES) # reset CMAKE_REQUIRED_LIBRARIES macro_optional_find_package(PCRE) macro_bool_to_01(PCRE_FOUND HAVE_PCREPOSIX) --Boundary-00=_Z/WHG+jS5HLmRoj--