[Buildroot] [PATCH] toolchain package: set version as 'virtual' instead of 'undefined'

Thomas De Schampheleire patrickdepinguin at gmail.com
Thu May 8 20:03:15 UTC 2014


On Thu, May 8, 2014 at 3:00 PM, Arnout Vandecappelle <arnout at mind.be> wrote:
> On 08/05/14 13:37, Thomas De Schampheleire wrote:
>> On Thu, May 8, 2014 at 11:52 AM, Arnout Vandecappelle <arnout at mind.be> wrote:
>>> On 08/05/14 11:28, Thomas De Schampheleire wrote:
>>>> Hi Arnout,
>>>>
>>>> On Thu, May 8, 2014 at 10:31 AM, Arnout Vandecappelle <arnout at mind.be> wrote:
>>>
>>> [snip]
>>>>>  I repeat my earlier statement: within a function that is supposed to be
>>>>> eval'ed, *everything* should be $$'ed except the function arguments and except
>>>>> some very specific cases.
>>>>>
>>>>
>>>> But in the case of host variables being set based on target variables
>>>> if there is no explicit host variable, as for the _VERSION, there
>>>> would be a recursive assignment as $(2) == $(3).
>>>
>>> True; if you set
>>> $(2)_VERSION = $$(subst /,_,$$($(3)_VERSION))
>>>
>>> that will expand to
>>> PKG_VERSION = $$(subst /,_,$$(PKG_VERSION))
>>>
>>> in the eval, which is indeed recursive.
>>>
>>> But that can be solved with a simple:
>>>
>>> $(2)_VERSION := $$(subst /,_,$$($(3)_VERSION))
>>>
>>> Fortunately, make is smart enough to break the recursion even if PKG_VERSION had
>>> been assigned with = before.
>>>
>>>> So statement   $(2)_VERSION = $$(subst /,_,$($(3)_VERSION))
>>>> should become   $(2)_VERSION := $$(subst /,_,$($(3)_VERSION))
>>>
>>>  No, that doesn't make a difference, because the $(MYPKG_VERSION) is still
>>> expanded too early.
>>>
>>
>> I'm pretty sure I said this before, but all these $$$$'s are making me dizzy...
>> :-D
>
>  There shouldn't be a need for 4 $$$$'s. The ones in pkg-autotools could be avoided.
>

Quick update: I implemented the suggested approach and it seems to
work. I need to do some further testing though.

One question: for some variables, two dollar signs aren't really
needed, for example HOST_DIR, TARGET_DIR, DISABLE_NLS, QUIET, etc. as
the value of these variables are fixed and independent of the actual
package.
The usage of single vs. double dollar signs is inconsistent for such variables.
Should we use single ones (as doubles aren't necessary) or should we
use double dollars to avoid confusion?

Thanks,
Thomas


More information about the buildroot mailing list