summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl-Johan Alm <karljohan-alm@garage.co.jp>2017-07-05 17:04:58 +0900
committerKarl-Johan Alm <karljohan-alm@garage.co.jp>2017-07-05 17:07:44 +0900
commit9276689d8a2708e83b01ecb1c1c3827a788a4c63 (patch)
treebcf214411eac26806486609063c6080384197b78
parenta4096843878e003017c5aed43ee37b17e241ef97 (diff)
downloadautoconf-archive-9276689d8a2708e83b01ecb1c1c3827a788a4c63.tar.gz
AX_JNI_INCLUDE_DIR: Do not use AC_CHECK_FILE as it is unavailable on some systems.
-rw-r--r--m4/ax_jni_include_dir.m434
1 files changed, 22 insertions, 12 deletions
diff --git a/m4/ax_jni_include_dir.m4 b/m4/ax_jni_include_dir.m4
index 1ab022d..007b3a1 100644
--- a/m4/ax_jni_include_dir.m4
+++ b/m4/ax_jni_include_dir.m4
@@ -44,7 +44,7 @@
# and this notice are preserved. This file is offered as-is, without any
# warranty.
-#serial 13
+#serial 14
AU_ALIAS([AC_JNI_INCLUDE_DIR], [AX_JNI_INCLUDE_DIR])
AC_DEFUN([AX_JNI_INCLUDE_DIR],[
@@ -84,13 +84,21 @@ _AS_ECHO_LOG([_JINC=$_JINC])
# On Mac OS X 10.6.4, jni.h is a symlink:
# /System/Library/Frameworks/JavaVM.framework/Versions/Current/Headers/jni.h
# -> ../../CurrentJDK/Headers/jni.h.
-AC_CHECK_FILE([$_JINC/jni.h],
- [JNI_INCLUDE_DIRS="$JNI_INCLUDE_DIRS $_JINC"],
- [_JTOPDIR=`echo "$_JTOPDIR" | sed -e 's:/[[^/]]*$::'`
- AC_CHECK_FILE([$_JTOPDIR/include/jni.h],
- [JNI_INCLUDE_DIRS="$JNI_INCLUDE_DIRS $_JTOPDIR/include"],
- AC_MSG_ERROR([cannot find JDK header files]))
- ])
+AC_CACHE_CHECK(jni headers, ac_cv_jni_header_path,
+[
+ if test -f "$_JINC/jni.h"; then
+ ac_cv_jni_header_path="$_JINC"
+ JNI_INCLUDE_DIRS="$JNI_INCLUDE_DIRS $ac_cv_jni_header_path"
+ else
+ _JTOPDIR=`echo "$_JTOPDIR" | sed -e 's:/[[^/]]*$::'`
+ if test -f "$_JTOPDIR/include/jni.h"; then
+ ac_cv_jni_header_path="$_JTOPDIR/include"
+ JNI_INCLUDE_DIRS="$JNI_INCLUDE_DIRS $ac_cv_jni_header_path"
+ else
+ ac_cv_jni_header_path=none
+ fi
+ fi
+])
# get the likely subdirectories for system specific java includes
case "$host_os" in
@@ -105,13 +113,15 @@ cygwin*) _JNI_INC_SUBDIRS="win32";;
*) _JNI_INC_SUBDIRS="genunix";;
esac
-# add any subdirectories that are present
-for JINCSUBDIR in $_JNI_INC_SUBDIRS
-do
+if test "x$ac_cv_jni_header_path" != "xnone"; then
+ # add any subdirectories that are present
+ for JINCSUBDIR in $_JNI_INC_SUBDIRS
+ do
if test -d "$_JTOPDIR/include/$JINCSUBDIR"; then
JNI_INCLUDE_DIRS="$JNI_INCLUDE_DIRS $_JTOPDIR/include/$JINCSUBDIR"
fi
-done
+ done
+fi
])
# _ACJNI_FOLLOW_SYMLINKS <path>