diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2018-10-16 16:27:15 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2018-10-16 16:27:15 -0400 |
commit | 1a69f738d25f878bf3b6b5415ab08b7ef48b7568 (patch) | |
tree | e114502e48e7abf93794a337e95104cc10e6ab7d /src | |
parent | 49a1c22889d428558c8e5accb55afa538ef0ca3f (diff) | |
download | postgresql-1a69f738d25f878bf3b6b5415ab08b7ef48b7568.tar.gz postgresql-1a69f738d25f878bf3b6b5415ab08b7ef48b7568.zip |
Back off using -isysroot on Darwin.
Rethink the solution applied in commit 5e2217131 to get PL/Tcl to
build on macOS Mojave. I feared that adding -isysroot globally might
have undesirable consequences, and sure enough Jakob Egger reported
one: it complicates building extensions with a different Xcode version
than was used for the core server. (I find that a risky proposition
in general, but apparently it works most of the time, so we shouldn't
break it if we don't have to.)
We'd already adopted the solution for PL/Perl of inserting the sysroot
path directly into the -I switches used to find Perl's headers, and we
can do the same thing for PL/Tcl by changing the -iwithsysroot switch
that Apple's tclConfig.sh reports. This restricts the risks to PL/Perl
and PL/Tcl themselves and directly-dependent extensions, which is a lot
more pleasing in general than a global -isysroot switch.
Along the way, tighten the test to see if we need to inject the sysroot
path into $perl_includedir, as I'd speculated about upthread but not
gotten round to doing.
As before, back-patch to all supported versions.
Discussion: https://postgr.es/m/20840.1537850987@sss.pgh.pa.us
Diffstat (limited to 'src')
-rw-r--r-- | src/template/darwin | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/template/darwin b/src/template/darwin index cff258be26b..70227335669 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. -# Select where system include files should be sought. +# Select where some include files should be sought. +# We may eventually be forced to use "-isysroot" with this value, +# but for now, it only affects Perl and Tcl include files. 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 - CPPFLAGS="$CPPFLAGS -isysroot $PG_SYSROOT" - else + if test \! -d "$PG_SYSROOT" ; then PG_SYSROOT="" fi fi |