This is an automated email from the ASF dual-hosted git repository.

jimjag pushed a commit to branch AOO42X
in repository https://gitbox.apache.org/repos/asf/openoffice.git


The following commit(s) were added to refs/heads/AOO42X by this push:
     new 00b999b948 Some macOS specific Java fixes
00b999b948 is described below

commit 00b999b9488a61a3f6fce817c254190e2a9e23ea
Author: Jim Jagielski <[email protected]>
AuthorDate: Tue Jun 30 16:45:35 2026 -0400

    Some macOS specific Java fixes
---
 main/configure.ac | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/main/configure.ac b/main/configure.ac
index ed06204f77..44f55511f8 100644
--- a/main/configure.ac
+++ b/main/configure.ac
@@ -3028,6 +3028,23 @@ if test "$_os" = "WINNT"; then
    fi
 fi
 
+dnl on macOS there is no reliable way to derive JAVA_HOME from the path
+dnl of the java/javac binaries (the /usr/bin/java* wrappers are no longer
+dnl symlinks into a JDK, they are dispatcher stubs that shell out to
+dnl /usr/libexec/java_home), so ask the system tool directly.
+if test "$_os" = "Darwin"; then
+   if test -z "$with_jdk_home"; then
+      AC_MSG_CHECKING([for JDK home])
+      _jdk_home=`/usr/libexec/java_home 2>/dev/null`
+      AC_MSG_RESULT([$_jdk_home])
+      if test -d "$_jdk_home"; then
+          with_jdk_home="$_jdk_home"
+      else
+          AC_MSG_WARN([/usr/libexec/java_home did not return a JDK home 
directory, ignoring it])
+      fi
+   fi
+fi
+
 dnl ===================================================================
 dnl Checks for java
 dnl ===================================================================
@@ -3378,6 +3395,11 @@ if test "$SOLAR_JAVA" != ""; then
       save_LDFLAGS=$LDFLAGS
       save_LD_LIBRARY_PATH=$LD_LIBRARY_PATH
       CFLAGS="$CFLAGS -I$JAVA_HOME/include"
+      if test "$_os" = "Darwin"; then
+         dnl jni_md.h lives in a platform-specific subdirectory on macOS,
+         dnl matching the layout set up for the real build in set_soenv.in
+         CFLAGS="$CFLAGS -I$JAVA_HOME/include/darwin"
+      fi
       LDFLAGS="$LDFLAGS -L$JAVA_HOME/jre/bin"
       
LD_LIBRARY_PATH=$JAVA_HOME/jre/bin:$JAVA_HOME/jre/bin/classic:$JAVA_HOME/jre/bin/xawt:$LD_LIBRARY_PATH
       export LD_LIBRARY_PATH

Reply via email to