Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Yann E. MORIN <yann.morin.1998@free.fr>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 1/1] dependencies: Reject gcj in BR2_NEEDS_HOST_JAVA check
Date: Wed, 13 Aug 2014 23:23:12 +0200	[thread overview]
Message-ID: <20140813212312.GI3939@free.fr> (raw)
In-Reply-To: <XnsA388C38E9A3BAberndkuhlsPkbjNfxxIA@bernd-kuhls.de>

Bernd, All,

On 2014-08-13 19:13 +0200, Bernd Kuhls spake thusly:
> "Yann E. MORIN" <yann.morin.1998@free.fr> wrote in 
> news:20140813141110.GF3939 at free.fr:
> 
> >> +     JAVA=$(which java 2> /dev/null)
> >> +     if [ -z "$JAVA" ] ; then
> >> +          echo
> >> +          echo "You must install 'java' on your build machine";
> >> +          exit 1;
> >> +     fi;
> >> +     JAVA_GCJ=$($JAVA -version 2>&1 | grep gcj)
> > $ gcj -version
> > gcj: error: unrecognized command line option ???-version???
> > So I guess we should have:
> >     JAVA_GCJ="$(java --version 2>/dev/null |grep gcj)"
> > Which would be empty for the JDK's java, but not for gcj. I prefer we
> > rely on that, rather than the error mesage from gcj.
> 
> Hi,
> 
> $JAVA contains the result of "which java" which is /usr/bin/java here. This 
> corresponds to xbmc/codegenerator.mk, which also calls
> 
> JAVA ?= $(shell which java)
> 
> Executing /usr/bin/gcj directly is not desired ;)
> 
> /usr/bin/java -version resolves to either
> 
> $ /usr/bin/java -version
> java version "1.5.0"
> gij (GNU libgcj) version 4.7.2
> 
> or
> 
> $ /usr/bin/java -version
> java version "1.7.0_65"
> OpenJDK Runtime Environment (IcedTea 2.5.1) (7u65-2.5.1-2~deb7u1)
> OpenJDK 64-Bit Server VM (build 24.65-b04, mixed mode)

OK, so 'java' from gcj accepts the same args as 'java' from the JDK. OK.

So, I still say we should keep the original check, and then check that
java is not from gcj :

    check_prog_host "java"
    if java -version 2>&1 |grep gcj >/dev/null 2>&1; then
        echo "Failed"
        exit 1
    fi

check_prog_host already calls 'which $1' so we're sure we can call 'java'.

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

  reply	other threads:[~2014-08-13 21:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-06 20:26 [Buildroot] [PATCH 1/1] dependencies: Reject gcj in BR2_NEEDS_HOST_JAVA check Bernd Kuhls
2014-08-13 14:06 ` Yann E. MORIN
2014-08-13 14:11 ` Yann E. MORIN
2014-08-13 17:13   ` Bernd Kuhls
2014-08-13 21:23     ` Yann E. MORIN [this message]
2014-08-16  9:42       ` Bernd Kuhls

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140813212312.GI3939@free.fr \
    --to=yann.morin.1998@free.fr \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox