use warnings;
use ExtUtils::MakeMaker;
+use Config;
+
+my $pl = $Config{perl_patchlevel};
+my $desc = $Config{git_describe};
+for ($pl, $desc) {
+ $_ = undef unless defined and length;
+}
+
my @DEFINES;
+print "Checking if this is an official release of perl... ";
+my $is_release = ($] < 5.011) ? (defined($pl) || defined($desc) ? 0 : 1)
+ : (defined($desc) ? 0 : 1);
+push @DEFINES, "-DSU_RELEASE=$is_release";
+print $is_release ? "yes\n" : "no\n";
+
# Threads, Windows and 5.8.x don't seem to be best friends
if ($^O eq 'MSWin32' && $^V lt v5.9.0) {
push @DEFINES, '-DSU_MULTIPLICITY=0';
my %META = (
configure_requires => {
+ 'Config' => 0,
'ExtUtils::MakeMaker' => 0,
},
build_requires => {
#endif
#define SU_HAS_PERL(R, V, S) (PERL_REVISION > (R) || (PERL_REVISION == (R) && (PERL_VERSION > (V) || (PERL_VERSION == (V) && (PERL_SUBVERSION >= (S))))))
+#define SU_HAS_PERL_EXACT(R, V, S) ((PERL_REVISION == (R)) && (PERL_VERSION == (V)) && (PERL_SUBVERSION == (S)))
/* --- Threads and multiplicity -------------------------------------------- */
#if !SU_HAS_PERL(5, 8, 9)
# define SU_SAVE_GP_SIZE 6
-#elif !SU_HAS_PERL(5, 13, 0)
+#elif !SU_HAS_PERL(5, 13, 0) || (SU_RELEASE && SU_HAS_PERL_EXACT(5, 13, 0))
# define SU_SAVE_GP_SIZE 3
#else
# define SU_SAVE_GP_SIZE 4