diff --git a/doc/src/sgml/installation.sgml b/doc/src/sgml/installation.sgml
index 4f9adf429f7..6b6adf736a5 100644
--- a/doc/src/sgml/installation.sgml
+++ b/doc/src/sgml/installation.sgml
@@ -2549,6 +2549,17 @@ PHSS_30849 s700_800 u2comp/be/plugin library Patch
installation on
+
+ To build PostgreSQL from source
+ on macOS, you will need to install Apple's
+ command line developer tools, which can be done by issuing
+
+xcode-select --install
+
+ (note that this will pop up a GUI dialog window for confirmation).
+ You may or may not wish to also install Xcode.
+
+
On recent macOS releases, it's necessary to
embed the sysroot path in the include switches used to
@@ -2565,7 +2576,7 @@ make PG_SYSROOT=/desired/path all
To find out the appropriate path on your machine, run
-xcodebuild -version -sdk macosx Path
+xcrun --show-sdk-path
Note that building an extension using a different sysroot version than
was used to build the core server is not really recommended; in the
@@ -2579,6 +2590,19 @@ xcodebuild -version -sdk macosx Path
./configure ... PG_SYSROOT=/desired/path
+ This would primarily be useful to cross-compile for some other
+ macOS version. There is no guarantee that the resulting executables
+ will run on the current host.
+
+
+
+ To suppress the options altogether, use
+
+./configure ... PG_SYSROOT=none
+
+ (any nonexistent pathname will work). This might be useful if you wish
+ to build with a non-Apple compiler, but beware that that case is not
+ tested or supported by the PostgreSQL developers.