aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.global.in1
-rw-r--r--src/pl/plperl/GNUmakefile2
-rw-r--r--src/template/darwin12
3 files changed, 14 insertions, 1 deletions
diff --git a/src/Makefile.global.in b/src/Makefile.global.in
index 91d7cb83dcb..9cf0c35f8f9 100644
--- a/src/Makefile.global.in
+++ b/src/Makefile.global.in
@@ -331,6 +331,7 @@ else
endif
perl_archlibexp = @perl_archlibexp@
perl_privlibexp = @perl_privlibexp@
+perl_includedir = @perl_includedir@
perl_embed_ccflags = @perl_embed_ccflags@
perl_embed_ldflags = @perl_embed_ldflags@
diff --git a/src/pl/plperl/GNUmakefile b/src/pl/plperl/GNUmakefile
index 39dacf8b2e9..baf09b43e75 100644
--- a/src/pl/plperl/GNUmakefile
+++ b/src/pl/plperl/GNUmakefile
@@ -16,7 +16,7 @@ endif
# 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
+override CPPFLAGS := -I. -I$(srcdir) $(CPPFLAGS) $(perl_embed_ccflags) -I$(perl_includedir)/CORE
rpathdir = $(perl_archlibexp)/CORE
diff --git a/src/template/darwin b/src/template/darwin
index ea6d3b0b042..cff258be26b 100644
--- a/src/template/darwin
+++ b/src/template/darwin
@@ -3,6 +3,18 @@
# Note: Darwin is the original code name for macOS, also known as OS X.
# We still use "darwin" as the port name, partly because config.guess does.
+# Select where system include files should be sought.
+if test x"$PG_SYSROOT" = x"" ; then
+ PG_SYSROOT=`xcodebuild -version -sdk macosx Path 2>/dev/null`
+fi
+if test x"$PG_SYSROOT" != x"" ; then
+ if test -d "$PG_SYSROOT" ; then
+ CPPFLAGS="$CPPFLAGS -isysroot $PG_SYSROOT"
+ else
+ PG_SYSROOT=""
+ fi
+fi
+
# Select appropriate semaphore support. Darwin 6.0 (macOS 10.2) and up
# support System V semaphores; before that we have to use named POSIX
# semaphores, which are less good for our purposes because they eat a