[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: luac and import library for dll are not built (mingw)
- From: Doug Currie <doug.currie@...>
- Date: Fri, 17 Feb 2006 16:46:54 -0500
Friday, February 17, 2006, 4:28:25 PM, nusret wrote:
> If I understand correctly, these alterations amount to
> exporting all the symbols in the lua51.dll, right?
Right, and you can accomplish this simply by changing the
mingw target in src/Makefile to
mingw:
$(MAKE) "LUA_A=lua51.dll" "LUA_T=lua.exe" "LUAC_T=luac.exe" \
"AR=$(CC) -shared -Wl,--export-all-symbols -o" "RANLIB=strip --strip-unneeded" \
"MYCFLAGS=-DLUA_BUILD_AS_DLL" "MYLIBS=" "MYLDFLAGS=-s" all
e
> --- Carlos Smith <carlos.smith@sympatico.ca> wrote:
>> ----- Original Message -----
>> From: "nusret" <nbalci_l@yahoo.com>
>> To: <lua@bazar2.conectiva.com.br>
>> Sent: Sunday, February 12, 2006 2:24 PM
>> Subject: luac and import library for dll are not
>> built (mingw)
>>
>> You probably know that, but if you add
>>
>> #if defined(__CYGWIN__) || defined(__MINGW32__)
>> #undef LUA_API
>> #undef LUALIB_API
>> #undef LUAI_FUNC
>> #undef LUAI_DATA
>> #define LUA_API extern
>> #define LUALIB_API extern
>> #define LUAI_FUNC extern
>> #define LUAI_DATA extern
>> #endif
>>
>> to the Local configuration section at the end of
>> luaconf.h
>>
>> and then modifying the Makefile in src directory
>>
>> clean:
>> $(RM) $(ALL_T) $(ALL_O) lua.exe luac.exe lua51.dll
>> liblua51.dll.a
>> liblua51.a
>>
>> ...
>>
>> mingw: lua51.dll
>> # gcc -O2 -Wall -Wl,--enable-auto-import lua.c -o
>> lua.exe -s lua51.dll
>> # gcc -O2 -Wall -Wl,--enable-auto-import luac.c
>> print.c -o luac.exe -s
>> lua51.dll
>> gcc -O2 -Wall -L. -Wl,--enable-auto-import lua.c -o
>> lua.exe -s -llua51.dll
>> gcc -O2 -Wall -L. -Wl,--enable-auto-import luac.c
>> print.c -o
>> luac.exe -s -llua51.dll
>>
>> lua51.dll: $(CORE_O) $(LIB_O)
>> gcc $(CFLAGS) -DLUA_BUILD_AS_DLL $(CORE_O) $(LIB_O)
>> \
>> -Wl,--out-implib=liblua51.dll.a -shared -o
>> lua51.dll -lm
>> strip --strip-unneeded lua51.dll
>>
>>
>> you will be able to build
>> lua.exe and luac.exe by linking against the .dll or
>> the import lib.
>>
>> I tried it, and it works both under Mingw32/Msys
>> and CygWin.
>>
>> In both cases, the command: make mingw
>> build everything Ok.
>>
>> The command is executed und the WinXP cmd.exe shell.
>> (Of course PATH has been SET ok)
>>
>> Carlos
>>
>>
--
Doug Currie
Londonderry, NH