1. 19 Oct, 2020 7 commits
    • Alexandre Janniaux's avatar
      b057448a
    • Alexandre Janniaux's avatar
      configure.ac: look for lua.pc first · e09c48b0
      Alexandre Janniaux authored
      If contrib has been built but is not detected first, contrib includes
      were used but the final binaries were linked to another library.
      
      In particular, on Archlinux, when using the default lua (5.3) version,
      the contrib would be built but it would still link lua5.3 which has no
      symbol for the luaL_register function used when header version is less
      than or equal to 5.2.
      
      Instead, check for lua.pc that has the most opportunity to be the
      lastest on the system and is also the name of the contrib pkg-config
      file when installed.
      e09c48b0
    • Alexandre Janniaux's avatar
      configure.ac: refactor lua detection · 0fd35e34
      Alexandre Janniaux authored
      All checks were nested which was really hard to read and modify
      correctly. Instead use a state variable to track the detection status
      and chain AS_IF condition for each test.
      0fd35e34
    • Alexandre Janniaux's avatar
      contrib: lua: autodetect lua >= 5.1 · 9dc9fed0
      Alexandre Janniaux authored
      When building on ArchLinux currently, the contrib was built even if
      lua5.3 is installed. As at least Archlinux and Debian are exposing both
      a luaX.Y.pc and lua.pc file for the latest supported version of lua,
      detecting that the system version is correct through lua.pc should
      also ensure that the latest compatible version is installed and used
      instead.
      
      The other checks are still needed as you can for example install lua5.2
      (which will expose a lua5.2.pc file but no lua.pc file) without having
      to install lua (5.3).
      
      It is worth noticing that being able to use lua >= 5.1 doesn't mean any
      version of lua >= 5.1 would be compatible. The source code is completely
      compliant to those version and native builds will have no issues with
      using a more recent version, but cross-compilation environment for 32bit
      environment from a 64bit one won't and need the appropriate version to
      be installed.
      9dc9fed0
    • Alexandre Janniaux's avatar
      contrib: lua: fix CC replacement · 0438efa5
      Alexandre Janniaux authored
      The sed command was replacing CC= with CC= and thus doing nothing.
      0438efa5
    • Alexandre Janniaux's avatar
      contrib: lua: namespace lua in a subdirectory · d830b574
      Alexandre Janniaux authored
      ...and rename the library file, linking it with a $(PREFIX) path.
      
      This avoid build issues on ArchLinux where system library could get
      picked but contrib headers would be used anyway, leading to missing
      symbols, though it's a bug if lua contrib is not used while being
      available in the PREFIX.
      
      This also enforce the usage of LUA_CFLAGS/LUA_LIBS and cleans up the
      PREFIX directory.
      d830b574
    • Alexandre Janniaux's avatar
      lua: wrap luaL_register since Lua 5.2 · 1bb98c83
      Alexandre Janniaux authored
      luaL_setfuncs exists since lua5.2 and luaL_register was already
      deprecated at that version. Using the luaL_register since Lua 5.2
      prevents using the deprecated function but mostly also enforce the
      future state of the code to be used on more platforms.
      1bb98c83
  2. 17 Oct, 2020 32 commits
  3. 16 Oct, 2020 1 commit