lua-users home
lua-l archive

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



> -----Original Message-----
> From: lua-l-bounces@lists.lua.org [mailto:lua-l-bounces@lists.lua.org] On
> Behalf Of Dirk Laurie
> Sent: vrijdag 16 mei 2014 7:46
> To: Lua mailing list
> Subject: Re: Makefile vs LUA_PATH inconsistency
> 
> 2014-05-15 20:47 GMT+02:00 Thijs Schreijer <thijs@thijsschreijer.nl>:
> > When building Lua using MinGW, the following structure is produced;
> >
> > {root}
> >   +-- bin
> >   +-- include
> >   +-- lib
> >   |    +-- lua
> >   |         +-- 5.2
> >   +-- man
> >   |    +-- man1
> >   +-- share
> >        +-- lua
> >             +-- 5.2
> >
> > But checking the default paths; (added some linebreaks for readability)
> > C:\Temp\lua\5.2>bin\lua
> > Lua 5.2.1  Copyright (C) 1994-2012 Lua.org, PUC-Rio
> >> print("PATH: "..package.path .. "\n\nCPATH: " .. package.cpath)
> > PATH:
> > C:\Temp\lua\5.2\bin\lua\?.lua;
> > C:\Temp\lua\5.2\bin\lua\?\init.lua;
> > C:\Temp\lua\5.2\bin\?.lua;
> > C:\Temp\lua\5.2\bin\?\init.lua;
> > .\?.lua
> >
> > CPATH:
> > C:\Temp\lua\5.2\bin\?.dll;
> > C:\Temp\lua\5.2\bin\loadall.dll;
> > .\?.dll
> >>
> >
> > So any files placed in the generated ./lib/lua/5.2/ or ./share/lua/5.2/
> paths will not be found. So the make file is inconsistent with the default
> paths.
> >
> > Shouldn't the default paths be updated to include those locations, and
> make it consistent?
> 
> It has nothing to do with the Makefile. As the manual states,
> default paths are in luaconf.h. The relevant lines are:
> 
> #if defined(_WIN32)     /* { */
> /*
> ** In Windows, any exclamation mark ('!') in the path is replaced by the
> ** path of the directory of the executable file of the current process.
> */
> #define LUA_LDIR        "!\\lua\\"
> #define LUA_CDIR        "!\\"
> #define LUA_PATH_DEFAULT  \
>                 LUA_LDIR"?.lua;"  LUA_LDIR"?\\init.lua;" \
>                 LUA_CDIR"?.lua;"  LUA_CDIR"?\\init.lua;" ".\\?.lua"
> #define LUA_CPATH_DEFAULT \
>                 LUA_CDIR"?.dll;" LUA_CDIR"loadall.dll;" ".\\?.dll"
> 
> Not being a Windows user, I have no idea why it is done this
> way, but others that do have that exquisite privilege may know.

I'm aware of this. But it’s the inconsistency between luaconf.h and the makefile (default behaviors) that I intended to address.

Thijs