void-packages/srcpkgs/xerces-c/patches/fix-configure-cross.patch

81 lines
3.2 KiB
Diff
Raw Normal View History

2017-09-01 12:31:04 +00:00
Remove checks which require running a binary in order to
make cross compiling possible again. The results are all
true for glibc and musl libc, thus unconditionally add
the corresponding defines via AC_DEFINE_UNQUOTED.
--- configure.ac 2017-08-06 20:09:44.000000000 +0200
+++ configure.ac 2017-09-01 14:22:45.842676418 +0200
@@ -174,69 +174,9 @@
]
)
-# The check for mbrlen, wcsrtombs and mbsrtowcs gives a false
-# positive on HP-UX, so we use a different snippet to set the
-# corresponding macro
-# Furthermore, OpenBSD 5.1 doesn't follow the standard that states
-# that the "src" pointer must be set to NULL when a \0 has been
-# converted in the source data, a behaviour that we rely on
-# So we also check for this scenario before using these functions
-AC_MSG_CHECKING([for mbrlen])
-AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[#include <wchar.h>]],
- [[mbstate_t st; mbrlen( "t", 5, &st );]])],
- [
- AC_MSG_RESULT([yes])
- AC_DEFINE_UNQUOTED([HAVE_MBRLEN], 1, [Define to 1 if you have the `mbrlen' function.])
- ],
- [
- AC_MSG_RESULT([no])
- AC_DEFINE_UNQUOTED([HAVE_MBRLEN], 0, [Define to 1 if you have the `mbrlen' function.])
- ]
- )
-AC_MSG_CHECKING([for wcsrtombs])
-AC_RUN_IFELSE( [AC_LANG_PROGRAM([[#include <wchar.h>
-#include <string.h>]],
- [[
-mbstate_t st;
-memset(&st, 0, sizeof(st));
-char buffer[32];
-const wchar_t* src=L"help";
-wcsrtombs(buffer, &src, 32, &st);
-if(src==0)
- return 0;
-else
- return 1;]])],
- [
- AC_MSG_RESULT([yes])
- AC_DEFINE_UNQUOTED([HAVE_WCSRTOMBS], 1, [Define to 1 if you have the `wcsrtombs' function.])
- ],
- [
- AC_MSG_RESULT([no])
- AC_DEFINE_UNQUOTED([HAVE_WCSRTOMBS], 0, [Define to 1 if you have the `wcsrtombs' function.])
- ]
- )
-AC_MSG_CHECKING([for mbsrtowcs])
-AC_RUN_IFELSE( [AC_LANG_PROGRAM([[#include <wchar.h>
-#include <string.h>]],
- [[
-mbstate_t st;
-memset(&st, 0, sizeof(st));
-wchar_t buffer[32];
-const char* src="help";
-mbsrtowcs(buffer, &src, 32, &st);
-if(src==0)
- return 0;
-else
- return 1;]])],
- [
- AC_MSG_RESULT([yes])
- AC_DEFINE_UNQUOTED([HAVE_MBSRTOWCS], 1, [Define to 1 if you have the `mbsrtowcs' function.])
- ],
- [
- AC_MSG_RESULT([no])
- AC_DEFINE_UNQUOTED([HAVE_MBSRTOWCS], 0, [Define to 1 if you have the `mbsrtowcs' function.])
- ]
- )
+AC_DEFINE_UNQUOTED([HAVE_MBRLEN], 1, [Define to 1 if you have the `mbrlen' function.])
+AC_DEFINE_UNQUOTED([HAVE_WCSRTOMBS], 1, [Define to 1 if you have the `wcsrtombs' function.])
+AC_DEFINE_UNQUOTED([HAVE_MBSRTOWCS], 1, [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>]],