[vlc-devel] [PATCH] Make sure we use the correct luac version when using contribs
Rafaël Carré
funman at videolan.org
Fri Jan 25 16:46:52 CET 2013
Le 25/01/2013 15:15, Rémi Denis-Courmont a écrit :
> Le vendredi 25 janvier 2013 14:49:35, Rafaël Carré a écrit :
>> Le 25/01/2013 13:34, Rémi Denis-Courmont a écrit :
>>> Le vendredi 25 janvier 2013 06:32:06, Rafaël Carré a écrit :
>>>> ---
>>>>
>>>> configure.ac | 3 +++
>>>> 1 file changed, 3 insertions(+)
>>>>
>>>> diff --git a/configure.ac b/configure.ac
>>>> index 02eb758..b1bd38e 100644
>>>> --- a/configure.ac
>>>> +++ b/configure.ac
>>>> @@ -1524,6 +1524,9 @@ then
>>>>
>>>> AS_IF([test "${LUAC}" = "false"], [
>>>>
>>>> AC_MSG_ERROR([Could not find the LUA byte compiler.])
>>>>
>>>> ])
>>>>
>>>> + AS_IF([test -f ${CONTRIB_DIR}/lib/liblua.a -a `${LUAC} -o /dev/stdout
>>>> /dev/stdin | od -h | head -1 |cut -d' ' -f6` != 0404], [ +
>>>> AC_MSG_ERROR([You need 32-bits luac when using using lua from contrib.])
>>>> +
>>>>
>>>> ])
>>>> fi
>>>> AM_CONDITIONAL(BUILD_LUA, [test "${have_lua}" = "yes"])
>>>
>>> I very much doubt configure can rely on od, head and/or cut being
>>> available and compatible with GNU ones.
>>
>> We can use od in octal and head -n 1
>
> That's fine with me because I only care about building from POSIX systems. But
> maybe some (build) platforms which I don't care about would still break.
We can always add od/head/coreutils to extras/tools :)
More seriously, libav uses od and head in its configure so we are quite
safe.
> Also what if there is a lua build in the contrib directory, but configure ends
> up linking with another one? (That's definitely happened to me on native Linux
> builds.)
Hm I was under the impression that contrib takes precedence (when I had
ubuntu liblive installed but used the contrib version).
I would guess we can ignore that side problem, and assume people who use
contrib on native systems (not cross compiling) know what they are doing.
>>> Furthermore I guess the check breaks big endian builds (PPC).
>>
>> Why? the fields extracted should be sizeof(int) and sizeof(size_t), does
>> PPC have sizeof int == 8?
>
> Hmm OK, the check works to ensure byte size.
> It leaves unfixed the case of mismatched endianess though :-(
Right but except binary inspection of liblua.a not sure what we can do.
Who are our main big endian users without lua packaging now that we
ditched OSX/PPC ?
More information about the vlc-devel
mailing list