diff --git a/make/jdk/src/classes/build/tools/makejavasecurity/MakeJavaSecurity.java b/make/jdk/src/classes/build/tools/makejavasecurity/MakeJavaSecurity.java index 963db0b593e..b7f5562a3cf 100644 --- a/make/jdk/src/classes/build/tools/makejavasecurity/MakeJavaSecurity.java +++ b/make/jdk/src/classes/build/tools/makejavasecurity/MakeJavaSecurity.java @@ -91,7 +91,8 @@ public static void main(String[] args) throws Exception { } // Filter out platform-unrelated ones. We only support - // #ifdef, #ifndef, #else, and #endif. Nesting not supported (yet). + // #ifdef, #ifndef, #else, #endif and #if defined A || B. + // Other Nesting not supported (yet). int mode = 0; // 0: out of block, 1: in match, 2: in non-match Iterator iter = lines.iterator(); while (iter.hasNext()) { @@ -113,6 +114,18 @@ public static void main(String[] args) throws Exception { mode = line.endsWith(args[2]) ? 2 : 1; } iter.remove(); + } else if (line.startsWith("#if defined ")) { + for (String l : line.split("\\|\\|")) { + if (l.indexOf('-') > 0) { + mode = l.trim().endsWith(args[2] + "-" + args[3]) ? 1 : 2; + } else { + mode = l.trim().endsWith(args[2]) ? 1 : 2; + } + if (mode == 1) { + break; + } + } + iter.remove(); } else if (line.startsWith("#else")) { if (mode == 0) { throw new IllegalStateException("#else not in #if block"); diff --git a/src/java.base/share/conf/security/java.security b/src/java.base/share/conf/security/java.security index 717b6f276f1..714343f0923 100644 --- a/src/java.base/share/conf/security/java.security +++ b/src/java.base/share/conf/security/java.security @@ -82,7 +82,7 @@ security.provider.tbd=Apple #endif security.provider.tbd=SunPKCS11 -#if defined (linux-x86) || defined (linux-ppc64le) || defined (linux-s390x) +#if defined linux-x86 || defined linux-ppc64le || defined linux-s390x # # Java Restricted Security Mode #