RFR: 8296904: Improve handling of macos xcode toolchain [v2]

Erik Joelsson erikj at openjdk.org
Tue Nov 15 13:56:11 UTC 2022


On Sat, 12 Nov 2022 15:23:41 GMT, Christoph Langer <clanger at openjdk.org> wrote:

>> With this PR I'd like to make it easier to use dedicated installations of Xcode on Mac OS for OpenJDK builds without having to switch the active Xcode globally via `xcode-select`.
>> 
>> I propose adding a new configure flag `--with-xcode-path` that takes the path to an Xcode installation. If the option is set, this path is expanded to a valid `TOOLCHAIN_PATH`.
>> 
>> Furthermore, I fix detection of xcodebuild and correctly setting the sysroot from the toolchain by moving `AC_SUBST(TOOLCHAIN_PATH)` before calling `BASIC_SETUP_XCODE_SYSROOT` and honoring `TOOLCHAIN_PATH` in BASIC_SETUP_XCODE_SYSROOT in the case when no devkit is specified. As I see it, this is a viable fix, even if not introducing `--with-xcode-path`.
>
> Christoph Langer has refreshed the contents of this pull request, and previous commits have been removed. The incremental views will show differences compared to the previous content of the PR. The pull request contains one new commit since the last revision:
> 
>   Improve options for xcode toolchain

I think this looks good. It's technically possible to achieve what you need using the existing `--with-toolchain-path`, but in the case of Xcode, that is rather cumbersome as you need to point to the internal `bin` directories in the Xcode installation instead of just the top level Xcode application dir.

make/autoconf/basic.m4 line 306:

> 304: 
> 305:   AC_ARG_WITH([xcode-path], [AS_HELP_STRING([--with-xcode-path],
> 306:       [set up toolchain on Mac OS using a path to an xcode installation])])

Suggestion:

      [set up toolchain on Mac OS using a path to an Xcode installation])])

-------------

Marked as reviewed by erikj (Reviewer).

PR: https://git.openjdk.org/jdk/pull/11113



More information about the build-dev mailing list