* [Buildroot] RFC dependencies: checking minimum make version
@ 2011-12-01 11:49 Thomas De Schampheleire
2011-12-01 19:07 ` Peter Korsgaard
0 siblings, 1 reply; 4+ messages in thread
From: Thomas De Schampheleire @ 2011-12-01 11:49 UTC (permalink / raw)
To: buildroot
Hi,
The buildroot Makefile uses constructs like:
ifeq ($(BR2_TOOLCHAIN_BUILDROOT),y)
include toolchain/toolchain-buildroot.mk
else ifeq ($(BR2_TOOLCHAIN_EXTERNAL),y)
include toolchain/toolchain-external.mk
else ifeq ($(BR2_TOOLCHAIN_CTNG),y)
include toolchain/toolchain-crosstool-ng.mk
endif
which is supported from 3.81 onwards.
This means that make 3.80 will give a syntax error, even though the
toolchain/dependencies/dependencies.sh checks for minimal make version
(in fact, this script never gets a chance to run).
To fix this, and detect old make versions gracefully, I see following solutions:
1. Adapt our Makefiles to be make 3.80 compatible, by e.g. adapting
the above construct. This is not a waterproof solution, as a similar
but different problem may arise in the future.
2. Check for the make version in make instead of in shell, e.g. with
the following pattern: (adopted from
http://www.jgc.org/blog/cookbook-sample.pdf)
need := 3.81
ok := $(filter $(need),$(firstword $(sort $(MAKE_VERSION) $(need))))
ifeq (,$(ok))
$(error make too old!)
endif
This will not work when make 10.x comes out because of the sort trick,
but otherwise should work fine. This code should be included as early
as possible in the Makefile.
What do you think?
Thanks,
Thomas
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Buildroot] RFC dependencies: checking minimum make version
2011-12-01 11:49 [Buildroot] RFC dependencies: checking minimum make version Thomas De Schampheleire
@ 2011-12-01 19:07 ` Peter Korsgaard
2011-12-02 7:56 ` Thomas De Schampheleire
0 siblings, 1 reply; 4+ messages in thread
From: Peter Korsgaard @ 2011-12-01 19:07 UTC (permalink / raw)
To: buildroot
>>>>> "Thomas" == Thomas De Schampheleire <patrickdepinguin+buildroot@gmail.com> writes:
Hi,
Thomas> 2. Check for the make version in make instead of in shell, e.g. with
Thomas> the following pattern: (adopted from
Thomas> http://www.jgc.org/blog/cookbook-sample.pdf)
Thomas> need := 3.81
Thomas> ok := $(filter $(need),$(firstword $(sort $(MAKE_VERSION) $(need))))
Thomas> ifeq (,$(ok))
Thomas> $(error make too old!)
Thomas> endif
Thomas> This will not work when make 10.x comes out because of the sort trick,
Thomas> but otherwise should work fine. This code should be included as early
Thomas> as possible in the Makefile.
Thomas> What do you think?
The likelyhood of people using <3.81 is probably getting fairly small,
but I'm OK with such a test (with a better error message and variables
though)@the top of the main Makefile.
Out of interest, on what system did you hit this?
--
Bye, Peter Korsgaard
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Buildroot] RFC dependencies: checking minimum make version
2011-12-01 19:07 ` Peter Korsgaard
@ 2011-12-02 7:56 ` Thomas De Schampheleire
2011-12-02 8:29 ` Peter Korsgaard
0 siblings, 1 reply; 4+ messages in thread
From: Thomas De Schampheleire @ 2011-12-02 7:56 UTC (permalink / raw)
To: buildroot
On Thu, Dec 1, 2011 at 8:07 PM, Peter Korsgaard <jacmet@uclibc.org> wrote:
>>>>>> "Thomas" == Thomas De Schampheleire <patrickdepinguin+buildroot@gmail.com> writes:
>
> Hi,
>
> ?Thomas> 2. Check for the make version in make instead of in shell, e.g. with
> ?Thomas> the following pattern: (adopted from
> ?Thomas> http://www.jgc.org/blog/cookbook-sample.pdf)
> ?Thomas> need := 3.81
> ?Thomas> ok := $(filter $(need),$(firstword $(sort $(MAKE_VERSION) $(need))))
> ?Thomas> ifeq (,$(ok))
> ?Thomas> $(error make too old!)
> ?Thomas> endif
>
> ?Thomas> This will not work when make 10.x comes out because of the sort trick,
> ?Thomas> but otherwise should work fine. This code should be included as early
> ?Thomas> as possible in the Makefile.
>
> ?Thomas> What do you think?
>
> The likelyhood of people using <3.81 is probably getting fairly small,
> but I'm OK with such a test (with a better error message and variables
> though) at the top of the main Makefile.
>
> Out of interest, on what system did you hit this?
This problem was seen on a workstation in Shanghai, with an old RedHat
distribution (not sure which exactly, but the kernel was 2.6.9, so
pretty old).
I'll try to submit a patch one of these days.
Thanks,
Thomas
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Buildroot] RFC dependencies: checking minimum make version
2011-12-02 7:56 ` Thomas De Schampheleire
@ 2011-12-02 8:29 ` Peter Korsgaard
0 siblings, 0 replies; 4+ messages in thread
From: Peter Korsgaard @ 2011-12-02 8:29 UTC (permalink / raw)
To: buildroot
>>>>> "Thomas" == Thomas De Schampheleire <patrickdepinguin+buildroot@gmail.com> writes:
Hi,
>> Out of interest, on what system did you hit this?
Thomas> This problem was seen on a workstation in Shanghai, with an old
Thomas> RedHat distribution (not sure which exactly, but the kernel was
Thomas> 2.6.9, so pretty old).
My guess would be RHEL4 (so from 2005).
Thomas> I'll try to submit a patch one of these days.
Thanks.
--
Bye, Peter Korsgaard
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-12-02 8:29 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-01 11:49 [Buildroot] RFC dependencies: checking minimum make version Thomas De Schampheleire
2011-12-01 19:07 ` Peter Korsgaard
2011-12-02 7:56 ` Thomas De Schampheleire
2011-12-02 8:29 ` Peter Korsgaard
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox