diff --git a/src/cmd/ksh93/Mamfile b/src/cmd/ksh93/Mamfile index 1a8f688a9..516c9be90 100644 --- a/src/cmd/ksh93/Mamfile +++ b/src/cmd/ksh93/Mamfile @@ -27,6 +27,12 @@ make install exec - SHOPT() exec - { exec - case $1 in + exec - 'MULTIBYTE=') + exec - echo + exec - echo '#if !defined(SHOPT_MULTIBYTE) && !AST_NOMULTIBYTE' + exec - echo '#define SHOPT_MULTIBYTE 1' + exec - echo '#endif' + exec - ;; exec - *=?*) echo exec - echo "#ifndef SHOPT_${1%%=*}" exec - echo "#define SHOPT_${1%%=*} ${1#*=}" diff --git a/src/cmd/ksh93/README b/src/cmd/ksh93/README index b41a23f84..567fbb86e 100644 --- a/src/cmd/ksh93/README +++ b/src/cmd/ksh93/README @@ -100,8 +100,9 @@ The options have the following defaults and meanings: As of 2021-05-10, no tool that can parse this database is known. If you know of any, please contact us. - MULTIBYTE on Multibyte character handling. Requires mblen() and - mbctowc(). + MULTIBYTE Multibyte character handling. This is on by default unless + the flag -DAST_NOMULTIBYTE is passed to the compiler via + CCFLAGS. The UTF-8 character set is fully supported. NAMESPACE on Adds a 'namespace' reserved word that allows defining name spaces. Variables and functions defined within a block like @@ -191,6 +192,11 @@ Note: Do not add compiler flags that cause the compiler to emit terminal escape codes, such as -fdiagnostics-color=always; this will cause the build to fail as the probing code greps compiler diagnostics. +If you are certain that you don't need support for UTF-8 and other multibyte +character locales and really want to save some memory and CPU cycles, add +'-DAST_NOMULTIBYTE' to CCFLAGS to compile out all multibyte character +handling in ksh and supporting libraries. Not recommended for most users. + For more information, run: bin/package help diff --git a/src/cmd/ksh93/SHOPT.sh b/src/cmd/ksh93/SHOPT.sh index fa7c60ca7..1380de49c 100644 --- a/src/cmd/ksh93/SHOPT.sh +++ b/src/cmd/ksh93/SHOPT.sh @@ -25,7 +25,7 @@ SHOPT GLOBCASEDET= # -o globcasedetect: adapt globbing/completion to case-inse SHOPT HISTEXPAND=1 # csh-style history file expansions SHOPT KIA= # ksh -R