summaryrefslogtreecommitdiff
path: root/src/tools/msvc/Mkvcbuild.pm
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/msvc/Mkvcbuild.pm')
-rw-r--r--src/tools/msvc/Mkvcbuild.pm27
1 files changed, 25 insertions, 2 deletions
diff --git a/src/tools/msvc/Mkvcbuild.pm b/src/tools/msvc/Mkvcbuild.pm
index 199ba98e17..b4379838ad 100644
--- a/src/tools/msvc/Mkvcbuild.pm
+++ b/src/tools/msvc/Mkvcbuild.pm
@@ -508,7 +508,26 @@ sub mkvcbuild
my $plperl =
$solution->AddProject('plperl', 'dll', 'PLs', 'src/pl/plperl');
$plperl->AddIncludeDir($solution->{options}->{perl} . '/lib/CORE');
- $plperl->AddDefine('PLPERL_HAVE_UID_GID');
+
+ # Add defines from Perl's ccflags; see PGAC_CHECK_PERL_EMBED_CCFLAGS
+ my @perl_embed_ccflags;
+ foreach my $f (split(" ",$Config{ccflags}))
+ {
+ if ($f =~ /^-D[^_]/)
+ {
+ $f =~ s/\-D//;
+ push(@perl_embed_ccflags, $f);
+ }
+ }
+
+ # XXX this probably is redundant now?
+ push(@perl_embed_ccflags, 'PLPERL_HAVE_UID_GID');
+
+ foreach my $f (@perl_embed_ccflags)
+ {
+ $plperl->AddDefine($f);
+ }
+
foreach my $xs ('SPI.xs', 'Util.xs')
{
(my $xsc = $xs) =~ s/\.xs/.c/;
@@ -591,7 +610,11 @@ sub mkvcbuild
'hstore_plperl', 'contrib/hstore_plperl',
'plperl', 'src/pl/plperl',
'hstore', 'contrib/hstore');
- $hstore_plperl->AddDefine('PLPERL_HAVE_UID_GID');
+
+ foreach my $f (@perl_embed_ccflags)
+ {
+ $hstore_plperl->AddDefine($f);
+ }
}
$mf =