+my $is_Win32 = $^O eq 'MSWin32';
+my $is_VMS = $^O eq 'VMS';
+my $is_Unix = !$is_Win32 && !$is_VMS;
+
+# To clarify, this isn't the entire suite of modules considered "toolchain"
+# It's not even all modules needed to build ext/
+# It's just the source paths of the (minimum complete set of) modules in ext/
+# needed to build the nonxs modules
+# After which, all nonxs modules are in lib, which was always sufficient to
+# allow miniperl to build everything else.
+
+# This list cannot get any longer without overflowing the length limit for
+# environment variables on VMS
+my @toolchain = qw(cpan/AutoLoader/lib
+ cpan/Cwd cpan/Cwd/lib
+ cpan/ExtUtils-Command/lib
+ dist/ExtUtils-Install/lib
+ cpan/ExtUtils-MakeMaker/lib
+ cpan/ExtUtils-Manifest/lib
+ cpan/File-Path/lib
+ );
+
+# Used only in ExtUtils::Liblist::Kid::_win32_ext()
+push @toolchain, 'cpan/Text-ParseWords/lib' if $is_Win32;
+
+my @ext_dirs = qw(cpan dist ext);
+my $ext_dirs_re = '(?:' . join('|', @ext_dirs) . ')';
+