This is an automated email from the ASF dual-hosted git repository.
jimjag pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/openoffice.git
The following commit(s) were added to refs/heads/trunk by this push:
new 8d1c74c224 Some macOS specific Java fixes
8d1c74c224 is described below
commit 8d1c74c2244dd86cc67797faf274e6b421017bc4
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 e5212c8799..c53265e912 100644
--- a/main/configure.ac
+++ b/main/configure.ac
@@ -3042,6 +3042,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 ===================================================================
@@ -3392,6 +3409,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