Resolving circular dependency between ExtUtils::MakeMaker and Test::Harness

Compiling a more recent (2.17 Q2 2018, almost 3 years later) version of Git might prove easier, since the build procedure for perl/ part has been greatly simplified by weaning Git off of MakeMaker.

See commit 7a7bfc7 (02 Jan 2018) by Jonathan Nieder (artagnon).
See commit 805a378 (22 Dec 2017), and commit 20d2a30 (10 Dec 2017) by Ævar Arnfjörð Bjarmason (avar).
(Merged by Junio C Hamano -- gitster -- in commit ed1b87e, 13 Feb 2018)

Ævar explains:

Replace the perl/Makefile.PL and the fallback perl/Makefile used under NO_PERL_MAKEMAKER=NoThanks with a much simpler implementation heavily inspired by how the i18n infrastructure's build process works.
See commit 5e9637c from Git v1.7.9-rc0, Nov. 2011.

The reason for having the Makefile.PL in the first place is that it was initially building a Perl C binding to interface with libgit (commit b1edc53d0, Git v1.4.3-rc1, June 2006), this functionality, that was removed (commit 18b0fc1, Git v1.4.3-rc1, Sept. 2006) before Git.pm ever made it to the master branch.

We've since since started maintaining a fallback perl/Makefile, as MakeMaker wouldn't work on some platforms (commit f848718, Git v1.5.0-rc0, Dec. 2006).
That's just the tip of the iceberg. We have the PM.stamp hack in the top-level Makefile (commit ee9be06, Git v1.7.12-rc1, Jul. 2012) to detect whether we need to regenerate the perl/perl.mak, which I fixed just recently to deal with issues like the perl version changing from under us (commit c59c4939, Git v2.13.0-rc0, March 2017).

There is absolutely no reason for why this needs to be so complex anymore.
All we're getting out of this elaborate Rube Goldberg machine was copying perl/* to perl/blib/* as we do a string-replacement on the *.pm files to hard-code @@LOCALEDIR@@ in the source, as well as pod2man-ing Git.pm & friends.

So replace the whole thing with something that's pretty much a copy of how we generate po/build/**.mo from po/*.po, just with a small sed(1) command instead of msgfmt.
As that's being done, rename the files from *.pm to *.pmc just to indicate that they're generated (see "perldoc -f require").


With Git 2.32 (Q2 2021), build procedure gets cleaned-up.

See commit 8c55753 (12 May 2021), and commit 256c2dc, commit 368a50d, commit 3d49f72, commit 4070c9e (05 May 2021) by Ævar Arnfjörð Bjarmason (avar).
(Merged by Junio C Hamano -- gitster -- in commit 2e2ed74, 20 May 2021)

perl: use mock i18n functions under NO_GETTEXT=Y

Signed-off-by: Ævar Arnfjörð Bjarmason

Change the logic of the i18n functions I added in 5e9637c ("i18n: add infrastructure for translating Git with gettext", 2011-11-18, Git v1.7.9-rc0 -- merge) to use pass-through functions when NO_GETTEXT is defined.

This speeds up the compilation time of commands that use this library when NO_GETTEXT=Y is in effect.
Loading it and POSIX.pm is around 20ms on my machine, whereas it takes 2ms to just instantiate Perl itself.