[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: How to do it in portable way
- From: Fontana Nicola <ntd@...>
- Date: Sun, 07 Feb 2021 16:27:04 +0100
Il giorno dom, 07/02/2021 alle 09.57 +0100, Milan Obuch ha scritto:
> Hi,
>
> my first and the only, for now, project using Lua is Lua plugin for
> Claws Mail. I did develop it on FreeBSD with some hardwired paths for
> Lua library location and similar, using Lua 5.2. I'd like to ask how to
> make it portable for other platform, using other version of Lua if
> desired, and avoid hardwired paths.
>
> Currently, I have Makefile.am containing two targets with hardwired
> items, namely
>
> lua_la_LIBADD = $(cygwin_export_lib) \
> $(GTK_LIBS) \
> -L/usr/local/lib -llua-5.2
>
> lua_la_CPPFLAGS = \
> -I$(top_srcdir)/src \
> -I$(top_builddir)/src/common \
> -I$(top_srcdir)/src/common \
> -I$(top_srcdir)/src/gtk \
> $(GLIB_CFLAGS) \
> $(GTK_CFLAGS) \
> $(ENCHANT_CFLAGS) \
> -I/usr/local/include/lua52
>
> In global configure, I added --disable-lua-plugin and
> --enable-lua-plugin options, but they are doing just this, allowing my
> plugin to build, but I'd like to add there some logic (I am tempted to
> write magic) to define $(LUA_LIBS) and $(LUA_CFLAGS) so I can use them
> in Makefile.am instead of hardwired values.
Hi Milan,
if you are using autoconf you can check ax_lua:
https://github.com/autoconf-archive/autoconf-archive/blob/master/m4/ax_lua.m4
This will define the `LUA_INCLUDE` precious variable that can be used
in the same way you are using `GTK_CFLAGS`.
It is far from perfect (there are some hardcoded values in that script
that try to circumvent the incompatibilities between distros) but IMO
it is the best workaround we have right now.
Ciao.
--
Nicola