From 7aa64d90542cfc8f01f52ece38bf751c7b843875 Mon Sep 17 00:00:00 2001 From: "Avi Halachmi (:avih)" Date: Sun, 16 Jul 2023 21:29:08 +0300 Subject: win32: add script to create mingw unicode config Run ./scripts/mk_mingw64u_defconfig to create (or update) configs/mingw64u_defconfig from configs/mingw64_defconfig while enabling UTF8 manifest, UTF8 input, and unicode editing. --- scripts/mk_mingw64u_defconfig | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100755 scripts/mk_mingw64u_defconfig diff --git a/scripts/mk_mingw64u_defconfig b/scripts/mk_mingw64u_defconfig new file mode 100755 index 000000000..3cca78e5b --- /dev/null +++ b/scripts/mk_mingw64u_defconfig @@ -0,0 +1,35 @@ +#!/bin/sh + +configs=$(dirname -- "$0")/../configs + +# replace each FOO=bar argument with -e 's/.*FOO.*/FOO=bar/', then sed "$@" +set_build_opts() { + for v; do + set -- "$@" -e "s/.*${v%%=*}.*/$v/" + shift + done + sed "$@" +} + + +# Create unicode configs/mingw64u_defconfig from configs/mingw64_defconfig +# by flipping some build options to enable: +# - UTF8 manifest to support unicode on win 10 (filenames, etc). +# - UTF8 terminal input (shell prompt, read). +# - UTF8 editing - codepoint awareness (prompt, read): +# - Builtin libc unicode functions (mbstowcs etc - no UNICODE_USING_LOCALE). +# - Dynamic unicode based on ANSI codepage and ENV (CHECK_UNICODE_IN_ENV). +# - Screen-width awareness (COMBINING_WCHARS, WIDE_WCHARS) +# - Full unicode range (U+10FFFF - LAST_SUPPORTED_WCHAR=1114111) + +set_build_opts \ + CONFIG_FEATURE_UTF8_MANIFEST=y \ + CONFIG_FEATURE_UTF8_INPUT=y \ + CONFIG_UNICODE_SUPPORT=y \ + CONFIG_FEATURE_CHECK_UNICODE_IN_ENV=y \ + CONFIG_SUBST_WCHAR=63 \ + CONFIG_LAST_SUPPORTED_WCHAR=1114111 \ + CONFIG_UNICODE_COMBINING_WCHARS=y \ + CONFIG_UNICODE_WIDE_WCHARS=y \ + < "$configs"/mingw64_defconfig \ + > "$configs"/mingw64u_defconfig -- cgit v1.2.3-55-g6feb