Compiling LfW libraries

13 views
Skip to first unread message

Marc Assin

unread,
Sep 14, 2015, 9:43:16 AM9/14/15
to luaforwindows
Hi,

Although chances are this forum is dead, i'll try.


I'm willing to compile the Lua libraires under gcc Windows, but the packages are without the makefile.

Anyone having a sample makefile for any Lua library and willing to share it ?

I tried to adapt the Linux makefile, but ..... I got lost

 

Thank you

 

Raymond

RJP Computing

unread,
Sep 14, 2015, 10:35:04 AM9/14/15
to luaforwindows
Hi Marc,

That is the main reason Lua for Windows only relied on prebuilt modules. Because I had problems building them.

You can look at any of the Makefiles from lhf modules: http://webserver2.tecgraf.puc-rio.br/~lhf/ftp/lua/index.html
They are normally simple and well written.

I would also suggest using LuaRocks. It seems to be supported in many/most modules.
--
Regards,
Ryan

Peter Drahoš

unread,
Sep 14, 2015, 10:43:36 AM9/14/15
to luafor...@googlegroups.com
Hello Marc,
all LuaDist packages contain CMakeLists.txt which are used by the CMake tool to generate platform specific makefiles or IDE projects etc. Generally you just need to run CMake[1], for example:

> cd any_luadist_module
> # Make a build dir so sources are left alone
> mkdir _build && cd _build
> # Tell CMake to use CMakeLists.txt from the sources and generate MinGW makefiles. Also set destination prefix for install
> cmake .. -G”MinGW Makefiles” -DCMAKE_INSTALL_PREFIX=../_install
> # Build the project and install. Alternatively you can call “make”/“make install"
> cmake —build . —target install

Without all dependencies present CMake will complain that the build in incomplete and you have to provide all the dependencies yourself while pointing cmake to the files using -D[VARIABLE]=[VALUE] notation similar to the CMAKE_INSTALL_PREFIX setting.

Ideally you should use the “luadist” tool that comes with the luadist binaries as it greatly simplifies this. The tool needs CMake and a supported compiler to be installed on the host but compared to the above process it will automatically install all dependencies also.

> # The basic use case is
> luadist [destination_path] install [module_names]
> # for example installing Lua5.2 and lfs, luasocket modules from source only is as simple as running
> luadist C:/Lua-5.2 install lua-5.2 luafilesystem luasocket —source=true —binary=false

For more information please check out the wiki[2].

pd

[1] www.cmake.org
[2] https://github.com/LuaDist/Repository/wiki
> --
> You received this message because you are subscribed to the Google Groups "luaforwindows" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to luaforwindow...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

signature.asc

Marc Assin

unread,
Sep 15, 2015, 2:24:55 PM9/15/15
to luaforwindows
Le lundi 14 septembre 2015 16:35:04 UTC+2, RJP Computing a écrit :
You can look at any of the Makefiles from lhf modules: http://webserver2.tecgraf.puc-rio.br/~lhf/ftp/lua/index.html

 Hi Ryan,
Thank you for the pointer, looks good

Raymond

Reply all
Reply to author
Forward
0 new messages