substs.set('NTP_SERVERS', ntp_servers)
default_locale = get_option('default-locale')
+if default_locale == ''
+ choose_default_locale_sh = find_program('tools/choose-default-locale.sh')
+ default_locale = run_command(choose_default_locale_sh).stdout().strip()
+endif
conf.set_quoted('SYSTEMD_DEFAULT_LOCALE', default_locale)
conf.set_quoted('GETTEXT_PACKAGE', meson.project_name())
description : 'the default value for KillUserProcesses= setting')
option('gshadow', type : 'boolean',
description : 'support for shadow group')
-option('default-locale', type : 'string', value : 'C',
+option('default-locale', type : 'string', value : '',
description : 'default locale used when /etc/locale.conf does not exist')
option('default-dnssec', type : 'combo',
--- /dev/null
+#!/bin/bash
+
+set -e
+
+# Fedora uses C.utf8 but Debian uses C.UTF-8
+if locale -a | grep -xq -E 'C\.(utf8|UTF-8)'; then
+ echo 'C.UTF-8'
+elif locale -a | grep -xqF 'en_US.utf8'; then
+ echo 'en_US.UTF-8'
+else
+ echo 'C'
+fi