From 65410e9d17a98e9fb410b195806eeab752bbcbc5 Mon Sep 17 00:00:00 2001 From: Wonki Kim Date: Thu, 14 Feb 2019 10:25:09 +0000 Subject: [PATCH] meson: add a option for selecting lua interpreter this patch is for selecting lua interpreter such as luajit, lua51 and in addition, little more changes to unify lua dependency over efl Reviewed-by: Marcel Hollerbach Differential Revision: https://phab.enlightenment.org/D7564 Change-Id: I8f0d072d124638510c5245904b474da0aef0457d Signed-off-by: Wonki Kim --- meson.build | 2 +- meson_options.txt | 7 +++++++ src/bin/edje/meson.build | 2 +- src/lib/edje/meson.build | 7 +++---- src/lib/elua/meson.build | 2 +- src/lib/evas/filters/meson.build | 35 ++++++++++++++++++++++++++++------- src/lib/evas_goal/meson.build | 4 ++-- 7 files changed, 43 insertions(+), 16 deletions(-) diff --git a/meson.build b/meson.build index 0e2a50c..eac614b 100644 --- a/meson.build +++ b/meson.build @@ -280,7 +280,7 @@ subprojects = [ ['efreet' ,[] , false, false, true, false, false, false, ['eina', 'efl', 'eo'], []], ['ecore_imf_evas' ,[] , false, true, false, false, false, false, ['eina', 'efl', 'eo'], []], ['ephysics' ,['physics'] , false, true, false, false, false, false, ['eina', 'efl', 'eo'], []], -['edje' ,[] , false, true, true, false, true, true, ['evas', 'eo', 'efl', 'luajit'], []], +['edje' ,[] , false, true, true, false, true, true, ['evas', 'eo', 'efl', get_option('lua-interpreter')], []], ['emotion' ,[] , true, true, false, false, true, true, ['eina', 'efl', 'eo'], []], ['ethumb' ,[] , true, true, true, false, false, false, ['eina', 'efl', 'eo'], []], ['ethumb_client' ,[] , false, true, true, false, false, true, ['eina', 'efl', 'eo', 'ethumb'], []], diff --git a/meson_options.txt b/meson_options.txt index fdc4344..9fd921d 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -323,6 +323,13 @@ option('mono-beta', description: 'Flag for enabling @beta Eo methods in the api' ) +option('lua-interpreter', + type: 'combo', + choices: ['luajit', 'lua'], + value: 'luajit', + description: 'Select a type of lua interpreter to use it for edje and evas' +) + option('native-arch-optimization', type: 'boolean', value: true, diff --git a/src/bin/edje/meson.build b/src/bin/edje/meson.build index 89d6382..9269d33 100644 --- a/src/bin/edje/meson.build +++ b/src/bin/edje/meson.build @@ -2,7 +2,7 @@ subdir('epp') edje_bin_deps = [ eina, eo, efl, m, - luajit, eet, evas, + lua, eet, evas, ecore_file, ecore_input, ecore_imf, ecore_imf_evas, embryo, efreet, eio, diff --git a/src/lib/edje/meson.build b/src/lib/edje/meson.build index 393383f..549553f 100644 --- a/src/lib/edje/meson.build +++ b/src/lib/edje/meson.build @@ -1,13 +1,12 @@ edje_deps = [ eina, eo, efl, m, - luajit, eet, evas, ecore_evas, + eet, evas, ecore_evas, ecore_file, ecore_input, ecore_imf, ecore_imf_evas, embryo, efreet, eio, intl ] - -edje_pub_deps = [m, evas, eo, efl, luajit] +edje_pub_deps = [m, evas, eo, efl, lua] if (get_option('physics')) edje_deps += ephysics @@ -151,7 +150,7 @@ edje_src = [ edje_lib = library('edje', edje_src, pub_eo_file_target, priv_eo_file_target, - dependencies: [edje_deps], + dependencies: edje_pub_deps + edje_deps, include_directories : config_dir + [include_directories('.')], install: true, c_args : [package_c_args], diff --git a/src/lib/elua/meson.build b/src/lib/elua/meson.build index 7e0c3af..9f1d270 100644 --- a/src/lib/elua/meson.build +++ b/src/lib/elua/meson.build @@ -1,5 +1,5 @@ elua_deps = [eina, eo, efl, ecore, ecore_file, intl] -elua_pub_deps = [luajit] +elua_pub_deps = [dependency('luajit')] elua_src = ['elua.c', 'io.c', 'cache.c'] elua_header_src = ['Elua.h'] diff --git a/src/lib/evas/filters/meson.build b/src/lib/evas/filters/meson.build index 019b1d1..78c896d 100644 --- a/src/lib/evas/filters/meson.build +++ b/src/lib/evas/filters/meson.build @@ -7,13 +7,34 @@ evas_src += files([ 'evas_filter_utils.c', ]) -luajit = dependency('luajit') -if sys_osx == true -# luajit on macos is broken, this means we need to generate our own dependency with our arguments, a library later still needs to link to luajit for the pagesize argument thingy - luajit = declare_dependency( - include_directories: include_directories(luajit.get_pkgconfig_variable('includedir')), - link_args: ['-L'+luajit.get_pkgconfig_variable('libdir'), '-l'+luajit.get_pkgconfig_variable('libname')] +luaold_interpreters = [ + ['lua', ['>=5.1.0','<5.3.0']], + ['lua51', ['>=5.1.0','<5.2.0']], + ['lua-5.1', ['>=5.1.0','<5.2.0']], + ['lua5.1', ['>=5.1.0','<5.2.0']], + ['lua52', ['>=5.2.0','<5.3.0']], + ['lua-5.2', ['>=5.2.0','<5.3.0']], + ['lua5.2', ['>=5.2.0','<5.3.0']], +] + +if get_option('lua-interpreter') == 'lua' + config_h.set('ENABLE_LUA_OLD', '1') + foreach l : luaold_interpreters + lua = dependency(l[0], version: l[1], required:false) + if lua.found() == true + break + endif + endforeach +else + lua = dependency(get_option('lua-interpreter')) +endif + +if sys_osx == true and get_option('lua-interpreter') == 'luajit' +# luajit on macro is broken, this means we need to generate our own dependency with our arguments, a library later still needs to link to luajit for the pagesize argument thingy + lua = declare_dependency( + include_directories: include_directories(lua.get_pkgconfig_variable('includedir')), + link_args: ['-L'+lua.get_pkgconfig_variable('libdir'), '-l'+lua.get_pkgconfig_variable('libname')] ) endif -evas_deps += luajit +evas_deps += lua diff --git a/src/lib/evas_goal/meson.build b/src/lib/evas_goal/meson.build index 60426ad..5746006 100644 --- a/src/lib/evas_goal/meson.build +++ b/src/lib/evas_goal/meson.build @@ -17,7 +17,7 @@ evas = declare_dependency( evas_bin = declare_dependency( link_with : [evas_lib], - dependencies : [eina, ecore, ector, emile, dependency('luajit')], + dependencies : [eina, ecore, ector, emile, lua], include_directories : evas_include_directories ) @@ -32,5 +32,5 @@ pkgconfig.generate(evas_lib, name : 'evas', subdirs : ['evas-'+version_major] + tmp_package_subdirs, version : version_major + '.' + version_minor + '.' + version_micro, - libraries : [eina, ecore, ector, emile, dependency('luajit')], + libraries : [eina, ecore, ector, emile, lua], ) -- 2.7.4