q66 pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=c3a1060b94ae9df82e8406b481e8bd5fe5741df5

commit c3a1060b94ae9df82e8406b481e8bd5fe5741df5
Author: Daniel Kolesa <[email protected]>
Date:   Sat Jun 6 19:09:21 2020 +0200

    build: disable elua by default, plus nicer detection
    
    Elua is now disabled by default. There are some other changes:
    
    1) Elua scripts are only installed if Elua is enabled
    2) Lua bindings are only installed if Elua is enabled
    3) Elua with interpreter is clearly experimental and will message
---
 .ci/ci-configure.sh      |  4 ++--
 meson.build              | 17 ++++++++++++++++-
 meson_options.txt        |  4 ++--
 src/bindings/meson.build |  4 ++++
 src/lib/elua/meson.build |  5 +----
 src/scripts/meson.build  |  5 ++++-
 6 files changed, 29 insertions(+), 10 deletions(-)

diff --git a/.ci/ci-configure.sh b/.ci/ci-configure.sh
index d2454e548c..bd429aea16 100755
--- a/.ci/ci-configure.sh
+++ b/.ci/ci-configure.sh
@@ -19,7 +19,7 @@ if [ "$DISTRO" != "" ] ; then
   -Ddebug-threads=true -Dglib=true -Dg-mainloop=true -Dxpresent=true 
-Dxinput22=true \
   -Devas-loaders-disabler=json -Decore-imf-loaders-disabler= \
   -Dharfbuzz=true -Dpixman=true -Dhyphen=true -Defl-one=true \
-  -Dvnc-server=true -Dbindings=lua,cxx,mono -Delogind=false 
-Dinstall-eo-files=true -Dphysics=true"
+  -Dvnc-server=true -Delua=true -Dbindings=lua,cxx,mono -Delogind=false 
-Dinstall-eo-files=true -Dphysics=true"
 
   # Enabled png, jpeg evas loader for in tree edje file builds
   DISABLED_LINUX_COPTS=" -Daudio=false -Davahi=false -Dx11=false 
-Dphysics=false -Deeze=false \
@@ -30,7 +30,7 @@ if [ "$DISTRO" != "" ] ; then
   -Decore-imf-loaders-disabler=xim,ibus,scim \
   -Dfribidi=false -Dfontconfig=false \
   -Dedje-sound-and-video=false -Dembedded-lz4=false -Dlibmount=false 
-Dv4l2=false \
-  -Delua=true -Dnls=false -Dbindings= -Dlua-interpreter=luajit 
-Dnative-arch-optimization=false"
+  -Delua=false -Dnls=false -Dbindings= -Dlua-interpreter=luajit 
-Dnative-arch-optimization=false"
   #evas_filter_parser.c:(.text+0xc59): undefined reference to `lua_getglobal' 
with interpreter lua
 
   RELEASE_READY_LINUX_COPTS=" --buildtype=release"
diff --git a/meson.build b/meson.build
index 3585eabdef..f820761ade 100644
--- a/meson.build
+++ b/meson.build
@@ -270,6 +270,7 @@ luaold_interpreters = [
 ]
 
 lua_pc_name = ''
+have_elua = get_option('elua')
 
 if get_option('lua-interpreter') == 'lua'
   config_h.set('ENABLE_LUA_OLD', '1')
@@ -280,13 +281,27 @@ if get_option('lua-interpreter') == 'lua'
       break
     endif
   endforeach
+  if not lua.found()
+    error('Lua not found')
+  endif
+  if have_elua
+    luaver_min = cc.compute_int('LUA_VERSION_NUM - 500',
+      prefix: '#include <lua.h>', dependencies: lua
+    )
+    lua_ffi = dependency('cffi-lua-5.@0@'.format(luaver_min), required: false)
+    if not lua_ffi.found()
+      error('Elua with interpreter is experimental, disable it or install 
cffi-lua...')
+    else
+      message('Using experimental Elua with interpreter support...')
+    endif
+  endif
 else
   lua = dependency(get_option('lua-interpreter'))
   lua_pc_name = 'luajit'
 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
+# 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
   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')]
diff --git a/meson_options.txt b/meson_options.txt
index 6b2464a03a..432a8b3bcf 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -262,7 +262,7 @@ option('v4l2',
 
 option('elua',
   type : 'boolean',
-  value : true,
+  value : false,
   description : 'Lua launcher binary support in efl'
 )
 
@@ -287,7 +287,7 @@ option('nls',
 option('bindings',
   type : 'array',
   choices : ['lua', 'cxx', 'mono'],
-  value : ['lua', 'cxx'],
+  value : ['cxx'],
   description : 'Which auto-generated language bindings for efl to enable',
 )
 
diff --git a/src/bindings/meson.build b/src/bindings/meson.build
index 61027d3743..d7d7cba8be 100644
--- a/src/bindings/meson.build
+++ b/src/bindings/meson.build
@@ -18,6 +18,10 @@ if (bindings.contains('cxx') == false and 
bindings.contains('mono'))
   )
 endif
 
+if bindings.contains('lua') and not have_elua
+  error('Elua is necessary for Lua bindings')
+endif
+
 foreach binding : bindings_order
   if bindings.contains(binding)
     subdir(join_paths( binding))
diff --git a/src/lib/elua/meson.build b/src/lib/elua/meson.build
index 15b66aefdb..66bd9454b9 100644
--- a/src/lib/elua/meson.build
+++ b/src/lib/elua/meson.build
@@ -2,10 +2,7 @@ elua_deps = [eina, eo, efl, ecore, ecore_file, intl]
 elua_pub_deps = [lua]
 
 if get_option('lua-interpreter') == 'lua'
-  luaver_min = cc.compute_int('LUA_VERSION_NUM - 500',
-    prefix: '#include <lua.h>', dependencies: lua
-  )
-  elua_deps += dependency('cffi-lua-5.@0@'.format(luaver_min))
+  elua_deps += lua_ffi
 endif
 
 elua_src = ['elua.c', 'io.c', 'cache.c']
diff --git a/src/scripts/meson.build b/src/scripts/meson.build
index 6057ad788a..48713158b0 100644
--- a/src/scripts/meson.build
+++ b/src/scripts/meson.build
@@ -1,2 +1,5 @@
 subdir('eo')
-subdir('elua')
+
+if have_elua
+  subdir('elua')
+endif

-- 


Reply via email to