I think we need to test the compiler version.
Something like this should work (warning, untested):

%define cc_is_ss11 %(cc -V 2>&1 | egrep -s 'Sun C 5\.8' && echo 1 || echo 0)
%define cc_is_ss12 %(cc -V 2>&1 | egrep -s 'Sun C 5\.9' && echo 1 || echo 0)

And then use %if %cc_is_ss11 and %if %cc_is_ss12 to define the correct
flags for the compiler.  If someone feels like fixing arch64.inc,
I'm happy to review it (:

Thanks,
Laca

On Sat, 2007-12-15 at 14:04 +0100, Petr Sobotka wrote:
> Hello,
> 
> looks like arch64.inc which is delivered in SFE is a bit out-dated.
> 
> %ifarch i386
> %define suncc_optflags64           -i %_cc64_opt_level -xstrconst
> -xarch=generic64 -Kpic -xregs=no%%frameptr
> %define suncc_cxx_optflags64       -i %_cxx64_opt_level
> -xarch=generic64 -Kpic -pentium -mr -norunpath -xregs=no%%frameptr
> %endif
> 
> -xarch=generic64 is deprecated - it should be -xarch=m64
> 
> It makes problems in SFEsdl-ttf.spec, which didn't compile with
> -xarch=generic64.
> It fails at configure script.
> 
> If I change it to m64, it compiles well.
> 
> I'm not sure if I can modify it  to m64 and don't break compilation
> with older compilers ...
> Otherwise we need some marco to check which version of sun studio is
> used and then
> set CFLAGS for it.
> 
> The problem was in ss12 delivered by sxce77...
> 
> bash-3.2$ /opt/SUNWspro/bin/cc -V
> cc: Sun C 5.9 SunOS_i386 Build47_dlight 2007/05/22
> 
> Petr Sobotka
> _______________________________________________
> desktop-discuss mailing list
> desktop-discuss at opensolaris.org


Reply via email to