GNOME Bugzilla – Bug 150844
building libxslt 1.1.9 on Solaris
Last modified: 2009-08-15 18:40:50 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) .. */
Created attachment 30858 [details] build log
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
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.
Okidoc, all this is commited, thanks ! Daniel
The release of libxslt-1.1.11 should fix this, thanks, Daniel