From: Bruno Haible Date: Sun, 11 Feb 2007 04:42:06 +0000 (+0000) Subject: Avoid too much inlining when testing for the library containing ceil(), sqrt(). X-Git-Tag: v0.17~479 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=52a086e4eaf35ea67eefa85e81de1ca0f87cc000;p=thirdparty%2Fgettext.git Avoid too much inlining when testing for the library containing ceil(), sqrt(). --- diff --git a/gettext-tools/ChangeLog b/gettext-tools/ChangeLog index 75dcf9d54..1e2e55004 100644 --- a/gettext-tools/ChangeLog +++ b/gettext-tools/ChangeLog @@ -1,3 +1,9 @@ +2007-01-10 Bruno Haible + + * configure.ac (MSGMERGE_LIBM): Avoid inlining of the ceil, sqrt calls + on glibc systems. + Reported by I. Thomas Cundiff . + 2006-12-23 Bruno Haible * gnulib-lib/Makefile.am (libgettextlib_la_LINK): New variable. diff --git a/gettext-tools/configure.ac b/gettext-tools/configure.ac index 6ca0f61d6..ead326794 100644 --- a/gettext-tools/configure.ac +++ b/gettext-tools/configure.ac @@ -1,5 +1,5 @@ dnl Configuration for the gettext-tools directory of GNU gettext -dnl Copyright (C) 1995-1999, 2000-2006 Free Software Foundation, Inc. +dnl Copyright (C) 1995-1999, 2000-2007 Free Software Foundation, Inc. dnl dnl This program is free software; you can redistribute it and/or modify dnl it under the terms of the GNU General Public License as published by @@ -111,12 +111,24 @@ dnl Test whether msgmerge must be linked against libm. This is the case on dnl most systems; but BeOS has all functions in libc and doesn't have dnl a libm. MSGMERGE_LIBM=? -AC_TRY_LINK([#include ], [static double x; x = ceil(x); x = sqrt(x);], +AC_TRY_LINK([ + #ifndef __NO_MATH_INLINES + # define __NO_MATH_INLINES 1 /* for glibc */ + #endif + #include + double x;], + [x = ceil(x); x = sqrt(x);], [MSGMERGE_LIBM=]) if test "$MSGMERGE_LIBM" = "?"; then save_LIBS="$LIBS" LIBS="$LIBS -lm" - AC_TRY_LINK([#include ], [static double x; x = ceil(x); x = sqrt(x);], + AC_TRY_LINK([ + #ifndef __NO_MATH_INLINES + # define __NO_MATH_INLINES 1 /* for glibc */ + #endif + #include + double x;], + [x = ceil(x); x = sqrt(x);], [MSGMERGE_LIBM="-lm"]) LIBS="$save_LIBS" fi