diff --git a/Formula/openjdk.rb b/Formula/openjdk.rb index b04e356a6de6..63ba8f49286c 100644 --- a/Formula/openjdk.rb +++ b/Formula/openjdk.rb @@ -4,6 +4,7 @@ class Openjdk < Formula url "https://github.com/openjdk/jdk18u/archive/jdk-18.0.2.1-ga.tar.gz" sha256 "06fad73665af281e36e1cc5fb0c8ed5e88e1e821989f1421539cb012065d7722" license "GPL-2.0-only" => { with: "Classpath-exception-2.0" } + revision 1 livecheck do url :stable @@ -40,6 +41,9 @@ class Openjdk < Formula depends_on "unzip" depends_on "zip" + # FIXME: This should not be needed because of the `-rpath` flag + # we set in `--with-extra-ldflags`, but this configuration + # does not appear to have made it to the linker. ignore_missing_libraries "libjvm.so" end @@ -86,10 +90,12 @@ def install --without-version-pre ] + ldflags = ["-Wl,-rpath,#{loader_path}/server"] args += if OS.mac? + ldflags << "-headerpad_max_install_names" + %W[ --enable-dtrace - --with-extra-ldflags=-headerpad_max_install_names --with-sysroot=#{MacOS.sdk_path} ] else @@ -99,6 +105,7 @@ def install --with-fontconfig=#{HOMEBREW_PREFIX} ] end + args << "--with-extra-ldflags=#{ldflags.join(" ")}" chmod 0755, "configure" system "./configure", *args diff --git a/Formula/openjdk@11.rb b/Formula/openjdk@11.rb index 74ffcb09fa66..3505ff719e05 100644 --- a/Formula/openjdk@11.rb +++ b/Formula/openjdk@11.rb @@ -4,6 +4,7 @@ class OpenjdkAT11 < Formula url "https://github.com/openjdk/jdk11u/archive/refs/tags/jdk-11.0.16.1-ga.tar.gz" sha256 "3008e50e258a5e9a488a814df2998b9823b6c2959d6a5a85221d333534d2f24c" license "GPL-2.0-only" + revision 1 livecheck do url :stable @@ -37,6 +38,9 @@ class OpenjdkAT11 < Formula depends_on "unzip" depends_on "zip" + # FIXME: This should not be needed because of the `-rpath` flag + # we set in `--with-extra-ldflags`, but this configuration + # does not appear to have made it to the linker. ignore_missing_libraries "libjvm.so" end @@ -82,11 +86,13 @@ def install --without-version-pre ] + ldflags = ["-Wl,-rpath,#{loader_path}/server"] args += if OS.mac? + ldflags << "-headerpad_max_install_names" + %W[ + --enable-dtrace --with-sysroot=#{MacOS.sdk_path} - --enable-dtrace=auto - --with-extra-ldflags=-headerpad_max_install_names ] else %W[ @@ -95,6 +101,7 @@ def install --with-fontconfig=#{HOMEBREW_PREFIX} ] end + args << "--with-extra-ldflags=#{ldflags.join(" ")}" chmod 0755, "configure" system "./configure", *args diff --git a/Formula/openjdk@17.rb b/Formula/openjdk@17.rb index d33f2f1a31dc..6c7805474661 100644 --- a/Formula/openjdk@17.rb +++ b/Formula/openjdk@17.rb @@ -4,6 +4,7 @@ class OpenjdkAT17 < Formula url "https://github.com/openjdk/jdk17u/archive/jdk-17.0.4.1-ga.tar.gz" sha256 "9b3e2558590fbb06ae4c02355919b1f75af9c696b786b113088ab6630e425824" license "GPL-2.0-only" => { with: "Classpath-exception-2.0" } + revision 1 livecheck do url :stable @@ -39,6 +40,9 @@ class OpenjdkAT17 < Formula depends_on "unzip" depends_on "zip" + # FIXME: This should not be needed because of the `-rpath` flag + # we set in `--with-extra-ldflags`, but this configuration + # does not appear to have made it to the linker. ignore_missing_libraries "libjvm.so" end @@ -85,10 +89,12 @@ def install --without-version-pre ] + ldflags = ["-Wl,-rpath,#{loader_path}/server"] args += if OS.mac? + ldflags << "-headerpad_max_install_names" + %W[ --enable-dtrace - --with-extra-ldflags=-headerpad_max_install_names --with-sysroot=#{MacOS.sdk_path} ] else @@ -98,6 +104,7 @@ def install --with-fontconfig=#{HOMEBREW_PREFIX} ] end + args << "--with-extra-ldflags=#{ldflags.join(" ")}" chmod 0755, "configure" system "./configure", *args