[openssh-commits] [openssh] 01/01: Check for utf8 local support before testing it.
git+noreply at mindrot.org
git+noreply at mindrot.org
Thu Dec 8 15:49:45 AEDT 2016
This is an automated email from the git hooks/post-receive script.
dtucker pushed a commit to branch master
in repository openssh.
commit 47b8c99ab3221188ad3926108dd9d36da3b528ec
Author: Darren Tucker <dtucker at zip.com.au>
Date: Thu Dec 8 15:48:34 2016 +1100
Check for utf8 local support before testing it.
Check for utf8 local support and if not found, do not attempt to run the
utf8 tests. Suggested by djm@
---
Makefile.in | 2 ++
configure.ac | 18 ++++++++++++++++++
regress/Makefile | 4 +++-
3 files changed, 23 insertions(+), 1 deletion(-)
diff --git a/Makefile.in b/Makefile.in
index 3990f55..e10f374 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -580,6 +580,7 @@ tests interop-tests t-exec: regress-prep regress-binaries $(TARGETS)
TEST_SSH_PUTTYGEN="puttygen"; \
TEST_SSH_CONCH="conch"; \
TEST_SSH_IPV6="@TEST_SSH_IPV6@" ; \
+ TEST_SSH_UTF8="@TEST_SSH_UTF8@" ; \
TEST_SSH_ECC="@TEST_SSH_ECC@" ; \
cd $(srcdir)/regress || exit $$?; \
$(MAKE) \
@@ -604,6 +605,7 @@ tests interop-tests t-exec: regress-prep regress-binaries $(TARGETS)
TEST_SSH_PUTTYGEN="$${TEST_SSH_PUTTYGEN}" \
TEST_SSH_CONCH="$${TEST_SSH_CONCH}" \
TEST_SSH_IPV6="$${TEST_SSH_IPV6}" \
+ TEST_SSH_UTF8="$${TEST_SSH_UTF8}" \
TEST_SSH_ECC="$${TEST_SSH_ECC}" \
TEST_SHELL="${TEST_SHELL}" \
EXEEXT="$(EXEEXT)" \
diff --git a/configure.ac b/configure.ac
index 4d9382c..9c8d117 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1776,6 +1776,23 @@ CFLAGS="$CFLAGS -D_XOPEN_SOURCE"
AC_CHECK_FUNCS([mblen mbtowc nl_langinfo wcwidth])
CFLAGS="$saved_CFLAGS"
+TEST_SSH_UTF8=yes
+AC_MSG_CHECKING([for utf8 locale support])
+AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM([[
+#include <locale.h>
+ ]], [[
+ char *loc = setlocale(LC_CTYPE, "en_US.UTF-8");
+ if (loc != NULL)
+ exit(0);
+ exit(1);
+ ]])],
+ AC_MSG_RESULT(yes),
+ [AC_MSG_RESULT(no)
+ TEST_SSH_UTF8=no],
+ AC_MSG_WARN([cross compiling: assuming yes])
+)
+
AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[[ #include <ctype.h> ]],
@@ -5009,6 +5026,7 @@ else
fi
AC_CHECK_DECL([BROKEN_GETADDRINFO], [TEST_SSH_IPV6=no])
AC_SUBST([TEST_SSH_IPV6], [$TEST_SSH_IPV6])
+AC_SUBST([TEST_SSH_UTF8], [$TEST_SSH_UTF8])
AC_SUBST([TEST_MALLOC_OPTIONS], [$TEST_MALLOC_OPTIONS])
AC_SUBST([UNSUPPORTED_ALGORITHMS], [$unsupported_algorithms])
diff --git a/regress/Makefile b/regress/Makefile
index 1f71761..bb88068 100644
--- a/regress/Makefile
+++ b/regress/Makefile
@@ -225,5 +225,7 @@ unit:
$$V ${.OBJDIR}/unittests/hostkeys/test_hostkeys \
-d ${.CURDIR}/unittests/hostkeys/testdata ; \
$$V ${.OBJDIR}/unittests/match/test_match ; \
- $$V ${.OBJDIR}/unittests/utf8/test_utf8 ; \
+ if test "x${TEST_SSH_UTF8}" = "xyes" ; then \
+ $$V ${.OBJDIR}/unittests/utf8/test_utf8 ; \
+ fi \
fi
--
To stop receiving notification emails like this one, please contact
djm at mindrot.org.
More information about the openssh-commits
mailing list