xerces-c: fix cross

This commit is contained in:
Jürgen Buchmüller 2017-09-01 14:31:04 +02:00
parent 60544d8cae
commit d5765d13e1
2 changed files with 86 additions and 3 deletions

View file

@ -0,0 +1,80 @@
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>]],

View file

@ -1,9 +1,9 @@
# Template file for 'xerces-c'
pkgname=xerces-c
version=3.2.0
revision=1
revision=2
build_style=gnu-configure
hostmakedepends="pkg-config"
hostmakedepends="automake libtool pkg-config"
makedepends="libcurl-devel icu-devel"
depends="lib${pkgname}>=${version}_${revision}"
short_desc="Validating XML parser written in portable C++"
@ -12,12 +12,15 @@ license="Apache-2.0"
homepage="http://xerces.apache.org/xerces-c/"
distfiles="http://archive.apache.org/dist/xerces/c/3/sources/${pkgname}-${version}.tar.bz2"
checksum=9f3327b63fd7eef3de45025449d5d948ab46f066a475706d2e34f94e91617b34
nocross="https://build.voidlinux.eu/builders/armv7l_builder/builds/4597/steps/shell_3/logs/stdio"
case "$XBPS_TARGET_MACHINE" in
i686*) export CCACHE_DISABLE=yes
esac
pre_configure() {
autoreconf -fi
}
pre_build() {
# Copy samples before build: avoid binaries in -doc package
mkdir -p _docs