On 23 August 2013 06:04, Thijs Schreijer <th...@thijsschreijer.nl> wrote:
>> -----Original Message-----
>> From: Tom N Harris [mailto:tellia...@whoopdedo.org]
>> Sent: vrijdag 23 augustus 2013 4:01
>> To: luarocks-developers@lists.sourceforge.net
>> Subject: Re: [Luarocks-developers] Define system specific flags.
>>
>> On Thursday, August 22, 2013 08:29:08 PM Alexey Melnichuk wrote:
>> > This code work for ether Win2k or WinXP. But on Win2k I just do not
>> support
>> > process_get_pid function at all.
>>
>> What you should be doing then is using GetProcAddress to dynamically test
>> for
>> the availability of the function. You could also provide two rockpsecs. Or
>> just stop supporting a 12-year old operating system.
>>
>> --
>> tom <tellia...@whoopdedo.org>
>>
>
> I tend to go along with Alexey. But there are some assumptions (for which I 
> do not have the knowledge to verify);
>
> 1) it assumes that Windows has a different way to detect the platform than 
> other platforms. So the windows build systems must be told explicitly what 
> version of windows it is being build on/for. Apparently on *nix this is 
> handled by the buildsystem. Kind a makes sense as Windows usually does binary 
> distribution, where *nix uses mostly source distribution.
>
> 2) it assumes that the standard way of telling the build system what to build 
> for is using `WINVER` and `_WIN32_WINNT`. Are these standard? Are there any 
> others?
>
> 3) it assumes that "target platform == compilation platform" (no cross 
> compilation). This is safe I guess for LR on Windows.

So, for example, when running Windows 7 do you want to build binary
rocks that only work on Windows 7 and above? Given that Windows
usually does binary distribution, I would assume the opposite: that
devs building binary rocks want to set the minimum compatible version
often to something lower than the latest-and-greatest version that
devs usually run.

So, we have these questions:

1) Should LuaRocks add -DWINVER=$(WINVER) automatically to compiler
invocations or should rockspec authors do that?

2) Who should set the LuaRocks variable $(WINVER)? LuaRocks itself
automatically, detecting the Windows version it is running under? The
rockspec author? Or the rockspec user who is building a rock?

In both cases, if the answer to this is "automatically", then those
are incompatible changes to LuaRocks.

Note that for 1) being "rockspec authors" and 2) being "rockspec
user", this is currently possible, by writing in the rockspec
something like:

build = {
   type = "builtin",
   modules = {
      foo = {
         sources = { "foo.c", "bar.c" },
         defines = { "WINVER=$(WINVER)" },
      },

and then in the user's config.lua:

variables = {
   WINVER = "0x502"
}

or even in the luarocks invocation:

luarocks build foo-1.0-1.rockspec WINVER=0x504

(this takes precedence over config.lua).

Note that if the rockspec includes "WINVER=$(WINVER)" but WINVER is
not set anywhere, LuaRocks reports "Warning: unmatched variable
WINVER" and proceeds by passing -DWINVER= (that is, empty).

-- Hisham

------------------------------------------------------------------------------
Introducing Performance Central, a new site from SourceForge and 
AppDynamics. Performance Central is your source for news, insights, 
analysis and resources for efficient Application Performance Management. 
Visit us today!
http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk
_______________________________________________
Luarocks-developers mailing list
Luarocks-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/luarocks-developers

Reply via email to