[1/2] Makefile: Install Lua in `exec` stage, not `data`

Message ID 20260624133915.434197-1-valter.jansons@gmail.com
State New
Headers
Series [1/2] Makefile: Install Lua in `exec` stage, not `data` |

Commit Message

Valters Jansons 24 Jun 2026, 1:39 p.m. UTC
Automake installation has two stages:
* `exec` for platform-specific files,
* `data` for platform-agnostic files.

Automake separates the install stages based on the directory (target)
variable name. Built-in targets have known stages. Any custom-defined
ones check simply whether the target name contains `exec` substring.

Currently, the Lua module is installed in the `data` stage, because
`lua` is not considered an `exec` stage name. However, the Lua module
contains C code (it is architecture-specific).

Similar to how Python is installed via `pyexec`, Lua should be
installed via `luaexec`. That way Automake splits it into `exec` stage
correctly.

Internally, the installation target directory is `LUA_INSTALL_CMOD`
which also signals that this is a platform/architecture-specific
installation. This logic remains unchanged, and the Lua `.so` gets
installed to the same target as a result.

This change is also important to allow libtool cleanup to be done in
`install-exec-hook` consistently. Without this change, part of la-files
cleanup would need to be moved to `install-data-hook`.

Ref: https://www.gnu.org/software/automake/manual/html_node/The-Two-Parts-of-Install.html

Signed-off-by: Valters Jansons <valter.jansons@gmail.com>
---
 Makefile.am | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Patch

diff --git a/Makefile.am b/Makefile.am
index c5b8df3..a64a20a 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -230,10 +230,10 @@  src_python__location_la_LIBADD = \
 # ------------------------------------------------------------------------------
 
 if ENABLE_LUA
-lua_LTLIBRARIES = \
+luaexec_LTLIBRARIES = \
 	src/lua/location.la
 
-luadir = $(LUA_INSTALL_CMOD)
+luaexecdir = $(LUA_INSTALL_CMOD)
 
 src_lua_location_la_SOURCES = \
 	src/lua/as.c \