Re: [xslt] Patch for xsl:sort lang support



Roumen Petrov wrote:

Daniel Veillard wrote:
On Tue, Jun 10, 2008 at 02:05:12AM +0200, Nick Wellnhofer wrote:
Roumen Petrov wrote:
Nick Wellnhofer wrote:
Roumen Petrov wrote:
Please find patch that is first attempt to avoid build problem after recent commits related to xsltlocale.

I'm not convinced that xsltlocale.c is correct for msvcrt:
The manuals show that rfc3066 language tags are supported but the current code ignore all of them.
I took the language codes from here:
http://msdn.microsoft.com/en-us/library/39cwe7zf(VS.80).aspx
10x. I see that the _create_locale is related to setlocale.
Yes, _create_locale accepts the same parameters as setocale.

On this page http://msdn.microsoft.com/en-us/library/ms776260(VS.85).aspx
is listed another information but for other functions.
May be win32 locale has to be based on this.
No, the CRT functions don't seem to accept those language codes.

Also I think that _create_locale is missing before msvcrt80. The proposed patch don't resolve this in makefile based win32 build.
You're right, it seems it was introduced with VC8. Maybe it would be best to have a configure switch to disable locale support in case you want a build that runs without msvcr80.dll?
In the proposed patch configure will try detect presence of _create_locale if don't exist header xlocale.h , but not in makefile based build ( win32/Makefile.msvc ). May a new makefile win32/Makefile.msvcXX can ersolve problem.
Your patch looks good. See the attached version (also against current trunk) that additionally moves the defines to libxslt/xsltconfig.h and adds a switch to win32/configure.js.

I only wonder which setup uses GNU make and MSVCRT.

I wonder why the implementation assume that if exist xlocale.h the charmap is ascii.
Which charmap do you mean?
EBCDIC
I didn't think about that. Maybe one should add an appropriate #ifdef somewhere...

  Okay I applied and commited this patch which seems to integrate ideas
from both of you (i.e. i assume it superseeds Roumen's own libxslt-trunk-20080608.patch , right ?)
yes, it is fine with me (only code review).
(sorry for late reply but I'm too busy with other task and i don't have time to test).

  Is there anything still pending on this ?

I'm thinking about more backward compatible w32 implementation since the current require msvcrt80.
The xlocale based sort works fine.
But the related bug can be closed.

Daniel

Roumen


A)
I finish builds in mingw cross-compilation environment.
If build is from SVN all is ok, but from snapshot it fail (see attached file libxslt-snapshot-20080612-mingw-failure).

The reason is that my builddir differ from source.
Configure scrip create following header files in build tree:
./libxslt/xsltwin32config.h
./libxslt/xsltconfig.h
./config.h
./libexslt/exsltconfig.h
Also snapshot include following files in source tree:
./libxslt/xsltconfig.h
./libexslt/exsltconfig.h

Lets see attached file: libxslt-snapshot-20080612.patch .
Syntax for include statement is with " as result is included file from source directory. The default include search path if gnu automake is used is : current directory, source directory, top build directory.

If is possible tarball don't include ./libxslt/xsltconfig.h and ./libexslt/exsltconfig.h ?
We may put them into nodist_XXX_HEADERS in respective makefile.
As I understand win32/configure.js create them too.


B) xsltlocale.h is in xsltinc_HEADERS.
Is this file for internal use only ?


C) When I post update for xlocale check in cross-compilation case I propose to assume that xlocale don't work on host platform. Now this look to me unfriendly. What about to assume that xlocale work ?


Roumen
if /bin/sh ../libtool --mode=compile --tag=CC i386-mingw32msvc-gcc -DHAVE_CONFIG_H -I. -I<ROOT>/libxslt-snapshot-20080612/libxslt -I.. -I<ROOT>/libxslt-snapshot-20080612 -I<ROOT>/libxslt-snapshot-20080612/libxslt -I/opt/mingw/include/libxml2 -I/opt/mingw/include  -I/opt/mingw/include  -O2 -fno-strict-aliasing -Wall -Wall -MT attrvt.lo -MD -MP -MF ".deps/attrvt.Tpo" -c -o attrvt.lo <ROOT>/libxslt-snapshot-20080612/libxslt/attrvt.c; \
	then mv -f ".deps/attrvt.Tpo" ".deps/attrvt.Plo"; else rm -f ".deps/attrvt.Tpo"; exit 1; fi
 i386-mingw32msvc-gcc -DHAVE_CONFIG_H -I. -I<ROOT>/libxslt-snapshot-20080612/libxslt -I.. -I<ROOT>/libxslt-snapshot-20080612 -I<ROOT>/libxslt-snapshot-20080612/libxslt -I/opt/mingw/include/libxml2 -I/opt/mingw/include -I/opt/mingw/include -O2 -fno-strict-aliasing -Wall -Wall -MT attrvt.lo -MD -MP -MF .deps/attrvt.Tpo -c <ROOT>/libxslt-snapshot-20080612/libxslt/attrvt.c  -DDLL_EXPORT -DPIC -o .libs/attrvt.o
In file included from <ROOT>/libxslt-snapshot-20080612/libxslt/xsltInternals.h:24,
                 from <ROOT>/libxslt-snapshot-20080612/libxslt/xsltutils.h:23,
                 from <ROOT>/libxslt-snapshot-20080612/libxslt/attrvt.c:26:
<ROOT>/libxslt-snapshot-20080612/libxslt/xsltlocale.h:19:21: xlocale.h: No such file or directory
In file included from <ROOT>/libxslt-snapshot-20080612/libxslt/xsltInternals.h:24,
                 from <ROOT>/libxslt-snapshot-20080612/libxslt/xsltutils.h:23,
                 from <ROOT>/libxslt-snapshot-20080612/libxslt/attrvt.c:26:
<ROOT>/libxslt-snapshot-20080612/libxslt/xsltlocale.h:24: error: syntax error before "xsltLocale"
<ROOT>/libxslt-snapshot-20080612/libxslt/xsltlocale.h:24: warning: type defaults to `int' in declaration of `xsltLocale'
<ROOT>/libxslt-snapshot-20080612/libxslt/xsltlocale.h:24: warning: data definition has no type or storage class
<ROOT>/libxslt-snapshot-20080612/libxslt/xsltlocale.h:46: error: syntax error before "xsltNewLocale"
<ROOT>/libxslt-snapshot-20080612/libxslt/xsltlocale.h:46: warning: type defaults to `int' in declaration of `xsltNewLocale'
<ROOT>/libxslt-snapshot-20080612/libxslt/xsltlocale.h:46: warning: data definition has no type or storage class
<ROOT>/libxslt-snapshot-20080612/libxslt/xsltlocale.h:47: error: syntax error before "locale"
<ROOT>/libxslt-snapshot-20080612/libxslt/xsltlocale.h:48: error: syntax error before "locale"
In file included from <ROOT>/libxslt-snapshot-20080612/libxslt/xsltutils.h:23,
                 from <ROOT>/libxslt-snapshot-20080612/libxslt/attrvt.c:26:
<ROOT>/libxslt-snapshot-20080612/libxslt/xsltInternals.h:1386: error: syntax error before "xsltLocale"
<ROOT>/libxslt-snapshot-20080612/libxslt/xsltInternals.h:1386: warning: no semicolon at end of struct or union
<ROOT>/libxslt-snapshot-20080612/libxslt/xsltInternals.h:1418: error: syntax error before '}' token
make: *** [attrvt.lo] Error 1
--- ./libxslt/libxslt.h.ORIG	2007-01-12 10:55:39.000000000 +0200
+++ ./libxslt/libxslt.h	2008-06-12 23:31:15.000000000 +0300
@@ -16,7 +16,7 @@
 #include "config.h"
 #endif
 
-#include "xsltconfig.h"
+#include <libxslt/xsltconfig.h>
 #include <libxml/xmlversion.h>
 
 #if !defined LIBXSLT_PUBLIC
--- ./libexslt/libexslt.h.ORIG	2007-01-12 10:55:39.000000000 +0200
+++ ./libexslt/libexslt.h	2008-06-12 23:36:40.000000000 +0300
@@ -15,7 +15,7 @@
 #include "config.h"
 #endif
 
-#include "xsltconfig.h"
+#include <libxslt/xsltconfig.h>
 #include <libxml/xmlversion.h>
 
 #if !defined LIBEXSLT_PUBLIC
--- ./libexslt/exslt.h.ORIG	2007-01-12 10:55:39.000000000 +0200
+++ ./libexslt/exslt.h	2008-06-12 23:39:24.000000000 +0300
@@ -4,7 +4,7 @@
 
 #include <libxml/tree.h>
 #include "exsltexports.h"
-#include "exsltconfig.h"
+#include <libexslt/exsltconfig.h>
 
 #ifdef __cplusplus
 extern "C" {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]