On 05/25/2015 01:02 AM, Daurnimator wrote: > On 25 May 2015 at 01:36, Dimitris Papavasiliou<dpapa...@gmail.com> wrote: >> Hi, >> >> I'm trying to create a rockspec for a project, which provides a REPL >> prompt, both as a Lua module, as well as a standalone binary. I'm using >> the Makefile backend, as the built-in backend seems incapable of >> building anything but shared libraries, but I can't seem to find a way >> to pass the actual Lua library name to the Makefile (e.g. pass lua5.2 >> via some variable to the Makefile, so that I can then specify -llua5.2 >> to the linker). >> >> Since LuaRocks provides Lua include and library directories, according >> to the version it was configured with, I suppose it must somehow be able >> to pass the lua library name as well. The only likely variable I can >> find in the documentation is LUALIB, but this is not defined in my >> installation and a glance at cfg.lua seems to indicate it's only >> available on Windows. >> >> Is there some way I can distribute my binary together with my module? >> The notion seems to be supported as there is the INST_BINDIR variable to >> point to the proper target directory. >> >> Any help would be greatly appreciated, >> Dimitris > > Have you seen > https://github.com/keplerproject/luarocks/wiki/Creating-a-Makefile-that-plays-nice-with-LuaRocks
I have. It only mentions that LUALIB is not available or needed in all platforms. My understanding is that it's only needed in Windows, presumably because you can't ask the linker to resolve undefined symbols in a library from the exported symbols of the executable. I've also read any other documentation I could find, and I've tried to search the archives. I don't think LuaRocks tries to figure out the Lua library name, as it has no need of it, unless on Windows. I propose though, that building auxiliary binaries which somehow depend on Lua, can be argued to fall within the scope of a Lua package manager, if not for my use-case, which is not strictly a module, at least for modules which might depend on such binaries. Furthermore I don't think it would be too hard to add, as other Lua-related variables, such as LUA_INCDIR seem to be set, without any magic, in site_config.lua and mechanisms for deriving the platform-specic name of a library already exist. Another possibility, would be to depend on exisiting tools like pkg-config, for building auxiliary executables or libraries which depend on Lua. I'd consider this worse, as then there would be two sources of information on how to configure the compiler to build the various components of the rock. Even in this case though, one would need to somehow have access to the currently configured Lua version (5.1, 5.2, 5.3 or jit). Does such a variable exist in LuaRocks? It seems useful as well, in case someone would want to make a multi-version Makefile, handling each version a little differently. Dimitris ------------------------------------------------------------------------------ One dashboard for servers and applications across Physical-Virtual-Cloud Widest out-of-the-box monitoring support with 50+ applications Performance metrics, stats and reports that give you Actionable Insights Deep dive visibility with transaction tracing using APM Insight. http://ad.doubleclick.net/ddm/clk/290420510;117567292;y _______________________________________________ Luarocks-developers mailing list Luarocks-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/luarocks-developers