GNOME Bugzilla – Bug 332173
Adjustments for libexslt/date.c necessary on IBM AIX
Last modified: 2007-08-23 09:48:46 UTC
Please describe the problem: In order for libexslt to compile correctly on IBM AIX, a small patch has to be applied to libexslt/date.c. Steps to reproduce: 1. Configure e.g. with 'CC=/usr/local/bin/gcc ./configure --disable-static --without-python'. 2. Run make, e.g. with '/opt/freeware/bin/make'. 3. Watch the error message. :-) Actual results: I get the following error message: /../ /usr/local/bin/gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -I../libxslt -I../libexslt -I.. -I../libxslt -I../libexslt -I/usr/local/include/libxml2 -g -O2 -Wall -g -O2 -Wall -MT date.lo -MD -MP -MF .deps/date.Tpo -c date.c -DPIC -o .libs/date.o In file included from /usr/local/include/libxml2/libxml/parser.h:796, from /usr/local/include/libxml2/libxml/globals.h:18, from /usr/local/include/libxml2/libxml/threads.h:35, from /usr/local/include/libxml2/libxml/xmlmemory.h:216, from /usr/local/include/libxml2/libxml/tree.h:1150, from date.c:35: /usr/local/include/libxml2/libxml/encoding.h:136: error: parse error before "iconv_t" /usr/local/include/libxml2/libxml/encoding.h:136: warning: no semicolon at end of struct or union /usr/local/include/libxml2/libxml/encoding.h:137: warning: type defaults to `int' in declaration of `iconv_out' /usr/local/include/libxml2/libxml/encoding.h:137: warning: data definition has no type or storage class date.c: In function `exsltDateCurrent': date.c:764: warning: implicit declaration of function `localtime_r' date.c:783: warning: implicit declaration of function `gmtime_r' make[2]: *** [date.lo] Error 1 make[2]: Leaving directory `/usr/local/src/libxslt-1.1.15-bug/libexslt' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/usr/local/src/libxslt-1.1.15-bug' make: *** [all] Error 2 root@spinus:/usr/local/src/libxslt-1.1.15-bug# Expected results: No error message. Does this happen every time? Yes. Other information: To resolve the bug, patch libexslt/date.c with the following diff (generated using diff -c): ---8<--- cut here --- *** date.c.ORIGINAL Mon Nov 8 16:35:03 2004 --- date.c Wed Feb 22 10:41:47 2006 *************** *** 29,35 **** --- 29,37 ---- #endif #if HAVE_LOCALTIME_R /* _POSIX_SOURCE required by gnu libc */ + #ifndef _AIX51 /* but on AIX we're not using gnu libc */ #define _POSIX_SOURCE + #endif #endif #include <libxml/tree.h> --->8--- cut here --- The patch was originally made by IBM, available at: ftp://ftp.software.ibm.com/aix/freeSoftware/aixtoolbox/PATCHES/libxslt-date.patch I wanted to submit it so that it has the chance of making it into future libxslt releases. (IBM has applied this patch to their RPM version of libxslt, libxslt-1.1.5, but I needed to compile a newer version, som came across this.)
Created attachment 59931 [details] [review] Diff file for libexslt/date.c
This is still true (for 1.1.20). Attaching patch for 1.1.20.
Created attachment 84896 [details] [review] Diff file for libexslt/date.c (libxslt 1.1.20)
Okay, makes sense, applied and commited to SVN, thanks ! Daniel