fixed glava-config LuaJIT builds, stripping

This commit is contained in:
Jarcode
2019-09-09 20:54:57 -07:00
parent 05067c74ed
commit a17151dd5d
2 changed files with 29 additions and 15 deletions

View File

@@ -10,6 +10,10 @@
#define GLAVA_LUA_ENTRY "glava-config.main" #define GLAVA_LUA_ENTRY "glava-config.main"
#define GLAVA_LUA_ENTRY_FUNC "entry" #define GLAVA_LUA_ENTRY_FUNC "entry"
#ifndef LUA_OK
#define LUA_OK 0
#endif
/* Should be already defined by Meson */ /* Should be already defined by Meson */
#ifndef GLAVA_RESOURCE_PATH #ifndef GLAVA_RESOURCE_PATH
#define GLAVA_RESOURCE_PATH "../resources" #define GLAVA_RESOURCE_PATH "../resources"

View File

@@ -96,10 +96,6 @@ if not get_option('disable_config')
luac_input_ext = 'lua' luac_input_ext = 'lua'
luac_output_ext = 'lua' luac_output_ext = 'lua'
luac_args = ['-o', '@OUTPUT@', '@INPUT@']
if not get_option('buildtype').startswith('debug')
luac_args += '-s'
endif
glava_config_lua_sources = run_command( glava_config_lua_sources = run_command(
'find', 'glava-config', '-type', 'f', '-name', '*.' + luac_input_ext, '-print' 'find', 'glava-config', '-type', 'f', '-name', '*.' + luac_input_ext, '-print'
).stdout().strip().split('\n') ).stdout().strip().split('\n')
@@ -109,12 +105,27 @@ if not get_option('disable_config')
).stdout().strip().split('\n') ).stdout().strip().split('\n')
glava_config_lua_targets += s + '.' + luac_output_ext glava_config_lua_targets += s + '.' + luac_output_ext
endforeach endforeach
luac_name = 'luac' + get_option('lua_version') luac_name = 'luac' + get_option('lua_version')
luac_impl = get_option('lua_implementation') luac_args = ['-o', '@OUTPUT@', '@INPUT@']
lua_dir = get_option('lua_implementation')
lua_ver = get_option('lua_version')
lua_impl = get_option('lua_implementation')
lua_inc = get_option('lua_implementation') + get_option('lua_version')
if get_option('lua_implementation') == 'luajit' if get_option('lua_implementation') == 'luajit'
# LuaJIT compiler produces better bytecode; use that
luac_name = 'luajit' luac_name = 'luajit'
luac_impl += '-' lua_impl += '-'
luac_args = ['-b', '@INPUT@', '@OUTPUT@']
if get_option('buildtype').startswith('debug')
luac_args += '-g'
endif
# LuaJIT uses /usr/share/lua/5.1; ignore version
lua_dir = 'lua'
lua_ver = '5.1'
lua_inc = 'luajit-2.0'
elif not get_option('buildtype').startswith('debug')
luac_args = ['-s'] + luac_args
endif endif
luac_target = custom_target( luac_target = custom_target(
@@ -122,25 +133,24 @@ if not get_option('disable_config')
input: generator( input: generator(
find_program(luac_name), find_program(luac_name),
output: '@BASENAME@.' + luac_output_ext, output: '@BASENAME@.' + luac_output_ext,
arguments: ['-o', '@OUTPUT@', '@INPUT@']).process(glava_config_lua_sources), arguments: luac_args).process(glava_config_lua_sources),
output: glava_config_lua_targets, output: glava_config_lua_targets,
command: [find_program('cp'), '-t', '@OUTDIR@', '@INPUT@'], command: [find_program('cp'), '-t', '@OUTDIR@', '@INPUT@'],
build_by_default: true, build_by_default: true,
install: true, install: true,
install_dir: get_option('lua_install_dir') + '/' + install_dir: get_option('lua_install_dir') + '/' + lua_dir + '/'
get_option('lua_implementation') + '/' + + lua_ver + '/' + 'glava-config')
get_option('lua_version') + '/' +
'glava-config')
executable( executable(
'glava-config', 'glava-config',
install: true, install: true,
sources: 'glava-config/entry.c', sources: 'glava-config/entry.c',
c_args: '-I/usr/include/' + lua_inc,
dependencies: [ dependencies: [
cc.find_library('X11'), cc.find_library('X11'),
cc.find_library('lua') cc.find_library(lua_impl + lua_ver)
]) ])
# Local glava-config environment symlink for standalone execution # Local glava-config environment symlink for standalone execution
if get_option('standalone') if get_option('standalone')
env_target = custom_target( env_target = custom_target(