diff options
| author | Tobiasz Laskowski <tobil4sk@outlook.com> | 2026-02-15 14:53:13 +0000 |
|---|---|---|
| committer | Hisham Muhammad <hisham@gobolinux.org> | 2026-07-11 22:13:55 -0300 |
| commit | 0e90c184ef44dae80be747983e27c6940fbea3b9 (patch) | |
| tree | 23c9a94aa0941ff057084ddab16c6102d5c0a348 /binary/Makefile.windows | |
| parent | 07f675b5373e0c88b4930e2459e665f5678c2e5e (diff) | |
| download | luarocks-0e90c184ef44dae80be747983e27c6940fbea3b9.tar.gz luarocks-0e90c184ef44dae80be747983e27c6940fbea3b9.tar.bz2 luarocks-0e90c184ef44dae80be747983e27c6940fbea3b9.zip | |
docs: Fix LUA_LIBDIR handling in example Makefile
See: #1257
On most platforms LUA_LIBDIR is empty, so you get:
Warning: unmatched variable LUA_LIBDIR
And the resulting empty -L flag in the example can cause issues like:
ld: warning: search path '-lpthread' not found
It's also not sufficient to pass the -L flag, you also have to provide the actual library to link.
I've updated the example to only set LUA_LIBDIR for windows where it is used by default. However, as noted in it is possible to do:
luarocks config link_lua_explicitly true
It would be better to respect this setting rather than hard-coding windows only, but I'm not sure the best way to check that config in the rockspec, I wonder if anyone else has any suggestions?
[docs] Use implicit rules in example makefile
See:
https://www.gnu.org/software/make/manual/html_node/Catalogue-of-Rules.html#index-C_002c-rule-to-compile
https://www.gnu.org/software/make/manual/html_node/Catalogue-of-Rules.html#index-linking_002c-predefined-rule-for
https://www.gnu.org/software/make/manual/html_node/Implicit-Variables.html#index-CPPFLAGS
https://www.gnu.org/software/make/manual/html_node/Implicit-Variables.html#index-LDFLAGS
[docs] Fix LUA_LIBDIR handling in makefile example
The example setup given here gives this warning on most systems:
```
Warning: unmatched variable LUA_LIBDIR
```
Also, you get an empty `-L` flag, which one some compilers will eat the
following flag, causing issues, e.g.
```
ld: warning: search path '-lpthread' not found
```
This is because most environments do not require explicit linking of
LUALIB, so it LUA_LIBDIR not set.
This patch fixes the sample by only setting `LUA_LIBDIR` when it
is actually needed, i.e. on windows.
[docs] Fix example makefile for windows
On windows, LUALIB is set to e.g. `lua51.dll`, which is the full name
and does not work with `-llua51.dll`. Passing the full path here allows
it to be linked properly.
Another option is `-l:$(LUALIB)` to specify the full file name, but some
linkers do not support that syntax.
[docs] Fix broken formatting due to unescaped $
[docs] Highlight makefile syntax
[docs] Use consistent whitespace
Fixes markdown warnings about hard tabs
Diffstat (limited to 'binary/Makefile.windows')
0 files changed, 0 insertions, 0 deletions
