I am managing gnuplot building in mxe-octave (gnuplot-5.0.3).
In mxe-octave, gnuplot is built without external libraries except for libiconv.
Thus gd, cairo, qt, wxt, ... related stuff omitted by ./configure.
However, behavior for lua is strange.
part of configure 1
checking for LUA... no checking for LUA... no configure: WARNING: Could not find support for lua using pkg-config. checking for library containing luaL_openlibs... -llua5.1 checking lua.h usability... no checking lua.h presence... no checking for lua.h... no configure: WARNING: please add path to lua.h to CPPFLAGS in Makefile
part of configure 2
lua/TikZ terminal: yes
Make failure because lua is missing
-g -O2 -MT term.o -MD -MP -MF $depbase.Tpo -c -o term.o term.c &&\ mv -f $depbase.Tpo $depbase.Po In file included from term.h:414:0, from term.c:1194: ../term/lua.trm:113:17: fatal error: lua.h: No such file or directory #include <lua.h> ^
Workaround is to add --without-lua to the configure option.
But
lua/TikZ terminal: no
is correct response in this case, I think.
The same error happened in gnuplot-4.6.7 but it is obsolated so that I did not make e ticket at that moment.
Diff:
This does not look like a bug to me.
The configure script is telling you that the lua library is present,
but it can not find the matching lua.h file.
There are 2 possible reasons.
1) It could be because you have not installed the *-devel version of the library
to match the library itself
On my machine that is liblua5.2-5.2.3 and lib64lua-devel-5.2.3
but you may have a different version. (The config output you show
mentions lua5.1).
2) Alternatively, you may correctly have the lua.h file installed but it is in
a directory not on the default search path.
That is why the script output suggests
configure: WARNING: please add path to lua.h to CPPFLAGS in Makefile
Of course as you say it is also possible to configure --without-lua
but then you will not be able to use the tikz terminal.
It would be better to install or identify the lua.h file.
Sorry for my explanation is not enogh.
As I wrote, it was the case in build of gnuplot on the mxe-octave but not usual build.
For usual build, I prepare lua and its dev from ubuntu repo and use it.
In this case, the lua is linked without problem.
The mxe-octave system is based on mxe project [1] and it is basically intened to build windows binary of octave and related libraries from source on unix enviroments. It also can be used for native build of octave for special mode and specially build libraries e.g. with large array index.
The mxe-octave is closed system. Libraires are used that are build in the project and external libraires are not used. In mxe-octave gnuplot is build with only two dependence libraries (libiconv and qt) and other libraries are ignored (gd based, cairo based, caca and lua). The gd and cairo based terminals and related libraies and libcaca are ignored at configure even if I installed libraries and header files from the Ubunu repo. But the only lua is not ignored even if it is failed at searching a header file. Of course, printing warning might be intended behavior. But I think that it is natual disabling lua because the failure of lua detection happens at early stage of configure and final out put of configure says " lua/TikZ terminal: no ". But If developers will not chage the behavior, octave team will continue to use confirure script --wihtout-lua.
[1] http://mxe.cc
Last edit: Tatsuro MATSUOKA 2016-05-30
I do not understand from your explanation whether the mxe-octave build environment does or does not contain the lua library. The list of packages at http://mxe.cc does contain lua, but does not mention the lua library separately so I cannot tell from the list is the library is included.
If the environment does contain a lua library, then the autoconfigure script is acting as intended. It tells you that it will include the library but you need to provide a header file.
If the environment does not contain a lua library, then yes there is a bug if the autoconfigure script thinks that it found one.
Sorry for my inadiquate explanation again. The mxe-octave uses MXE system but does not inculde all libraries listed on the MXE project page. The mxe-octave does not choose the lua for octave builld. Then lua is not build in mxe-octave.
For the location of libraries and header file for lua and caca.
liblua
lua.h
For the caca case, which is disabled by configure.
libcaca
caca.h
I cannot understand why situation is different between lua and caca.
OK. So you do have a lua library.
Autoconfigure finds it, as it should
You do not have (or configure could not find) a pkg-config file for lua, soIt tells you that you need to add -I/usr/include/lua5.1 to CFLAGS in order to build.
Does this not work?
I managed the gnuplot.mk (mxe-octave setting file for package) and add CFLAGS=-I/usr/include/lua5.1 to the coufigure part.
logfile tells
lua is included as you told.
OK I admit that it is not a bug.
But why other terminals are rejected by configure but not lua.
Similar waring are represented for gd, cairo, pango ..etcs but behavior for lua is different from them.
Different libraries and packages provide different configuration tools. Some use pkg-config.
libgd uses "gdlib-config". wx uses "wx-config". caca uses "caca-config". In the case of lua, there is no separate tool "lua-config" and the pkg-config script lua lua does not have a standard name so gnuplot cannot guarantee finding it even if there is one. Because we know that this is a common problem and is easy to fix, the configure script prints a warning and suggests how to fix it.
OK. I understand the situation. For mxe-octave, we keep --without-lua at the moment in configure part. I am now prosing on octave ML to build the lua and the cairo based stuffs on mxe-octave because octave supports those terminals in gnuplot graphics toolkit.
Thank for your taking time.
Last edit: Tatsuro MATSUOKA 2016-06-01
See also Bug #2350