|
From: Ethan A M. <sf...@us...> - 2011-02-18 20:44:24
|
> 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.
> (line 711)
This line:
AC_SEARCH_LIBS(luaL_openlibs, lua, ...
> In practice this means that the variable LUA_LIBS will be set to "-llua"
> even if it was explicitly overridden on the command line.
That's not what the AC_SEARCH_LIBS macro is supposed to do,
according to its documentation.
It is documented as searching one or more libraries for the requested
function and only adding the library name if it is both found and required.
You can see in the log file that I quoted that it decided
configure:9574: result: none required
I.e. it was able to find the lua routines without adding a new flag -llua
That's because it had already constructed a correct environment by
executing pkgconfig.
The intent is that even if we failed to find or invoke pkgconfig, we can
still test if -llua is sufficient to pull in the library.
> 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.
That is exactly what AC_SEARCH_LIBS is intended to do.
But I'm a novice at autotools; I may have messed up the syntax for using
the macro.
[ goes to re-read the docs and configure.in ...]
OK. That line
LUA_LIBS='-llua'
is quite possibly wrong. But if you remove it, then you also have to
also remove the fourth line below it:
LIBS='$_libs"
Try that to see if it fixes things on your Ubuntu system.
Ethan
|