RFR: 8303485: Replacing os.name for operating system customization [v2]

Roger Riggs rriggs at openjdk.org
Mon Mar 13 22:58:52 UTC 2023


On Fri, 10 Mar 2023 05:42:18 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> Good point.  `OperatingSystemProps.java` can be a OS-specific class like: 
>> 
>> src/java.base/macosx/classes/jdk/internal/misc/OperatingSystemProps.java
>>               linux/classes/jdk/internal/misc/OperatingSystemProps.java
>>               windows/classes/jdk/internal/misc/OperatingSystemProps.java
>> 
>> 
>> OTOH, if we include `os.arch`, that would need to be a template.   A single template file to include both OS and ARCH would do it.
>
> I was literally thinking of the `#if[xx]` conditional compilation facility rather than an OS specific file, but okay ...

The stream preprocessor (SPP) is more involved than the simple substitutions used to insert the target os into the template.

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

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



More information about the build-dev mailing list