Skip to content

Commit 50bebc1

Browse files
committed
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
1 parent 58cd8dc commit 50bebc1

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

doc/src/sgml/installation.sgml

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2353,6 +2353,17 @@ make MAX_CONNECTIONS=5 check
23532353
<secondary>installation on</secondary>
23542354
</indexterm>
23552355

2356+
<para>
2357+
To build <productname>PostgreSQL</productname> from source
2358+
on <productname>macOS</productname>, you will need to install Apple's
2359+
command line developer tools, which can be done by issuing
2360+
<programlisting>
2361+
xcode-select --install
2362+
</programlisting>
2363+
(note that this will pop up a GUI dialog window for confirmation).
2364+
You may or may not wish to also install Xcode.
2365+
</para>
2366+
23562367
<para>
23572368
On recent <productname>macOS</productname> releases, it's necessary to
23582369
embed the <quote>sysroot</quote> path in the include switches used to
@@ -2369,7 +2380,7 @@ make PG_SYSROOT=<replaceable>/desired/path</replaceable> all
23692380
</programlisting>
23702381
To find out the appropriate path on your machine, run
23712382
<programlisting>
2372-
xcodebuild -version -sdk macosx Path
2383+
xcrun --show-sdk-path
23732384
</programlisting>
23742385
Note that building an extension using a different sysroot version than
23752386
was used to build the core server is not really recommended; in the
@@ -2383,6 +2394,19 @@ xcodebuild -version -sdk macosx Path
23832394
<programlisting>
23842395
./configure ... PG_SYSROOT=<replaceable>/desired/path</replaceable>
23852396
</programlisting>
2397+
This would primarily be useful to cross-compile for some other
2398+
macOS version. There is no guarantee that the resulting executables
2399+
will run on the current host.
2400+
</para>
2401+
2402+
<para>
2403+
To suppress the <option>-isysroot</option> options altogether, use
2404+
<programlisting>
2405+
./configure ... PG_SYSROOT=none
2406+
</programlisting>
2407+
(any nonexistent pathname will work). This might be useful if you wish
2408+
to build with a non-Apple compiler, but beware that that case is not
2409+
tested or supported by the PostgreSQL developers.
23862410
</para>
23872411

23882412
<para>

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy