Subject: Re: x11/kdelibs3 compile problems on Solaris
To: None <pkgsrc-users@netbsd.org>
From: Dominique Laigle <dlaigle@gmail.com>
List: pkgsrc-users
Date: 11/18/2006 19:36:18
Raymond Meyer <raymond.meyer <at> rambler.ru> writes:

> 
> Hi, I'm building x11/kdelibs3 with GCC-4.1.1 on Sparc Solaris. Could anyone who
> knows C++ suggest how to fix the following error:
> 
> operations.cpp: In function 'bool KJS::isInf(double)':
> operations.cpp:70: error: 'isinf' was not declared in this scope
> operations.cpp: In function 'bool KJS::isPosInf(double)':
> operations.cpp:83: error: 'isinf' was not declared in this scope
> operations.cpp: In function 'bool KJS::isNegInf(double)':
> operations.cpp:96: error: 'isinf' was not declared in this scope
> gmake[3]: *** [operations.lo] Error 1
> gmake[3]: Leaving directory
`/opt/pkg.obj/x11/kdelibs3/work.e450/kdelibs-3.5.4/kjs'
> gmake[2]: *** [all] Error 2
> gmake[2]: Leaving directory
`/opt/pkg.obj/x11/kdelibs3/work.e450/kdelibs-3.5.4/kjs'
> gmake[1]: *** [all-recursive] Error 1
> gmake[1]: Leaving directory `/opt/pkg.obj/x11/kdelibs3/work.e450/kdelibs-3.5.4'
> gmake: *** [all] Error 2
> *** Error code 2
> 
> Stop.
> bmake: stopped in /opt/pkgsrc/x11/kdelibs3
> 
> 

On nevada_49 using G++ from the CoolTools (gcc 4.0.2 from gccfss) I could work
around the issue by writing the following code right before the line "use
namespace KJS" in operation.cpp :

extern "C" {
#define	INFINITY	(__builtin_inff())
#define	isinf(x)	__extension__( \
			{ __typeof(x) __x_i = (x); \
			__x_i == (__typeof(__x_i)) INFINITY || \
			__x_i == (__typeof(__x_i)) (-INFINITY); })
}

These definitions should normally be included with "math_c99.h"...

- Dom