aboutsummaryrefslogtreecommitdiff
path: root/src/template/darwin
diff options
context:
space:
mode:
Diffstat (limited to 'src/template/darwin')
-rw-r--r--src/template/darwin12
1 files changed, 12 insertions, 0 deletions
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