After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 471730 - Darwin fix for libgnomeprint-2.18.1
Darwin fix for libgnomeprint-2.18.1
Status: RESOLVED FIXED
Product: gnome-print
Classification: Deprecated
Component: general
unspecified
Other NetBSD
: Normal normal
: ---
Assigned To: Jody Goldberg
Jody Goldberg
: 396654 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2007-08-30 06:30 UTC by Thomas Klausner
Modified: 2009-04-12 16:26 UTC
See Also:
GNOME target: ---
GNOME version: 2.17/2.18


Attachments
One possible solution for the problem (396 bytes, patch)
2007-08-30 06:31 UTC, Thomas Klausner
none Details | Review
Let AC_CHECK_LIBM do the right thing (524 bytes, patch)
2007-11-03 17:28 UTC, Daniel Macks
none Details | Review

Description Thomas Klausner 2007-08-30 06:30:30 UTC
Patch from tron@NetBSD.org:

Fix broken "configure" script:
It skips the check for the math library on Darwin because the math
functions are included in the system library. It however later aborts
because it didn't find a math library.

Work arround this by not skipping the math library check on Darwin.
The "configure" scripts now finds "/usr/lib/libm.dylib" which is
a symlink to the system library.
Comment 1 Thomas Klausner 2007-08-30 06:31:29 UTC
Created attachment 94603 [details] [review]
One possible solution for the problem
Comment 2 Kjartan Maraas 2007-08-31 07:59:11 UTC
aclocal.m4 is a generated file so this has to be patched somewhere else. configure.in maybe?
Comment 3 Thomas Klausner 2007-08-31 08:24:31 UTC
aclocal.m4 is used together with configure.in to create configure.
aclocal.m4 contains cached copies of autoconf macros.
So basically, it's an upstream problem for the autoconf macro used to create it,
but you can work around it.
Comment 4 Daniel Macks 2007-11-03 17:23:54 UTC
It's a bug in gnome-print: configure.in requires that LIBM (as set by AC_CHECK_LIBM) be non-blank, even though that is the appropriate result on some platforms.

If gnome-print needs certain math functions, it should just check for them. If it's easier to just load "whatever math lib is appropriate for this platform" (via AC_CHECK_LIBM), then it shouldn't try to second-guess that (AC_CHECK_LIBM already bombs if "the libs appropriate for this platform" aren't present).
Comment 5 Daniel Macks 2007-11-03 17:28:12 UTC
Created attachment 98464 [details] [review]
Let AC_CHECK_LIBM do the right thing
Comment 6 Daniel Macks 2007-11-03 21:49:18 UTC
Hrm, AC_CHECK_LIBM actually might silently do nothing if the needed lib isn't present on a platform that needs it. Looks like the check was added in response to Bug #349182, so after using AC_CHECK_LIBM to get "the local math lib flags", configure.in could AC_CHECK_FUNC for some math function that is known to need -lm (fmod() or cos()?) and then fail if the function is still not available.
Comment 7 Kjartan Maraas 2008-01-29 15:40:02 UTC
*** Bug 396654 has been marked as a duplicate of this bug. ***
Comment 8 W. Michael Petullo 2008-05-21 01:51:31 UTC
I just build libgnomeprint 2.18.4 on Mac OS X Tiger using MacPorts 1.6. Can the original bug reporter retest this?
Comment 9 Thomas Klausner 2008-05-22 21:22:17 UTC
I asked the original bug reporter to re-test.
He's currently using Mac OS 10.5.2 (Leopard) and Xcode Tools 3.0. The problem originally appeared with 10.4.x (Tiger) and Xcode Tools 2.4.

The problem is still there.

He further comments that the problem is definitely in the configure script, viz.:
1. In line 23750, LIBM is set to "".
2. In lines 23751 and 23752 the test for the existence of libm on Darwin (Mac OS X) is skipped. LIBM stays empty on these platforms.
3. Then there's the test in line 23956:
if test "x$LIBM" = "x"; then 
    { { echo "$as_me:$LINENO: error: You need -lm(mathematic library)
    for this version of libgnomeprint." >&5
    echo "$as_me: error: You need -lm(mathematic library) for this version of libgnomeprint." >&2;}
    { (exit 1); exit 1; }; }
fi
LIBM is not set because of 1 and 2, so the configure script stops here.
Comment 10 Daniel Macks 2008-05-22 21:27:36 UTC
As I said earlier, it's almost never a good idea to second-guess an autodetection of something. It is *not* true that "You need the -lm(mathematic library"...it's just that you need certain math functions. So test for them, rather than assuming how they will be provided.
Comment 11 Kjartan Maraas 2009-04-12 16:26:54 UTC
The cygwin ports maintainer had a patch to drop the test on platforms that doesn't have libm. This has been commited now.