On Fri, 2011-02-18 at 10:38 -0800, Ethan A Merritt wrote:
> On Friday, February 18, 2011 10:15:27 am Juhász Péter wrote:
> > Dear list,
> > today I've tried to compile gnuplot (the cvs version) on a fresh Ubuntu
> > 10.10 install. Setting up the necessary packages was relatively
> > straightforward, but when I tried to compile, I've ran into a problem
> > with the lua terminal.
> > This issue is old (it's because Ubuntu calls the package "lua5.1"
> > instead of plain "lua" and this confuses the configure script), there is
> > already a notice about it in the INSTALL file. That notice says that one
> > has to set up a symlink for the package descriptor file:
> > ln -s /usr/lib/pkgconfig/lua5.1.pc /usr/lib/pkgconfig/lua.pc
> > This used to be enough. However, the situation seemed to worsen since
> > that notice was added. If the above symlink is in place, configure finds
> > the package and enables the terminal. On the other hand, make fails,
> > because the linker wants "-llua", and there is no library found by that
> > name.
> Could you pursue this a little further, please?
> The whole idea of finding and executing /usr/lib/pkgconfig/lua5.1.pc
> is that it is supposed to add the correct -Lxxxx term to the linker flags.
> Is the library name wrong in /usr/lib/pkgconfig/lua5.1.pc, or are we
> failing to copy it correctly into the Makefiles, or what?
The root of the problem may be found in configure.in.
Provided that the symlink for the .pc file is in place, the section
responsible for checking lua (lines 690-703 in configure.in) will find
the correct library name.
But then there is a second test for luaL_openlibs (I don't even know
what that is), and that section has the library name "-llua" hardwired.
In practice this means that the variable LUA_LIBS will be set to "-llua"
even if it was explicitly overridden on the command line.
It seems to me that that section in configure.in should be revised: it
shouldn't rewrite LUA_LIBS if it already has a sensible value.