diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Makefile.global.in | 1 | ||||
-rw-r--r-- | src/pl/plperl/GNUmakefile | 6 | ||||
-rw-r--r-- | src/tools/msvc/Mkvcbuild.pm | 27 |
3 files changed, 31 insertions, 3 deletions
diff --git a/src/Makefile.global.in b/src/Makefile.global.in index dc8a89af8e2..0d3f8ca9504 100644 --- a/src/Makefile.global.in +++ b/src/Makefile.global.in @@ -304,6 +304,7 @@ else endif perl_archlibexp = @perl_archlibexp@ perl_privlibexp = @perl_privlibexp@ +perl_embed_ccflags = @perl_embed_ccflags@ perl_embed_ldflags = @perl_embed_ldflags@ # Miscellaneous diff --git a/src/pl/plperl/GNUmakefile b/src/pl/plperl/GNUmakefile index b8e35852544..191f74067a6 100644 --- a/src/pl/plperl/GNUmakefile +++ b/src/pl/plperl/GNUmakefile @@ -12,7 +12,11 @@ override CPPFLAGS += -DPLPERL_HAVE_UID_GID override CPPFLAGS += -Wno-comment endif -override CPPFLAGS := -I. -I$(srcdir) $(CPPFLAGS) -I$(perl_archlibexp)/CORE +# Note: we need to make sure that the CORE directory is included last, +# probably because it sometimes contains some header files with names +# that clash with some of ours, or with some that we include, notably on +# Windows. +override CPPFLAGS := -I. -I$(srcdir) $(CPPFLAGS) $(perl_embed_ccflags) -I$(perl_archlibexp)/CORE rpathdir = $(perl_archlibexp)/CORE diff --git a/src/tools/msvc/Mkvcbuild.pm b/src/tools/msvc/Mkvcbuild.pm index e0bf60797f7..a7e3a014d7a 100644 --- a/src/tools/msvc/Mkvcbuild.pm +++ b/src/tools/msvc/Mkvcbuild.pm @@ -517,7 +517,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/; @@ -601,7 +620,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 = |