Source: xerces-c
Version: 3.2.3+debian-3
Tags: patch upstream
User: [email protected]
Usertags: ftcbfs

xerces-c fails to cross build from source, because it uses AC_RUN_IFELSE
to check for two wchar functions. It actually tests whether those
functions behave as expected and such a test cannot be performed during
cross building. I propose degrading the check to a function existence
test during cross builds while keeping the elaborate check for native
builds. Please consider applying the attached patch.

Helmut
--- xerces-c-3.2.3+debian.orig/configure.ac
+++ xerces-c-3.2.3+debian/configure.ac
@@ -227,6 +227,7 @@
                       AC_DEFINE_UNQUOTED([HAVE_MBRLEN], 0, [Define to 1 if you have the `mbrlen' function.])
                     ]
                  )
+AC_CHECK_FUNC([wcsrtombs],[
 AC_MSG_CHECKING([for wcsrtombs])
 AC_RUN_IFELSE(  [AC_LANG_PROGRAM([[#include <wchar.h>
 #include <string.h>]],
@@ -247,8 +248,17 @@
                     [
                       AC_MSG_RESULT([no])
                       AC_DEFINE_UNQUOTED([HAVE_WCSRTOMBS], 0, [Define to 1 if you have the `wcsrtombs' function.])
+                    ],
+                    [
+		      AC_MSG_RESULT([cross. guessing yes])
+                      AC_DEFINE_UNQUOTED([HAVE_WCSRTOMBS], 1, [Define to 1 if you have the `wcsrtombs' function.])
                     ]
                  )
+],
+[
+  AC_DEFINE_UNQUOTED([HAVE_WCSRTOMBS], 0, [Define to 1 if you have the `wcsrtombs' function.])
+])
+AC_CHECK_FUNC([mbsrtowcs],[
 AC_MSG_CHECKING([for mbsrtowcs])
 AC_RUN_IFELSE(  [AC_LANG_PROGRAM([[#include <wchar.h>
 #include <string.h>]],
@@ -269,8 +279,16 @@
                     [
                       AC_MSG_RESULT([no])
                       AC_DEFINE_UNQUOTED([HAVE_MBSRTOWCS], 0, [Define to 1 if you have the `mbsrtowcs' function.])
+                    ],
+                    [
+                      AC_MSG_RESULT([cross. guessing yes])
+                      AC_DEFINE_UNQUOTED([HAVE_MBSRTOWCS], 1, [Define to 1 if you have the `mbsrtowcs' function.])
                     ]
                  )
+],
+[
+  AC_DEFINE_UNQUOTED([HAVE_MBSRTOWCS], 0, [Define to 1 if you have the `mbsrtowcs' function.])
+])
 
 AC_MSG_CHECKING([if iconv uses const pointers])
 AC_COMPILE_IFELSE(  [AC_LANG_PROGRAM([[#include <iconv.h>]],

Reply via email to