diff options
author | Darren Tucker <dtucker@zip.com.au> | 2016-12-08 15:48:34 +1100 |
---|---|---|
committer | Darren Tucker <dtucker@zip.com.au> | 2016-12-08 15:48:34 +1100 |
commit | 47b8c99ab3221188ad3926108dd9d36da3b528ec (patch) | |
tree | c42c2ac76244885e43da3d9fc26718a330dc344b | |
parent | 4089fc1885b3a2822204effbb02b74e3da58240d (diff) |
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@
-rw-r--r-- | Makefile.in | 2 | ||||
-rw-r--r-- | configure.ac | 18 | ||||
-rw-r--r-- | regress/Makefile | 4 |
3 files changed, 23 insertions, 1 deletions
diff --git a/Makefile.in b/Makefile.in index 3990f5525..e10f3742a 100644 --- a/Makefile.in +++ b/Makefile.in | |||
@@ -580,6 +580,7 @@ tests interop-tests t-exec: regress-prep regress-binaries $(TARGETS) | |||
580 | TEST_SSH_PUTTYGEN="puttygen"; \ | 580 | TEST_SSH_PUTTYGEN="puttygen"; \ |
581 | TEST_SSH_CONCH="conch"; \ | 581 | TEST_SSH_CONCH="conch"; \ |
582 | TEST_SSH_IPV6="@TEST_SSH_IPV6@" ; \ | 582 | TEST_SSH_IPV6="@TEST_SSH_IPV6@" ; \ |
583 | TEST_SSH_UTF8="@TEST_SSH_UTF8@" ; \ | ||
583 | TEST_SSH_ECC="@TEST_SSH_ECC@" ; \ | 584 | TEST_SSH_ECC="@TEST_SSH_ECC@" ; \ |
584 | cd $(srcdir)/regress || exit $$?; \ | 585 | cd $(srcdir)/regress || exit $$?; \ |
585 | $(MAKE) \ | 586 | $(MAKE) \ |
@@ -604,6 +605,7 @@ tests interop-tests t-exec: regress-prep regress-binaries $(TARGETS) | |||
604 | TEST_SSH_PUTTYGEN="$${TEST_SSH_PUTTYGEN}" \ | 605 | TEST_SSH_PUTTYGEN="$${TEST_SSH_PUTTYGEN}" \ |
605 | TEST_SSH_CONCH="$${TEST_SSH_CONCH}" \ | 606 | TEST_SSH_CONCH="$${TEST_SSH_CONCH}" \ |
606 | TEST_SSH_IPV6="$${TEST_SSH_IPV6}" \ | 607 | TEST_SSH_IPV6="$${TEST_SSH_IPV6}" \ |
608 | TEST_SSH_UTF8="$${TEST_SSH_UTF8}" \ | ||
607 | TEST_SSH_ECC="$${TEST_SSH_ECC}" \ | 609 | TEST_SSH_ECC="$${TEST_SSH_ECC}" \ |
608 | TEST_SHELL="${TEST_SHELL}" \ | 610 | TEST_SHELL="${TEST_SHELL}" \ |
609 | EXEEXT="$(EXEEXT)" \ | 611 | EXEEXT="$(EXEEXT)" \ |
diff --git a/configure.ac b/configure.ac index 4d9382ca7..9c8d1173b 100644 --- a/configure.ac +++ b/configure.ac | |||
@@ -1776,6 +1776,23 @@ CFLAGS="$CFLAGS -D_XOPEN_SOURCE" | |||
1776 | AC_CHECK_FUNCS([mblen mbtowc nl_langinfo wcwidth]) | 1776 | AC_CHECK_FUNCS([mblen mbtowc nl_langinfo wcwidth]) |
1777 | CFLAGS="$saved_CFLAGS" | 1777 | CFLAGS="$saved_CFLAGS" |
1778 | 1778 | ||
1779 | TEST_SSH_UTF8=yes | ||
1780 | AC_MSG_CHECKING([for utf8 locale support]) | ||
1781 | AC_RUN_IFELSE( | ||
1782 | [AC_LANG_PROGRAM([[ | ||
1783 | #include <locale.h> | ||
1784 | ]], [[ | ||
1785 | char *loc = setlocale(LC_CTYPE, "en_US.UTF-8"); | ||
1786 | if (loc != NULL) | ||
1787 | exit(0); | ||
1788 | exit(1); | ||
1789 | ]])], | ||
1790 | AC_MSG_RESULT(yes), | ||
1791 | [AC_MSG_RESULT(no) | ||
1792 | TEST_SSH_UTF8=no], | ||
1793 | AC_MSG_WARN([cross compiling: assuming yes]) | ||
1794 | ) | ||
1795 | |||
1779 | AC_LINK_IFELSE( | 1796 | AC_LINK_IFELSE( |
1780 | [AC_LANG_PROGRAM( | 1797 | [AC_LANG_PROGRAM( |
1781 | [[ #include <ctype.h> ]], | 1798 | [[ #include <ctype.h> ]], |
@@ -5009,6 +5026,7 @@ else | |||
5009 | fi | 5026 | fi |
5010 | AC_CHECK_DECL([BROKEN_GETADDRINFO], [TEST_SSH_IPV6=no]) | 5027 | AC_CHECK_DECL([BROKEN_GETADDRINFO], [TEST_SSH_IPV6=no]) |
5011 | AC_SUBST([TEST_SSH_IPV6], [$TEST_SSH_IPV6]) | 5028 | AC_SUBST([TEST_SSH_IPV6], [$TEST_SSH_IPV6]) |
5029 | AC_SUBST([TEST_SSH_UTF8], [$TEST_SSH_UTF8]) | ||
5012 | AC_SUBST([TEST_MALLOC_OPTIONS], [$TEST_MALLOC_OPTIONS]) | 5030 | AC_SUBST([TEST_MALLOC_OPTIONS], [$TEST_MALLOC_OPTIONS]) |
5013 | AC_SUBST([UNSUPPORTED_ALGORITHMS], [$unsupported_algorithms]) | 5031 | AC_SUBST([UNSUPPORTED_ALGORITHMS], [$unsupported_algorithms]) |
5014 | 5032 | ||
diff --git a/regress/Makefile b/regress/Makefile index 1f71761fa..bb8806818 100644 --- a/regress/Makefile +++ b/regress/Makefile | |||
@@ -225,5 +225,7 @@ unit: | |||
225 | $$V ${.OBJDIR}/unittests/hostkeys/test_hostkeys \ | 225 | $$V ${.OBJDIR}/unittests/hostkeys/test_hostkeys \ |
226 | -d ${.CURDIR}/unittests/hostkeys/testdata ; \ | 226 | -d ${.CURDIR}/unittests/hostkeys/testdata ; \ |
227 | $$V ${.OBJDIR}/unittests/match/test_match ; \ | 227 | $$V ${.OBJDIR}/unittests/match/test_match ; \ |
228 | $$V ${.OBJDIR}/unittests/utf8/test_utf8 ; \ | 228 | if test "x${TEST_SSH_UTF8}" = "xyes" ; then \ |
229 | $$V ${.OBJDIR}/unittests/utf8/test_utf8 ; \ | ||
230 | fi \ | ||
229 | fi | 231 | fi |