Permalink
Browse files

Use bundled JNI headers for cross builds

  • Loading branch information...
1 parent 68a35ed commit e58b6a4b7ac990c72ea146ca773f7a586a04dd25 @bgilbert bgilbert committed Dec 26, 2014
Showing with 14 additions and 27 deletions.
  1. +6 −1 Makefile.am
  2. +0 −3 README.txt
  3. +7 −22 configure.ac
  4. +1 −1 cross/jni_md.h
View
@@ -10,11 +10,16 @@ else
JNI_LA = libopenslide-jni.la
endif
+if USE_CROSS_HEADERS
+CROSS_H = cross/jni.h cross/jni_md.h
+endif
+
export JAVA_HOME
export ANT_HOME
pkglib_LTLIBRARIES = $(JNI_LA)
-libopenslide_jni_la_SOURCES = openslide-jni.c
+libopenslide_jni_la_SOURCES = openslide-jni.c $(CROSS_H)
+openslide_jni_la_SOURCES = $(libopenslide_jni_la_SOURCES)
# Building without lib prefix requires -module.
# On the other hand, the JNI ABI on Mac OS X precludes it.
openslide_jni_la_LDFLAGS = -module $(AM_LDFLAGS)
View
@@ -15,9 +15,6 @@ make install
Cross-compiling for Windows with MinGW-w64
------------------------------------------
-You will need the GNU Classpath version of jni.h installed. (On Fedora
-this is in the libgcj-devel package.)
-
PKG_CONFIG=pkg-config \
PKG_CONFIG_PATH=/path/to/cross/compiled/openslide/lib/pkgconfig \
./configure --host=i686-w64-mingw32 --build=$(build-aux/config.guess)
View
@@ -52,8 +52,8 @@ fi
AC_ARG_WITH([java], [AS_HELP_STRING([--with-java], [path to JDK])], [],
[with_java="$JAVA_HOME:$DEFAULT_JAVA_HOME:/usr/lib/jvm/java"])
AC_ARG_WITH([jni-headers], [AS_HELP_STRING([--with-jni-headers=PLATFORM],
- [use JNI headers for PLATFORM. Specify "cross" to use Classpath
- headers from the build platform.])], [], [with_jni_headers=guess])
+ [use JNI headers for PLATFORM. Specify "cross" to use bundled
+ Classpath headers.])], [], [with_jni_headers=guess])
if test z$with_jni_headers = zguess ; then
if test $host = $build ; then
AS_CASE([$host],
@@ -81,30 +81,15 @@ if test z$with_jni_headers != zcross ; then
JNI_CFLAGS="\"-I$jni_h_dir\" \"-I$jni_md_h_dir\""
else
# For cross builds, we don't have the OpenJDK jni_md.h for the target
- # platform, so use the GNU Classpath JNI headers in the build system's
- # gcj include directory instead. Autoconf doesn't give us a variable
- # for the build compiler, which is okay because anything other than
- # GCC probably won't support this syntax.
+ # platform, so use our own copy of the GNU Classpath JNI headers instead.
#
# Don't set JAVA_HOME unless it was specified on the command line.
- #
- # This is terrible.
- JNI_CFLAGS=
- AC_MSG_CHECKING([for cross jni.h and jni_md.h])
- for word in $(gcc - -v -E < /dev/null 2>&1)
- do
- if test -r "$word/jni.h" && test -r "$word/jni_md.h" ; then
- AC_MSG_RESULT([$word])
- JNI_CFLAGS="-I$word"
- break
- fi
- done
- if test "x$JNI_CFLAGS" = x ; then
- AC_MSG_RESULT([not found])
- AC_MSG_ERROR([cannot find JNI headers])
- fi
+ AC_MSG_CHECKING([whether to use bundled JNI headers])
+ AC_MSG_RESULT([yes])
+ JNI_CFLAGS='-I$(top_srcdir)/cross'
fi
AC_SUBST([JNI_CFLAGS])
+AM_CONDITIONAL([USE_CROSS_HEADERS], [test x$with_jni_headers = xcross])
# Checks for typedefs, structures, and compiler characteristics.
View
@@ -27,7 +27,7 @@ executable file might be covered by the GNU General Public License. */
#ifndef __GCJ_JNI_MD_H__
#define __GCJ_JNI_MD_H__
-#include <gcj/libgcj-config.h>
+#define JV_HAVE_INTTYPES_H 1
#ifdef __GCJ_JNI_IMPL__

0 comments on commit e58b6a4

Please sign in to comment.