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 150844 - building libxslt 1.1.9 on Solaris
building libxslt 1.1.9 on Solaris
Status: VERIFIED FIXED
Product: libxslt
Classification: Platform
Component: general
1.1.9
Other Solaris
: Normal normal
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2004-08-23 14:42 UTC by Dimitri Papadopoulos
Modified: 2009-08-15 18:40 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
build log (29.41 KB, text/plain)
2004-08-23 14:43 UTC, Dimitri Papadopoulos
Details

Description Dimitri Papadopoulos 2004-08-23 14:42:46 UTC
Hi,

I'm attempting to build libxslt 1.1.9 on Solaris with the Sun ONE Studio 7 compiler.

There's an error caused by a special <nul> character at line 257 of imports.c.
Removing the spurious character fixes the error.

 cc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -I../libxslt
-I/usr/local/libxml2/include/libxml2 -O -c imports.c  -KPIC -DPIC -o .libs/imports.o
"imports.c", line 257: null character in input
cc: acomp failed for imports.c


Then there are the usual warnings you may want fo fix or
work around:

 cc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -I../libxslt
-I/usr/local/libxml2/include/libxml2 -O -c xslt.c  -KPIC -DPIC -o .libs/xslt.o
"xslt.c", line 1907: warning: argument #1 is incompatible with prototype:
	prototype: pointer to const char : "/usr/include/iso/string_iso.h", line 72
	argument : pointer to const unsigned char


 cc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -I../libxslt -I../libexslt -I..
-I../libxslt -I../libexslt -I/usr/local/libxml2/include/libxml2 -O
-I/usr/local/libgcrypt/include -I/usr/local/libgpg-error/include -O -c date.c 
-KPIC -DPIC -o .libs/date.o
"date.c", line 762: warning: implicit function declaration: localtime_r


The second warning isn't caused by a missing header. It's just that Sun export
old APIs by default, for compatibility reasons. To enable newer APIs and use
recent additions such as "localtime_r" one must define some macros. In this case
you should define one of __EXTENSIONS__, _REENTRANT or _POSIX_C_SOURCE. I'm not
sure which one is better. From /usr/include/time.h:

#if	defined(__EXTENSIONS__) || defined(_REENTRANT) || \
	    (_POSIX_C_SOURCE - 0 >= 199506L)
extern struct tm *gmtime_r(const time_t *, struct tm *);
extern struct tm *localtime_r(const time_t *, struct tm *);
#endif	/* defined(__EXTENSIONS__) || defined(_REENTRANT) .. */
Comment 1 Dimitri Papadopoulos 2004-08-23 14:43:59 UTC
Created attachment 30858 [details]
build log
Comment 2 Daniel Veillard 2004-08-23 14:54:12 UTC
Don't know how that ^@ entered that C file <grin/>, the cast is easy to fix
too. Now for the localtime_r we already tried to fix this already ! See
date.c module start, I have no idea why there is an S missing to the macro
and if it ever worked in the past, could you double-check ?

---------------------------------------------

/* needed to get localtime_r on Solaris */
#ifdef sun
#ifndef __EXTENSION__
#define __EXTENSION__
#endif
#endif
                                                                                
#ifdef HAVE_TIME_H
#include <time.h>
#endif
-----------------------------------------------------

Daniel
Comment 3 Dimitri Papadopoulos 2004-08-23 15:54:53 UTC
It's definitely __EXTENSIONS__ with S, not __EXTENSION__. It can't have worked
in the past. I guess I hadn't tested the patch as posted here:
http://bugzilla.gnome.org/show_bug.cgi?id=140468
Instead I had probably tested my own modified code. Sorry.

By the way it's probably better to change 
#ifdef sun
to
#ifdef __sun
That's more ISO-C-ish.
Comment 4 Daniel Veillard 2004-08-23 17:38:05 UTC
Okidoc, all this is commited,

 thanks !

Daniel
Comment 5 Daniel Veillard 2004-09-30 12:08:10 UTC
  The release of libxslt-1.1.11 should fix this,
                                                                                
   thanks,
                                                                                
Daniel