Assume there is no locale handling on this system in the function
locales_enabled() if we are operating (as in minitest) without the boot
loader, as they can't be accessed because the POSIX module which
contains setlocale() can't be loaded.
# khw cargo-culted the '?' in the pattern on the next line.
return 0 if $Config{ccflags} =~ /\bD?NO_LOCALE\b/;
+ # If we can't load the POSIX XS module, we can't have locales even if they
+ # normally would be available
+ return 0 if ! defined &DynaLoader::boot_DynaLoader;
+
if (! $Config{d_setlocale}) {
return 0 if $Config{ccflags} =~ /\bD?NO_POSIX_2008_LOCALE\b/;
return 0 unless $Config{d_newlocale};