fiddle2 entry

< previous [home] next >

Date: 2007-09-06 20:54:44 (Author: trav)
Link: http://travis.kroh.net/archives/004953.php

Compiling gettext on some systems (0.15 as well as 0.16 did it for me, it probably goes back further) seems to fail for some people, giving a "undefined reference to `ceil'" error. This error is discussed on on the bug-gnu-utils mailing list as well as here. make all-am make[4]: Entering directory `/usr/local/src/gettext-0.16/gettext-tools/src' /bin/sh ../libtool --tag=CC --mode=link gcc -fopenmp -g -O2 -o msgmerge msgmerge-msgmerge.o msgmerge-msgl-fsearch.o msgmerge-plural-count.o libgettextsrc.la -fopenmp gcc -fopenmp -g -O2 -o .libs/msgmerge msgmerge-msgmerge.o msgmerge-msgl-fsearch.o msgmerge-plural-count.o -fopenmp ./.libs/libgettextsrc.so /usr/local/src/gettext-0.16/gettext-tools/gnulib-lib/.libs/libgettextlib.so -lc msgmerge-msgl-fsearch.o(.text+0x15c): In function `message_fuzzy_index_search': /usr/local/src/gettext-0.16/gettext-tools/src/msgl-fsearch.c:589: undefined reference to `ceil' collect2: ld returned 1 exit status make[4]: *** [msgmerge] Error 1 make[4]: Leaving directory `/usr/local/src/gettext-0.16/gettext-tools/src' make[3]: *** [all] Error 2 make[3]: Leaving directory `/usr/local/src/gettext-0.16/gettext-tools/src' make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory `/usr/local/src/gettext-0.16/gettext-tools' make[1]: *** [all] Error 2 make[1]: Leaving directory `/usr/local/src/gettext-0.16/gettext-tools' make: *** [all-recursive] Error 1

I worked around the problem by editing config.status and setting MSGMERGE_LIBM to "-lm", but Bruno later offered a less hackish solution: (diff follows)
2007-01-10 Bruno Haible <brunoØclisp.org> * configure.ac (MSGMERGE_LIBM): Avoid inlining of the ceil, sqrt calls on glibc systems. Reported by I. Thomas Cundiff <tcundiffØeclipse.net>. *** gettext-tools/configure.ac 12 Dec 2006 14:12:18 -0000 1.87 --- gettext-tools/configure.ac 11 Feb 2007 04:42:06 -0000 1.88 *************** *** 111,122 **** dnl most systems; but BeOS has all <math.h> functions in libc and doesn't have dnl a libm. MSGMERGE_LIBM=? ! AC_TRY_LINK([#include <math.h>], [static 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 <math.h>], [static double x; x = ceil(x); x = sqrt(x);], [MSGMERGE_LIBM="-lm"]) LIBS="$save_LIBS" fi --- 111,134 ---- dnl most systems; but BeOS has all <math.h> functions in libc and doesn't have dnl a libm. MSGMERGE_LIBM=? ! AC_TRY_LINK([ ! #ifndef __NO_MATH_INLINES ! # define __NO_MATH_INLINES 1 /* for glibc */ ! #endif ! #include >math.h> ! double x;], ! [x = ceil(x); x = sqrt(x);], [MSGMERGE_LIBM=]) if test "$MSGMERGE_LIBM" = "?"; then save_LIBS="$LIBS" LIBS="$LIBS -lm" ! AC_TRY_LINK([ ! #ifndef __NO_MATH_INLINES ! # define __NO_MATH_INLINES 1 /* for glibc */ ! #endif ! #include <math.h> ! double x;], ! [x = ceil(x); x = sqrt(x);], [MSGMERGE_LIBM="-lm"]) LIBS="$save_LIBS" fi Hope it helps. Good luck.

 

[ home - archives - quoteboard - blogger decoder - wishlist ]

Creative Commons License This work is licensed under a Creative Commons License.