summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorNick Coghlan <ncoghlan@gmail.com>2017-06-11 03:16:15 (GMT)
committerGitHub <noreply@github.com>2017-06-11 03:16:15 (GMT)
commit6ea4186de32d65b1f1dc1533b6312b798d300466 (patch)
treebac8387f2da20d5b6d5f74bb09fb5708d1fbd61e /configure.ac
parent0afbabe245e2eb6f7cef3b70531d69f2a7ad8295 (diff)
downloadcpython-6ea4186de32d65b1f1dc1533b6312b798d300466.zip
cpython-6ea4186de32d65b1f1dc1533b6312b798d300466.tar.gz
cpython-6ea4186de32d65b1f1dc1533b6312b798d300466.tar.bz2
bpo-28180: Implementation for PEP 538 (#659)
- new PYTHONCOERCECLOCALE config setting - coerces legacy C locale to C.UTF-8, C.utf8 or UTF-8 by default - always uses C.UTF-8 on Android - uses `surrogateescape` on stdin and stdout in the coercion target locales - configure option to disable locale coercion at build time - configure option to disable C locale warning at build time
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac34
1 files changed, 34 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index d5b6399..18b940a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3325,6 +3325,40 @@ then
fi
AC_MSG_RESULT($with_pymalloc)
+# Check for --with-c-locale-coercion
+AC_MSG_CHECKING(for --with-c-locale-coercion)
+AC_ARG_WITH(c-locale-coercion,
+ AS_HELP_STRING([--with(out)-c-locale-coercion],
+ [disable/enable C locale coercion to a UTF-8 based locale]))
+
+if test -z "$with_c_locale_coercion"
+then
+ with_c_locale_coercion="yes"
+fi
+if test "$with_c_locale_coercion" != "no"
+then
+ AC_DEFINE(PY_COERCE_C_LOCALE, 1,
+ [Define if you want to coerce the C locale to a UTF-8 based locale])
+fi
+AC_MSG_RESULT($with_c_locale_coercion)
+
+# Check for --with-c-locale-warning
+AC_MSG_CHECKING(for --with-c-locale-warning)
+AC_ARG_WITH(c-locale-warning,
+ AS_HELP_STRING([--with(out)-c-locale-warning],
+ [disable/enable locale compatibility warning in the C locale]))
+
+if test -z "$with_c_locale_warning"
+then
+ with_c_locale_warning="yes"
+fi
+if test "$with_c_locale_warning" != "no"
+then
+ AC_DEFINE(PY_WARN_ON_C_LOCALE, 1,
+ [Define to emit a locale compatibility warning in the C locale])
+fi
+AC_MSG_RESULT($with_c_locale_warning)
+
# Check for Valgrind support
AC_MSG_CHECKING([for --with-valgrind])
AC_ARG_WITH([valgrind],