summaryrefslogtreecommitdiff
path: root/configure.in
diff options
context:
space:
mode:
authorDaniel Veillard <veillard@src.gnome.org>2008-06-03 16:40:54 +0000
committerDaniel Veillard <veillard@src.gnome.org>2008-06-03 16:40:54 +0000
commit1a8e9f9ec06d6fa373c9d84eb98b268d9e1e446f (patch)
tree3f8f0793370403d70562df318156702599da7c9d /configure.in
parent9b968ec5a2bd814c54594696cbd000cf6535ffa5 (diff)
downloadlibxslt-1a8e9f9ec06d6fa373c9d84eb98b268d9e1e446f.tar.gz
libxslt-1a8e9f9ec06d6fa373c9d84eb98b268d9e1e446f.tar.bz2
libxslt-1a8e9f9ec06d6fa373c9d84eb98b268d9e1e446f.zip
patch from Nick Wellnhofer adding xsl:sort lang support using the locale
* configure.in libxslt/extra.c libxslt/Makefile.am libxslt/preproc.c libxslt/xsltInternals.h libxslt/xsltlocale.c libxslt/xsltlocale.h libxslt/xsltutils.c win32/Makefile.mingw win32/Makefile.msvc: patch from Nick Wellnhofer adding xsl:sort lang support using the locale support from the C library. Daniel svn path=/trunk/; revision=1476
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in43
1 files changed, 43 insertions, 0 deletions
diff --git a/configure.in b/configure.in
index a7edf2b4..7ad6b898 100644
--- a/configure.in
+++ b/configure.in
@@ -3,6 +3,7 @@ AC_PREREQ(2.2)
AC_INIT(libxslt/xslt.c)
AM_CONFIG_HEADER(config.h)
AC_CANONICAL_HOST
+AC_GNU_SOURCE
dnl
dnl libxslt is the main part of the package
@@ -105,6 +106,48 @@ AC_PATH_PROG(TAR, tar, /bin/tar)
AC_STDC_HEADERS
AM_PROG_LIBTOOL
+AC_MSG_CHECKING([for working xlocale.h])
+AC_TRY_RUN(
+[
+#include <locale.h>
+#include <xlocale.h>
+#include <string.h>
+#include <stdlib.h>
+
+#if defined(__GLIBC__) && __GLIBC__ == 2 && __GLIBC_MINOR__ <= 2
+#define locale_t __locale_t
+#define newlocale __newlocale
+#define freelocale __freelocale
+#define strxfrm_l __strxfrm_l
+#define LC_COLLATE_MASK (1 << LC_COLLATE)
+#endif
+
+int main()
+{
+ locale_t locale;
+ const char *src[2] = { "\xc3\x84rger", "Zeppelin" };
+ char *dst[2];
+ size_t len, r;
+ int i;
+
+ locale = newlocale(LC_COLLATE_MASK, "en_US.utf8", NULL);
+ if (locale == NULL) exit(1);
+ for (i=0; i<2; ++i) {
+ len = strxfrm_l(NULL, src[i], 0, locale) + 1;
+ dst[i] = malloc(len);
+ if(dst[i] == NULL) exit(1);
+ r = strxfrm_l(dst[i], src[i], len, locale);
+ if(r >= len) exit(1);
+ }
+ if (strcmp(dst[0], dst[1]) >= 0) exit(1);
+
+ exit(0);
+}
+],
+ [AC_MSG_RESULT(yes); AC_DEFINE(HAVE_XLOCALE_H, 1, [Have working xlocale.h])],
+ [AC_MSG_RESULT(no)]
+)
+
dnl
dnl Math detection
dnl