[Fedora-packaging] define versus global !?

Farkas Levente lfarkas at lfarkas.org
Fri Aug 19 22:39:40 UTC 2011


On Wed, Aug 10, 2011 at 17:57, Kalev Lember <kalevlember at gmail.com> wrote:
> On 07/10/2011 03:47 PM, Farkas Levente wrote:
>> On 07/05/2011 12:49 AM, Farkas Levente wrote:
>>>>>> On Tue, 2011-06-28 at 13:58 +0200, Farkas Levente wrote:
>>>>>>> does anybody who can tell me the real reason of why:
>>>>>>> ------------------------------------
>>>>>>> %define __debug_install_post %{mingw_debug_install_post}
>>>>>>> ------------------------------------
>>>>>>> works why
>>>>>>> ------------------------------------
>>>>>>> %global __debug_install_post %{mingw_debug_install_post}
>>>>>>> ------------------------------------
>>>>>>> not?
>>
>> i find the reason but don't know how to solve. the problem was
>> %{?buildsubdir} which is not defined in the header part of the spec file
>> just in and after the %setup section. which means it's very hard to
>> define any kind of macro for __debug_install_post in the header part
>> without know which directory contains the compiled code so where have to
>> extract the debug info...
>> any tip?
>>
>
> One of the differences between %global and %define is that %define is
> lazily expanded, but global is not. Now if you say that buildsubdir
> definition isn't available when you are setting __debug_install_post, it
> means you need to use lazy expansion. This is probably the reason why
> %define works for you but %global doesn't: %global is expanded at
> definition time. If you really want to use %global instead of %define,
> you could try forcing lazy expansion by escaping %:
>
> %global __debug_install_post %%{mingw_debug_install_post}
>                             ^^ force lazy expansion

YES!!!
you're my hero!:-)

-- 
  Levente                               "Si vis pacem para bellum!"


More information about the mingw mailing list