]> rtime.felk.cvut.cz Git - coffee/buildroot.git/commitdiff
infra: Introduce BR2_HOST_NEEDS_JAVA
authorMaxime Hadjinlian <maxime.hadjinlian@gmail.com>
Mon, 17 Feb 2014 23:37:12 +0000 (00:37 +0100)
committerPeter Korsgaard <peter@korsgaard.com>
Wed, 19 Feb 2014 15:17:48 +0000 (16:17 +0100)
XBMC needs Java on the host in order to build, because it uses a
code-generator which is built in two phases: In the first phase SWIG is used
to parse C++ header files that define the API.  SWIG outputs an XML file
that contains a complete description of the structure of the API.  In the
second phase, the XML file is ingested by a Groovy (Java) program that then
creates C++ code that forms the bridge to the scripting language (Python).

The second phase is why we need java on the host.

You can learn more at the XBMC's wiki:
http://wiki.xbmc.org/index.php?title=Codegeneration#How_it_works

In order to check that, this patch introduce this mechanism in
dependencies.sh, and it also defines the variable in Config.in

[Peter: fix error message]
Signed-off-by: Maxime Hadjinlian <maxime.hadjinlian@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Config.in
support/dependencies/dependencies.sh

index bcfefc79f9b51ddc3419749cd922143e3154cf15..8afd156cbc31b200d287fbe0c9de74916c5c57a4 100644 (file)
--- a/Config.in
+++ b/Config.in
@@ -18,6 +18,11 @@ config BR2_EXTERNAL
        string
        option env="BR2_EXTERNAL"
 
+# Hidden boolean selected by packages in need of Java in order to build
+# (example: xbmc)
+config BR2_HOST_NEEDS_JAVA
+       bool
+
 # Hidden boolean selected by pre-built packages for x86, when they
 # need to run on x86-64 machines (example: pre-built external
 # toolchains, binary tools like SAM-BA, etc.).
index 0e7e1fa0479ab34cf19e3b7ad0f0301d15a2a3c3..a965c6882a3bf9bf286de1b2309afd4863e5cb33 100755 (executable)
@@ -191,6 +191,14 @@ if grep -q ^BR2_PACKAGE_CLASSPATH=y $BR2_CONFIG ; then
        done
 fi
 
+if grep -q ^BR2_HOST_NEEDS_JAVA=y $BR2_CONFIG ; then
+       if ! which java > /dev/null ; then
+               echo >&2
+               echo "You must install 'java' on your build machine" >&2
+               exit 1
+       fi
+fi
+
 if grep -q ^BR2_HOSTARCH_NEEDS_IA32_LIBS=y $BR2_CONFIG ; then
        if test ! -f /lib/ld-linux.so.2 ; then
                echo