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

michaelo pushed a commit to branch fix-javaos-detection
in repository https://gitbox.apache.org/repos/asf/commons-daemon.git

commit d337c6bff5c67b8a61085b01061b866f55e625f6
Author: Michael Osipov <micha...@apache.org>
AuthorDate: Thu Jun 6 13:32:54 2024 +0200

    Fix several issues around Java OS and header files location detection
---
 src/changes/changes.xml           | 3 +++
 src/native/unix/configure.in      | 4 ++--
 src/native/unix/support/apjava.m4 | 6 +++---
 3 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index e5ae19f..819261c 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -41,6 +41,9 @@
   </properties>
   <body>
     <release version="1.4.1" date="tbd" description="Bug fix release">
+      <action dev="michaelo" type="fix">
+        Fix several issues around Java OS and header files location detection.
+      </action>
     </release>
     <release version="1.4.0" date="2024-05-24" description="Bug fix release">
       <!-- Fix -->
diff --git a/src/native/unix/configure.in b/src/native/unix/configure.in
index b411f01..8f01244 100644
--- a/src/native/unix/configure.in
+++ b/src/native/unix/configure.in
@@ -95,9 +95,9 @@ AP_FIND_JAVA_OS()
 if test -z "${JAVA_OS}"
 then
   AC_MSG_RESULT([jni_md.h found in $JAVA_HOME/$JAVA_INC])
-  INCLUDES="$INCLUDES -I$JAVA_HOME/include -I$JAVA_HOME/$JAVA_INC"
+  INCLUDES="$INCLUDES -I$JAVA_HOME/$JAVA_INC"
 else
-  INCLUDES="$INCLUDES -I$JAVA_HOME/include -I$JAVA_HOME/include/$supported_os"
+  INCLUDES="$INCLUDES -I$JAVA_HOME/$JAVA_INC -I$JAVA_HOME/$JAVA_INC/$JAVA_OS"
 fi
 
 dnl -------------------------------------------------------------------------
diff --git a/src/native/unix/support/apjava.m4 
b/src/native/unix/support/apjava.m4
index cd92280..921b5fb 100644
--- a/src/native/unix/support/apjava.m4
+++ b/src/native/unix/support/apjava.m4
@@ -57,9 +57,9 @@ AC_DEFUN([AP_FIND_JAVA_OS],[
   AC_ARG_WITH(os-type,[  --with-os-type[=SUBDIR]   Location of JDK os-type 
subdirectory.],
   [
     tempval=$withval
-    if test ! -d "$JAVA_HOME/$tempval"
+    if test ! -d "$JAVA_HOME/$JAVA_INC/$tempval"
     then
-      AC_MSG_ERROR(Not a directory: ${JAVA_HOME}/${tempval})
+      AC_MSG_ERROR(Not a directory: ${JAVA_HOME}/$JAVA_INC/${tempval})
     fi
     JAVA_OS=$tempval
   ],
@@ -80,7 +80,7 @@ AC_DEFUN([AP_FIND_JAVA_OS],[
         fi
       done
       if test "x$JAVA_OS" = "xNONE"; then
-        AC_MSG_RESULT(Cannot find jni_md.h in ${JAVA_HOME}/${OS})
+        AC_MSG_RESULT(Cannot find jni_md.h in ${JAVA_HOME}/${JAVA_INC}/\${OS})
         AC_MSG_ERROR(You should retry --with-os-type=SUBDIR)
       fi
     fi

Reply via email to