luasocket
luasocket copied to clipboard
Numerous problems with make PLAT=win32
I was eventually able to compile with the makefile for PLAT=win32 but I had to make a few changes to the make file and provide a few overrides to do it:
In src/makefile: First, there is a reference to LUASOCKET_CFLAGS, which is undefined. This should be CFLAGS_win32 (https://github.com/diegonehab/luasocket/blob/321c0c9b1f7b6b83cd83b58e7e259f53eca69373/src/makefile#L228) Second, the LDFLAGS specify MACHINE:X86, which is unnecessary and prevents building against x64. I simply removed this flag (https://github.com/diegonehab/luasocket/blob/321c0c9b1f7b6b83cd83b58e7e259f53eca69373/src/makefile#L220) Finally, having the version number after the .dll causes the linker not to generate the dll at all. For this I just overrode SOCKET_SO and MIME_SO when specifying make. (https://github.com/diegonehab/luasocket/blob/321c0c9b1f7b6b83cd83b58e7e259f53eca69373/src/makefile#L237)
Ultimately documentation would go a long way to helping the process as well. For reference I used msys2 launched from the visual studio x64 tools command prompt.