void-packages/srcpkgs/xerces-c/patches/fix-configure-cross.patch
Đoàn Trần Công Danh 3353bf4722 srcpkgs/x*: convert patches to -Np1
```sh
git grep -l '^patch_args=-Np0' "srcpkgs/$1*/template" |
while read template; do
	for p in ${template%/template}/patches/*; do
		sed -i '
			\,^[+-][+-][+-] /dev/null,b
			/^[*-]\+ [0-9]\+\(,[0-9]\+\)\? [*-]\+$/b
			s,^[*][*][*] ,&a/,
			/^--- /{
				s,\(^--- \)\(./\)*,\1a/,
				s,[.-][Oo][Rr][Ii][Gg]\([	/]\),\1,
				s/[.-][Oo][Rr][Ii][Gg]$//
				s/[.]patched[.]\([^.]\)/.\1/
				h
			}
			/^+++ -/{
				g
				s/^--- a/+++ b/
				b
			}
			s,\(^+++ \)\(./\)*,\1b/,
		' "$p"
	done
	sed -i '/^patch_args=/d' $template
done
```
2021-06-20 13:17:29 +07:00

80 lines
3.2 KiB
Diff

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.
--- a/configure.ac 2017-08-06 20:09:44.000000000 +0200
+++ b/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>]],