ExtUtils::MakeMaker::CPANfile loads cpanfile in your distribution and modifies parameters for WriteMakefile in your Makefile.PL. Just use it instead of ExtUtils::MakeMaker (which should be loaded internally), and prepare cpanfile.