[libbluray-devel] Modify buildsystem to use the current jni/ folder

Jean-Baptiste Kempf git at videolan.org
Wed May 21 12:36:26 CEST 2014


libbluray | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Fri May 16 22:29:00 2014 +0200| [ad4acd94ed42f9eb35f499fc2b4947fd3baa14f2] | committer: Jean-Baptiste Kempf

Modify buildsystem to use the current jni/ folder

> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=ad4acd94ed42f9eb35f499fc2b4947fd3baa14f2
---

 configure.ac    |   20 ++++++++++++--------
 src/Makefile.am |    2 +-
 2 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/configure.ac b/configure.ac
index bed21fc1..cf69abf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -56,8 +56,7 @@ library_not_found="Could not find required library!"
 function_not_found="Could not find required function!"
 
 dnl configure options
-AC_ARG_VAR([JDK_HOME], [Path to the JDK @<:@default=/usr/lib/jvm/java-6-openjdk@:>@])
-AS_IF([test -z "$JDK_HOME"], [JDK_HOME="/usr/lib/jvm/java-6-openjdk"])
+AC_ARG_VAR([JDK_HOME], [Path to the JDK])
 
 AC_ARG_ENABLE([werror],
   [AS_HELP_STRING([--enable-werror], [set warnings as errors via -Werror @<:@default=disabled@:>@])])
@@ -187,12 +186,17 @@ if [[ $use_bdjava = "yes" ]]; then
        *)        java_os=$host_os ;;
   esac
 
-  BDJAVA_CFLAGS="-I${JDK_HOME}/include -I${JDK_HOME}/include/$java_os"
-
-  temp_CPPFLAGS="$CPPFLAGS"
-  CPPFLAGS="$BDJAVA_CFLAGS $CPPFLAGS"
-  AC_CHECK_HEADERS([jni.h], [], [AC_MSG_ERROR("Could not find jni.h")])
-  CPPFLAGS="$temp_CPPFLAGS"
+  AS_IF([test "x${JDK_HOME}" != "x"], [
+    BDJAVA_CFLAGS="-I${JDK_HOME}/include -I${JDK_HOME}/include/$java_os"
+
+    temp_CPPFLAGS="$CPPFLAGS"
+    CPPFLAGS="$BDJAVA_CFLAGS $CPPFLAGS"
+    AC_CHECK_HEADERS([jni.h], [], [AC_MSG_ERROR(could not find jni.h)])
+    CPPFLAGS="$temp_CPPFLAGS"
+  ], [
+    BDJAVA_CFLAGS='-I${abs_top_srcdir}/jni -I${abs_top_srcdir}/jni/'
+    BDJAVA_CFLAGS+="${java_os}"
+  ])
 
   AC_DEFINE([USING_BDJAVA], [1], ["Define to 1 if using BD-Java"])
   AC_DEFINE_UNQUOTED([JAVA_ARCH], ["$java_arch"], ["Defines the architecture of the java vm."])
diff --git a/src/Makefile.am b/src/Makefile.am
index 2953411..6fbec00 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,5 +1,5 @@
 SET_FEATURES = -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112L -D_REENTRANT
-SET_INCLUDES = -I$(top_srcdir) -Ifile -Ilibbluray -Ilibbluray/bdnav
+SET_INCLUDES = -I$(top_srcdir) -Ifile -Ilibbluray -Ilibbluray/bdnav $(BDJAVA_CFLAGS)
 
 AM_CFLAGS = -std=c99 $(SET_FEATURES) $(SET_INCLUDES) $(LIBXML2_CFLAGS) $(FT2_CFLAGS)
 



More information about the libbluray-devel mailing list