lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Am 20.05.2014 12:20 schröbte Thijs Schreijer:
-----Original Message-----
From: lua-l-bounces@lists.lua.org [mailto:lua-l-bounces@lists.lua.org] On
Behalf Of Philipp Janda
Sent: dinsdag 20 mei 2014 12:07
To: lua-l@lists.lua.org
Subject: Re: Makefile vs LUA_PATH inconsistency

What is a default installation on Windows? Do you really want to declare
something a Unix Makefile does on Windows for one particular compiler by
accident to be the default for Windows?
The Unix paths aren't even a good fit on Windows (e.g. the lua5x.dll
must be in the same directory as the executable or at least in PATH, and
not in a lib subdirectory), and every compiler already has its own set
of paths where it looks for include files or libraries.

Someone mentioned MS had rules for the locations of modules, scripts,
etc. I'd rather see those locations added on Windows (or use the paths
from LfW or LuaDist), so that you can write an installer for Lua that
fits well with the rest of the Windows ecosystem (although an installer
could just as easily set environment variables and/or use the paths
relative to the executable).


I don't want to make any defaults, I don't want Windows to look like unix. I totally agree with everything you say, but....

It's impossible to NOT have a default, and as long as we get one along with the Lua package, can we at least make that one work out-of-the-box?

Have a look here [1]. I put the proposed changes in a github repo. The changes do not hurt anyone, but they do fix the default Windows behaviour.

What default Windows behavior? Are we still talking about the install target of the Unix Makefile that also happens to work for MinGW? And it seems you *do* want to declare that behavior the default on Windows. Are you using MSYS by any chance? It seems that plain MinGW doesn't have `rm` or `install` executables (or a `mkdir` that understands `-p`), so you really have to work hard to make the install target work for MinGW ... Also you should probably avoid GNU make features or you will break the Makefile for some Unixes. And I think you are missing some `.exe` file extensions in the modified install target.


Besides path updates in `luaconf.h`, fixes the makefile to include the dll upon installation, and fixes `make clean` to remove the .exe and .dll files. Fixes the Visual Studio build to have LUA_COMPAT_ALL, as on all other platforms, and includes a `luavsinstall.bat` batch file that mimics `make install` for the Visual Studio build.

It's not very Windowish, but it doesn't hurt anyone, stays close to other platforms, fixes several flaws, and most of all; makes Windows work on the defaults.

Thijs


[1] https://github.com/Tieske/lua52/pull/1


Philipp