aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.global.in1
-rw-r--r--src/template/darwin7
2 files changed, 5 insertions, 3 deletions
diff --git a/src/Makefile.global.in b/src/Makefile.global.in
index c4909c22ff5..bc781862855 100644
--- a/src/Makefile.global.in
+++ b/src/Makefile.global.in
@@ -241,6 +241,7 @@ BITCODE_CXXFLAGS = @BITCODE_CXXFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
+PG_SYSROOT = @PG_SYSROOT@
override CPPFLAGS := $(ICU_CFLAGS) $(CPPFLAGS)
diff --git a/src/template/darwin b/src/template/darwin
index 159d8bb1275..c05adca0bfb 100644
--- a/src/template/darwin
+++ b/src/template/darwin
@@ -3,14 +3,15 @@
# 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.
-# Some configure tests require explicit knowledge of where the Xcode "sysroot"
-# is. We try to avoid having this leak into configure's results, though.
+# 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
# Old xcodebuild versions may produce garbage, so validate the result.
if test x"$PG_SYSROOT" != x"" ; then
- if test \! -d "$PG_SYSROOT" ; then
+ if test -d "$PG_SYSROOT" ; then
+ CPPFLAGS="-isysroot $PG_SYSROOT $CPPFLAGS"
+ else
PG_SYSROOT=""
fi
fi