Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Luca Ceresoli <luca@lucaceresoli.net>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH] Don't build host-cmake if it is available on the build host
Date: Thu, 4 Feb 2016 14:37:44 +0100	[thread overview]
Message-ID: <56B35428.2070400@lucaceresoli.net> (raw)
In-Reply-To: <56B0704C.4060400@lucaceresoli.net>

Hi Arnout,

Luca Ceresoli wrote:
> Hi Arnout,
>
> thanks for the review.
>
> Unfortunately this patch is not working, at least for qjson with qt4.

It's fixed now (thanks to Samuel Martin for the help). So it's now time
for the refinements.

[...]

>>> new file mode 100644
>>> index 0000000..fe16322
>>> --- /dev/null
>>> +++ b/support/dependencies/check-host-cmake.mk
>>> @@ -0,0 +1,6 @@
>>> +CMAKE ?= cmake
>>> +
>>> +ifeq (,$(call suitable-host-package,cmake,$(CMAKE)))
>>> +BUILD_HOST_CMAKE = YES
>>> +CMAKE = $(HOST_DIR)/usr/bin/cmake
>>> +endif
>>> diff --git a/support/dependencies/check-host-cmake.sh
>>> b/support/dependencies/check-host-cmake.sh
>>> new file mode 100755
>>> index 0000000..76a81e0
>>> --- /dev/null
>>> +++ b/support/dependencies/check-host-cmake.sh
>>> @@ -0,0 +1,14 @@
>>> +#!/bin/sh
>>> +
>>> +candidate="$1"
>>> +
>>> +cmake=`which $candidate`
>>
>>   $candidate could be an absolute path, in which case which returns
>> nothing.

Not sure I got what you mean, sorry. which + absolute path returns the
absolute path itself, if it exists:

$ which cmake
/usr/bin/cmake
$ which /usr/bin/cmake
/usr/bin/cmake
$ which /not/quite/cmake
$

And the which(1) manpage confirms this is correct.

>>> +if [ ! -x "$cmake" ]; then
>>> +    cmake=`which cmake`
>>
>>   Since there is already CMAKE ?= cmake in the caller, this is pointless.

Aah, yes. Removing the second if will still allow to override CMAKE
('make CMAKE=/my/custom/cmake qjson') but if it does not exist it will
not search for one in the path. Sounds good.

>>   How about a
>>
>> for cmake in "$cmake" "$( which "$cmake" )"; do
>>   ...
>>
>> instead?

Given the above discussion about which(1), I think this is useless.

>>> +    if [ ! -x "$cmake" ]; then
>>> +        # echo nothing: no suitable cmake found
>>> +        exit 1
>>> +    fi
>>> +fi
>>
>>   I have the feeling that there should also be a version check here,
>> though I
>> don't know which version we should use.
>
> Right. My idea is to download all the cmake packages that are currently
> in Buildroot, find the highest version mentioned in their
> CMAKE_MINIMUM_REQUIRED() statement and check for that version in the
> script.

I added it, will be in v2. This was absolutely needed to make it work on
a Ubuntu 14.04 LTS host. More details will be in the commit log (which
will be even longer, ooh yeah).

-- 
Luca

  reply	other threads:[~2016-02-04 13:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-01 21:44 [Buildroot] [PATCH] Don't build host-cmake if it is available on the build host Luca Ceresoli
2016-02-02  8:44 ` Arnout Vandecappelle
2016-02-02  9:01   ` Luca Ceresoli
2016-02-04 13:37     ` Luca Ceresoli [this message]
2016-02-05 21:47       ` Arnout Vandecappelle

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=56B35428.2070400@lucaceresoli.net \
    --to=luca@lucaceresoli.net \
    --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