summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Reisner <dreisner@archlinux.org>2018-12-28 07:38:36 -0500
committerYu Watanabe <watanabe.yu+github@gmail.com>2018-12-29 21:43:04 +0900
commit8ca9e92c742602b8bcd431001e6f5b78c28c184f (patch)
treee6d80515544fe9933b042ef6f14b1e1229b77016
parent911649fdd43f3a9158b847947724a772a5a45c34 (diff)
downloadsystemd-8ca9e92c742602b8bcd431001e6f5b78c28c184f.tar.gz
Make default locale a compile time option
Default to a locale that's guaranteed to exist everywhere, but let distros override this with something more exotic if they choose to. Closes #11259.
-rw-r--r--meson.build6
-rw-r--r--meson_options.txt2
-rw-r--r--src/core/locale-setup.c4
3 files changed, 9 insertions, 3 deletions
diff --git a/meson.build b/meson.build
index 1964b1aa87..9ca3b72e4d 100644
--- a/meson.build
+++ b/meson.build
@@ -828,6 +828,9 @@ ntp_servers = get_option('ntp-servers')
conf.set_quoted('NTP_SERVERS', ntp_servers)
substs.set('NTP_SERVERS', ntp_servers)
+default_locale = get_option('default-locale')
+conf.set_quoted('SYSTEMD_DEFAULT_LOCALE', default_locale)
+
conf.set_quoted('GETTEXT_PACKAGE', meson.project_name())
substs.set('SUSHELL', get_option('debug-shell'))
@@ -3096,7 +3099,8 @@ status = [
'default DNS-over-TLS mode: @0@'.format(default_dns_over_tls),
'default cgroup hierarchy: @0@'.format(default_hierarchy),
'default net.naming-scheme setting: @0@'.format(default_net_naming_scheme),
- 'default KillUserProcesses setting: @0@'.format(kill_user_processes)]
+ 'default KillUserProcesses setting: @0@'.format(kill_user_processes),
+ 'default locale: @0@'.format(default_locale)]
alt_dns_servers = '\n '.join(dns_servers.split(' '))
alt_ntp_servers = '\n '.join(ntp_servers.split(' '))
diff --git a/meson_options.txt b/meson_options.txt
index 1423b8998e..7a75f380f9 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -195,6 +195,8 @@ option('default-kill-user-processes', type : 'boolean',
description : 'the default value for KillUserProcesses= setting')
option('gshadow', type : 'boolean',
description : 'support for shadow group')
+option('default-locale', type : 'string', value : 'C',
+ description : 'default locale used when /etc/locale.conf does not exist')
option('default-dnssec', type : 'combo',
description : 'default DNSSEC mode',
diff --git a/src/core/locale-setup.c b/src/core/locale-setup.c
index 584fb220a1..aa4a89c17a 100644
--- a/src/core/locale-setup.c
+++ b/src/core/locale-setup.c
@@ -74,9 +74,9 @@ int locale_setup(char ***environment) {
}
if (strv_isempty(add)) {
- /* If no locale is configured then default to C.UTF-8. */
+ /* If no locale is configured then default to compile-time default. */
- add = strv_new("LANG=C.UTF-8");
+ add = strv_new("LANG=" SYSTEMD_DEFAULT_LOCALE);
if (!add)
return -ENOMEM;
}