Detect jni.h; Provide mechanism for adding include paths necessary to find it; Set intelligent defaults for Linux/Mac/Solaris

git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@341 632fc199-4ca6-4c93-a231-07263d6284db
This commit is contained in:
DRC 2011-02-04 22:16:41 +00:00
Родитель 9af1aedcdb
Коммит 063ab49603
2 изменённых файлов: 24 добавлений и 0 удалений

Просмотреть файл

@ -39,6 +39,7 @@ libturbojpeg_la_SOURCES = $(libjpeg_la_SOURCES) turbojpegl.c turbojpeg.h
if WITH_JNI
libturbojpeg_la_SOURCES += turbojpeg-jni.c
libturbojpeg_la_CFLAGS = ${JAVA_CFLAGS}
TJMAPFILE = turbojpeg-mapfile.jni
else

Просмотреть файл

@ -231,11 +231,34 @@ AM_CONDITIONAL([WITH_ARITH_DEC], [test "x$with_arith_dec" != "xno"])
AM_CONDITIONAL([WITH_ARITH], [test "x$with_arith_dec" != "xno" -o "x$with_arith_enc" != "xno"])
case $host_os in
darwin*)
DEFAULT_JAVA_CFLAGS=-I/System/Library/Frameworks/JavaVM.framework/Headers
;;
solaris*)
DEFAULT_JAVA_CFLAGS='-I/usr/java/include -I/usr/java/include/solaris'
;;
linux*)
DEFAULT_JAVA_CFLAGS='-I/usr/java/default/include -I/usr/java/default/include/linux'
;;
esac
AC_ARG_VAR(JAVA_CFLAGS, [Compiler flags needed to find jni.h (default: -I/System/Library/Frameworks/JavaVM.framework/Headers on OS X, '-I/usr/java/include -I/usr/java/include/solaris' on Solaris, and '-I/usr/java/default/include -I/usr/java/default/include/linux' on Linux)])
if test "x$JAVA_CFLAGS" = "x"; then
JAVA_CFLAGS=$DEFAULT_JAVA_CFLAGS
fi
AC_MSG_CHECKING([whether to include JNI wrapper in TurboJPEG/OSS])
AC_ARG_WITH([jni],
AC_HELP_STRING([--with-jni],[Include JNI wrapper in the TurboJPEG/OSS library]))
if test "x$with_jni" = "xyes"; then
AC_MSG_RESULT(yes)
SAVE_CPPFLAGS=${CPPFLAGS}
CPPFLAGS="${CPPFLAGS} ${JAVA_CFLAGS}"
AC_CHECK_HEADERS([jni.h], [DUMMY=1],
[AC_MSG_ERROR([Could not find JNI header file])])
CPPFLAGS=${SAVE_CPPFLAGS}
AC_SUBST(JAVA_CFLAGS)
else
AC_MSG_RESULT(no)
fi