summaryrefslogtreecommitdiff
path: root/doc/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2021-01-22 18:58:25 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2021-01-22 18:58:54 -0500
commit0fceac7196181b2bf312c3dec377dd8b2e396c5a (patch)
tree452f8c02530d087b85489f845b649ece15a2a500 /doc/src
parent0d6903ecd941f3397c189defc437c957fd8da8ea (diff)
Doc: improve directions for building on macOS.
In light of recent discussions, we should instruct people to install Apple's command line tools; installing Xcode is secondary. Also, fix sample command for finding out the default sysroot, as we now know that the command originally recommended can give a result that doesn't match your OS version. Also document the workaround to use if you really don't want configure to select a sysroot at all. Discussion: https://postgr.es/m/20210119111625.20435-1-james.hilliard1@gmail.com
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/sgml/installation.sgml26
1 files changed, 25 insertions, 1 deletions
diff --git a/doc/src/sgml/installation.sgml b/doc/src/sgml/installation.sgml
index 951dcb99120..740c5d584b6 100644
--- a/doc/src/sgml/installation.sgml
+++ b/doc/src/sgml/installation.sgml
@@ -2588,6 +2588,17 @@ PHSS_30849 s700_800 u2comp/be/plugin library Patch
</indexterm>
<para>
+ To build <productname>PostgreSQL</productname> from source
+ on <productname>macOS</productname>, you will need to install Apple's
+ command line developer tools, which can be done by issuing
+<programlisting>
+xcode-select --install
+</programlisting>
+ (note that this will pop up a GUI dialog window for confirmation).
+ You may or may not wish to also install Xcode.
+ </para>
+
+ <para>
On recent <productname>macOS</productname> releases, it's necessary to
embed the <quote>sysroot</quote> path in the include switches used to
find some system header files. This results in the outputs of
@@ -2603,7 +2614,7 @@ make PG_SYSROOT=<replaceable>/desired/path</replaceable> all
</programlisting>
To find out the appropriate path on your machine, run
<programlisting>
-xcodebuild -version -sdk macosx Path
+xcrun --show-sdk-path
</programlisting>
Note that building an extension using a different sysroot version than
was used to build the core server is not really recommended; in the
@@ -2617,6 +2628,19 @@ xcodebuild -version -sdk macosx Path
<programlisting>
./configure ... PG_SYSROOT=<replaceable>/desired/path</replaceable>
</programlisting>
+ 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.
+ </para>
+
+ <para>
+ To suppress the <option>-isysroot</option> options altogether, use
+<programlisting>
+./configure ... PG_SYSROOT=none
+</programlisting>
+ (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.
</para>
<para>