From 8dcf2bc609809ffedc314c7f22406bdff945582d Mon Sep 17 00:00:00 2001 From: PRESFIL Date: Mon, 7 Jul 2025 11:30:57 +0000 Subject: [PATCH] chore(lua): Use PACKAGE_DATADIR and AM_CPPFLAGS --- src/Makefile.am | 2 +- src/rpc/lua.cc | 4 ++-- src/rpc/lua.h | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 9dee76b5..6b2f1c9a 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -196,4 +196,4 @@ libsub_root_a_SOURCES = \ thread_worker.h -AM_CPPFLAGS = -I$(srcdir) -I$(top_srcdir) +AM_CPPFLAGS = -I$(srcdir) -I$(top_srcdir) -DPACKAGE_DATADIR=\"$(pkgdatadir)\" diff --git a/src/rpc/lua.cc b/src/rpc/lua.cc index e998eb51..d0ba44b3 100644 --- a/src/rpc/lua.cc +++ b/src/rpc/lua.cc @@ -23,12 +23,12 @@ namespace rpc { +#ifdef HAVE_LUA + const int LuaEngine::flag_string; const std::string LuaEngine::module_name = "rtorrent"; const std::string LuaEngine::local_path = LUA_DATADIR "/?.lua;" LUA_DATADIR "/?/init.lua"; -#ifdef HAVE_LUA - LuaEngine::LuaEngine() { m_luaState = luaL_newstate(); luaL_openlibs(m_luaState); diff --git a/src/rpc/lua.h b/src/rpc/lua.h index 584dc38d..f171f751 100644 --- a/src/rpc/lua.h +++ b/src/rpc/lua.h @@ -6,6 +6,7 @@ #ifdef HAVE_LUA #include +#define LUA_DATADIR PACKAGE_DATADIR "/lua" #endif namespace rpc {