Merge #460: [build] Update ax_jni_include_dir.m4 macro
e7daa9b [build] Tweak JNI macro to warn instead of error for JNI not found. (Karl-Johan Alm) 5b22977 [build] Update ax_jni_include_dir.m4 macro to deal with recent versions of macOS (Karl-Johan Alm) Pull request description: Prior to this patch, this macro fails to find a working directory for the JNI headers, and results in compile failure when doing ``` ./configure --enable-experimental --enable-module-ecdh --enable-jni ``` on more recent macOS versions. The relevant commit upstream is [here](http://git.savannah.gnu.org/gitweb/?p=autoconf-archive.git;a=commit;h=ab23d25b1f1ae544fffdaa0a94a794798695c672) from the [GNU.org page for the macro](https://www.gnu.org/software/autoconf-archive/ax_jni_include_dir.html). The original (identical to the version in this commit) is [here](http://git.savannah.gnu.org/gitweb/?p=autoconf-archive.git;a=blob_plain;f=m4/ax_jni_include_dir.m4). The compile failure: ```Bash $ make gcc -I. -g -O2 -Wall -Wextra -Wno-unused-function -c src/gen_context.c -o gen_context.o gcc gen_context.o -o gen_context ./gen_context CC src/libsecp256k1_la-secp256k1.lo CC src/java/libsecp256k1_jni_la-org_bitcoin_NativeSecp256k1.lo In file included from src/java/org_bitcoin_NativeSecp256k1.c:4: In file included from src/java/org_bitcoin_NativeSecp256k1.h:2: /Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/Contents/Headers/jni.h:45:10: fatal error: 'jni_md.h' file not found #include "jni_md.h" ^ 1 error generated. make: *** [src/java/libsecp256k1_jni_la-org_bitcoin_NativeSecp256k1.lo] Error 1 ``` Tree-SHA512: 9a8305b3ed67eba0de728f91cf435857a676ba10507ab8481a3c03b50e1ce0469a3d79e751d0a697018789f21e2aa48b7eccca4d225520a3863fcf23f1fd487a
This commit is contained in:
commit
cd329dbc3e
@ -1,5 +1,5 @@
|
|||||||
# ===========================================================================
|
# ===========================================================================
|
||||||
# http://www.gnu.org/software/autoconf-archive/ax_jni_include_dir.html
|
# https://www.gnu.org/software/autoconf-archive/ax_jni_include_dir.html
|
||||||
# ===========================================================================
|
# ===========================================================================
|
||||||
#
|
#
|
||||||
# SYNOPSIS
|
# SYNOPSIS
|
||||||
@ -44,7 +44,7 @@
|
|||||||
# and this notice are preserved. This file is offered as-is, without any
|
# and this notice are preserved. This file is offered as-is, without any
|
||||||
# warranty.
|
# warranty.
|
||||||
|
|
||||||
#serial 10
|
#serial 14
|
||||||
|
|
||||||
AU_ALIAS([AC_JNI_INCLUDE_DIR], [AX_JNI_INCLUDE_DIR])
|
AU_ALIAS([AC_JNI_INCLUDE_DIR], [AX_JNI_INCLUDE_DIR])
|
||||||
AC_DEFUN([AX_JNI_INCLUDE_DIR],[
|
AC_DEFUN([AX_JNI_INCLUDE_DIR],[
|
||||||
@ -66,8 +66,16 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
case "$host_os" in
|
case "$host_os" in
|
||||||
darwin*) _JTOPDIR=`echo "$_JTOPDIR" | sed -e 's:/[[^/]]*$::'`
|
darwin*) # Apple Java headers are inside the Xcode bundle.
|
||||||
_JINC="$_JTOPDIR/Headers";;
|
macos_version=$(sw_vers -productVersion | sed -n -e 's/^@<:@0-9@:>@*.\(@<:@0-9@:>@*\).@<:@0-9@:>@*/\1/p')
|
||||||
|
if @<:@ "$macos_version" -gt "7" @:>@; then
|
||||||
|
_JTOPDIR="$(xcrun --show-sdk-path)/System/Library/Frameworks/JavaVM.framework"
|
||||||
|
_JINC="$_JTOPDIR/Headers"
|
||||||
|
else
|
||||||
|
_JTOPDIR="/System/Library/Frameworks/JavaVM.framework"
|
||||||
|
_JINC="$_JTOPDIR/Headers"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
*) _JINC="$_JTOPDIR/include";;
|
*) _JINC="$_JTOPDIR/include";;
|
||||||
esac
|
esac
|
||||||
_AS_ECHO_LOG([_JTOPDIR=$_JTOPDIR])
|
_AS_ECHO_LOG([_JTOPDIR=$_JTOPDIR])
|
||||||
@ -76,13 +84,12 @@ _AS_ECHO_LOG([_JINC=$_JINC])
|
|||||||
# On Mac OS X 10.6.4, jni.h is a symlink:
|
# On Mac OS X 10.6.4, jni.h is a symlink:
|
||||||
# /System/Library/Frameworks/JavaVM.framework/Versions/Current/Headers/jni.h
|
# /System/Library/Frameworks/JavaVM.framework/Versions/Current/Headers/jni.h
|
||||||
# -> ../../CurrentJDK/Headers/jni.h.
|
# -> ../../CurrentJDK/Headers/jni.h.
|
||||||
|
|
||||||
AC_CACHE_CHECK(jni headers, ac_cv_jni_header_path,
|
AC_CACHE_CHECK(jni headers, ac_cv_jni_header_path,
|
||||||
[
|
[
|
||||||
if test -f "$_JINC/jni.h"; then
|
if test -f "$_JINC/jni.h"; then
|
||||||
ac_cv_jni_header_path="$_JINC"
|
ac_cv_jni_header_path="$_JINC"
|
||||||
JNI_INCLUDE_DIRS="$JNI_INCLUDE_DIRS $ac_cv_jni_header_path"
|
JNI_INCLUDE_DIRS="$JNI_INCLUDE_DIRS $ac_cv_jni_header_path"
|
||||||
else
|
else
|
||||||
_JTOPDIR=`echo "$_JTOPDIR" | sed -e 's:/[[^/]]*$::'`
|
_JTOPDIR=`echo "$_JTOPDIR" | sed -e 's:/[[^/]]*$::'`
|
||||||
if test -f "$_JTOPDIR/include/jni.h"; then
|
if test -f "$_JTOPDIR/include/jni.h"; then
|
||||||
ac_cv_jni_header_path="$_JTOPDIR/include"
|
ac_cv_jni_header_path="$_JTOPDIR/include"
|
||||||
@ -90,16 +97,14 @@ else
|
|||||||
else
|
else
|
||||||
ac_cv_jni_header_path=none
|
ac_cv_jni_header_path=none
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# get the likely subdirectories for system specific java includes
|
# get the likely subdirectories for system specific java includes
|
||||||
case "$host_os" in
|
case "$host_os" in
|
||||||
bsdi*) _JNI_INC_SUBDIRS="bsdos";;
|
bsdi*) _JNI_INC_SUBDIRS="bsdos";;
|
||||||
darwin*) _JNI_INC_SUBDIRS="darwin";;
|
|
||||||
freebsd*) _JNI_INC_SUBDIRS="freebsd";;
|
freebsd*) _JNI_INC_SUBDIRS="freebsd";;
|
||||||
|
darwin*) _JNI_INC_SUBDIRS="darwin";;
|
||||||
linux*) _JNI_INC_SUBDIRS="linux genunix";;
|
linux*) _JNI_INC_SUBDIRS="linux genunix";;
|
||||||
osf*) _JNI_INC_SUBDIRS="alpha";;
|
osf*) _JNI_INC_SUBDIRS="alpha";;
|
||||||
solaris*) _JNI_INC_SUBDIRS="solaris";;
|
solaris*) _JNI_INC_SUBDIRS="solaris";;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user