[vlc-devel] luac 32 bits?

Gilles Sabourin gilles.sabourin at free.fr
Sat Mar 19 18:16:01 CET 2016


Le samedi 19 mars 2016, 12:07:37 Sean McGovern a écrit :
Hi Sean,

> Hi Gilles,
> 
> On Mar 19, 2016 11:16, "Gilles Sabourin" <gilles.sabourin at free.fr> wrote:
> > Hello,
> > 
> > Feel free to explain how you can detect anything other than luac 32 bits
> > components in a 32 bits virtual machine (openSUSE) ...
> > 
> > FYI, lua 5.1 / 5.2 are both installed in that VM.
> > 
> > Regards,
> > Gilles
> 
> The build system itself does not know if it is building for a 32 or 64 bit
> host.

Yeah, but the error message that you dropped in your answer :
"configure: error: You need 32-bits luac when using lua from contrib."
told about architecture. Does it assume that lua architecture is wrong because 
tests are failing?

Previously, the last test assumed that lua requirements were passed: it used 
to compile, until recently, where lua logic have been heavily reworked last 
16th march.

OpenSUSE packagers have integrated lua in a special way, as lua can point to 
lua 5.1 or lua 5.2 according to upper configuration managed by update-
alternatives:

# update-alternatives --list lua
/usr/bin/lua5.1
/usr/bin/lua5.2

> What the failing test does do is check if the copy of Lua it found is
> capable of handling 32 or 64 bit integers. Support for 64 bit integers in
> Lua is  new feature for Lua 5.3+, so now the test in configure needs to be
> fixed to address that.
> 
> With that said, if you are not using the Lua 5.3 from contribs,

I always build all the contribs, see below an extract of my own rpm spec file : 

%build
echo '***** BOOTSTRAPPING CONTRIB *****'
date
#
mkdir contrib/native
pushd contrib/native
../bootstrap
%{__make}
popd

echo '********* BOOTSTRAPPING *********'
date
./bootstrap
%configure \
   --disable-dependency-tracking        \
   --enable-a52                         \
   -- enable-lua				\
[...]

> your system
> should not be running that test in the first place. Are you possibly
> missing the .pc files for 5.1 and/or 5.2?

With lua packaged that way, pkg-config itself is not sufficient to return any 
useful version information :

vbureau132:~ # pkg-config --libs lua
-llua -lm -ldl 
vbureau132:~ # pkg-config --cflags lua
<empty>

lua libraries are not packaged with any .pc, so, in my case, every test will 
fail in in configure.ac :

dnl Lua modules
AC_ARG_ENABLE(lua,
  [AS_HELP_STRING([--disable-lua],
    [disable LUA scripting support (default enabled)])])
if test "${enable_lua}" != "no"
then
  PKG_CHECK_MODULES(LUA, lua5.2,
    [ have_lua=yes ],
    [
    AC_MSG_WARN([${LUA_PKG_ERRORS}, trying lua 5.1 instead])
    
    PKG_CHECK_MODULES(LUA, lua5.1,
      [ have_lua=yes ],
      [
      AC_MSG_WARN([${LUA_PKG_ERRORS}, trying lua >= 5.1 instead])
      PKG_CHECK_MODULES(LUA, lua >= 5.1,
        [ have_lua=yes ],
        [ 
          AC_MSG_WARN([${LUA_PKG_ERRORS}, trying manual detection instead])
          have_lua=yes
          AC_CHECK_HEADERS([lua.h lauxlib.h lualib.h],
            [],
            [ have_lua=no ] )
          AC_CHECK_LIB(  lua5.2 , luaL_newstate,
            [LUA_LIBS="-llua5.2"],
          AC_CHECK_LIB( lua5.1 , luaL_newstate,
            [LUA_LIBS="-llua5.1"],
            AC_CHECK_LIB( lua51 , luaL_newstate,
              [LUA_LIBS="-llua51"],
              AC_CHECK_LIB( lua , luaL_newstate,
                [LUA_LIBS="-llua"],
                [ have_lua=no
                ], [-lm])
            )))
        ])
      ])
    ])
  if test "x${have_lua}" != "xyes" ;  then
      AC_MSG_ERROR([Could not find lua. Lua is needed for some interfaces (rc, 
telnet, http) as well as many other custom scripts. Use --disable-lua to 
ignore this error.])
  fi
[...]

So, I guess that lua 5.3 is in the contribs, but either the tests in 
configure.ac don't take it into account yet / or lua 5.3 contribs does not 
compile for any reason, because I do not prevent anything to work from my 
side, unless luac 5.3 compiler is required, but missing in good old openSUSE 
13.2?

> 
> -- Sean McG.

Thanks for your reply,
Gilles


More information about the vlc-devel mailing list