Configuring with --disable-perl-cc-checks does not disable the compiler checks, it just disables setting PERLCC. PERLCC is still checked, so using this configure flag assures that configure will fail to enable the perl modules:
checking if we are in the source tree so we can install Perl modules... Yes
checking whether is a GNU C compiler... no
checking for potential embedded Perl support... disabled
checking if we can install the Perl modules... no
If I force enabling the perl modules by also using --with-perl-modules, configure fails:
checking if we are in the source tree so we can install Perl modules... Yes
checking whether is a GNU C compiler... no
configure: error: This build is using a GNU C compiler (gcc) while Perl has been compiled with a non-GNU (or non-working) compiler (). This likely won't work for building with Perl support. Either specify a different compiler (--with-cc=PATH), disable this check (--disable-perl-cc-checks) or build without Perl (--without-perl-modules).
Using --with-cc does not help. The only solution is not to use --disable-perl-cc-checks.
This has been fixed by commit 86231d18704a5560f217089a5c83a2bd9cfe2340 on the v5.9 and master branches.