lua-users home
lua-l archive

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


2012/1/21 KHMan <keinhong@gmail.com>:
> On 1/21/2012 2:28 AM, Roberto Ierusalimschy wrote:
>>>
>>> I stumbled upon a weird behaviour in hexadecimal constants in Lua
>>> 5.2.0 (and LuaJIT 2.0.0-beta8).
>>>
>>> [...]
>>>>
>>>> print(0xE+9)
>>>
>>> stdin:1: malformed number near '0xE+9'
>>> [...]
>>
>>
>> I guess this patch solves the problem:
>>
>> ---------------------------------------------
>> --- llex.c      2011/11/30 12:43:51     2.59
>> +++ llex.c      2012/01/20 18:22:50
>> @@ -223,12 +223,19 @@
>> [snip]
>
>
> Works for me. A different but minor issue appeared when building for mingw.
> When building after changing a single file, make fails because gcc -shared
> is being used as AR and the $? is incorrect when used that way. Only mingw
> seems to be built this way.
>
> Make output:
>
> $ make mingw
> cd src && make mingw
> make[1]: Entering directory `/home/khman/lua/lua-5.2.0/src'
> make "LUA_A=lua52.dll" "LUA_T=lua.exe" \
>        "AR=gcc -shared -o" "RANLIB=strip --strip-unneeded" \
>        "SYSCFLAGS=-DLUA_BUILD_AS_DLL" "SYSLIBS=" "SYSLDFLAGS=-s" lua.exe
> make[2]: Entering directory `/home/khman/lua/lua-5.2.0/src'
> gcc -O2 -Wall -DLUA_COMPAT_ALL -DLUA_BUILD_AS_DLL    -c -o llex.o llex.c
> gcc -shared -o lua52.dll llex.o
> llex.o:llex.c:(.text+0x1f): undefined reference to `luaS_new'
> llex.o:llex.c:(.text+0x4e): undefined reference to `luai_ctype_'
> llex.o:llex.c:(.text+0x68): undefined reference to `luaO_pushfstring'
> ... and so on.
>
>
that's because in lua's makefile generate MinGW dll using a $? sign.
it will work if you try again.

regards,
Xavier Wang.