patch 9.0.1765: Error when cross-compiling Vim
Problem: Error when cross-compiling Vim
Solution: use AC_CHECK_SIZEOF to find sizeof(wchar_t)
This fixes an error when cross compiling.
closes: #12828
Bug: https://bugs.gentoo.org/889430
Signed-off-by: Mike Gilbert <floppym@gentoo.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/src/configure.ac b/src/configure.ac
index d56001f..a3c5f8d 100644
--- a/src/configure.ac
+++ b/src/configure.ac
@@ -2416,25 +2416,8 @@
LDFLAGS="$ac_save_LDFLAGS"
- AC_MSG_CHECKING(size of wchar_t is 2 bytes)
- AC_CACHE_VAL(ac_cv_small_wchar_t,
- [AC_RUN_IFELSE([AC_LANG_SOURCE([
-#include <X11/Xlib.h>
-#if STDC_HEADERS
-# include <stdlib.h>
-# include <stddef.h>
-#endif
- int main()
- {
- if (sizeof(wchar_t) <= 2)
- exit(1);
- exit(0);
- }])],
- ac_cv_small_wchar_t="no",
- ac_cv_small_wchar_t="yes",
- AC_MSG_ERROR(failed to compile test program))])
- AC_MSG_RESULT($ac_cv_small_wchar_t)
- if test "x$ac_cv_small_wchar_t" = "xyes" ; then
+ AC_CHECK_SIZEOF([wchar_t])
+ if test "$ac_cv_sizeof_wchar_t" -le 2; then
AC_DEFINE(SMALL_WCHAR_T)
fi