forked from enlightenment/efl
elua/autotools: generate .eo.lua files out of all eo files at build time
Also change the generator a bit so that it doesn't rely on lib name information and fix the runtime to properly source lua files within tree.
This commit is contained in:
parent
b2afff23cb
commit
f33101ea8c
|
@ -11,8 +11,6 @@ EOLIAN_FLAGS = \
|
|||
-I$(srcdir)/lib/ecore \
|
||||
-I$(srcdir)/lib/ecore_con
|
||||
|
||||
ELUA_GEN_FLAGS =
|
||||
|
||||
DIST_SUBDIRS =
|
||||
SUBDIRS =
|
||||
|
||||
|
|
|
@ -225,3 +225,16 @@ endif
|
|||
EXTRA_DIST += \
|
||||
tests/ecore/modem.wav \
|
||||
tests/ecore/sms.ogg
|
||||
|
||||
if HAVE_ELUA
|
||||
|
||||
ecore_eolian_lua = $(ecore_eolian_files:%.eo=%.eo.lua)
|
||||
|
||||
generated_ecore_lua_all = $(ecore_eolian_lua)
|
||||
|
||||
CLEANFILES += $(generated_ecore_lua_all)
|
||||
|
||||
installed_ecoreluadir = $(datadir)/elua/modules/ecore
|
||||
nodist_installed_ecorelua_DATA = $(generated_ecore_lua_all)
|
||||
|
||||
endif
|
||||
|
|
|
@ -75,3 +75,16 @@ lib/ecore_audio/ecore_audio_sndfile_vio.c
|
|||
endif
|
||||
|
||||
endif
|
||||
|
||||
if HAVE_ELUA
|
||||
|
||||
ecore_audio_eolian_lua = $(ecore_audio_eolian_files:%.eo=%.eo.lua)
|
||||
|
||||
generated_ecore_audio_lua_all = $(ecore_audio_eolian_lua)
|
||||
|
||||
CLEANFILES += $(generated_ecore_audio_lua_all)
|
||||
|
||||
installed_ecoreaudioluadir = $(datadir)/elua/modules/ecore_audio
|
||||
nodist_installed_ecoreaudiolua_DATA = $(generated_ecore_audio_lua_all)
|
||||
|
||||
endif
|
||||
|
|
|
@ -68,3 +68,16 @@ lib_ecore_con_libecore_con_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl @ECORE_CO
|
|||
lib_ecore_con_libecore_con_la_LIBADD = @ECORE_CON_LIBS@ @EVIL_LIBS@
|
||||
lib_ecore_con_libecore_con_la_DEPENDENCIES = @ECORE_CON_INTERNAL_LIBS@
|
||||
lib_ecore_con_libecore_con_la_LDFLAGS = @EFL_LTLIBRARY_FLAGS@
|
||||
|
||||
if HAVE_ELUA
|
||||
|
||||
ecore_con_eolian_lua = $(ecore_con_eolian_files:%.eo=%.eo.lua)
|
||||
|
||||
generated_ecore_con_lua_all = $(ecore_con_eolian_lua)
|
||||
|
||||
CLEANFILES += $(generated_ecore_con_lua_all)
|
||||
|
||||
installed_ecoreconluadir = $(datadir)/elua/modules/ecore_con
|
||||
nodist_installed_ecoreconlua_DATA = $(generated_ecore_con_lua_all)
|
||||
|
||||
endif
|
||||
|
|
|
@ -281,3 +281,16 @@ CLEANFILES += tests/edje/data/test_layout.edj \
|
|||
endif
|
||||
|
||||
EXTRA_DIST += $(EDJE_DATA_FILES)
|
||||
|
||||
if HAVE_ELUA
|
||||
|
||||
edje_eolian_lua = $(edje_eolian_files:%.eo=%.eo.lua)
|
||||
|
||||
generated_edje_lua_all = $(edje_eolian_lua)
|
||||
|
||||
CLEANFILES += $(generated_edje_lua_all)
|
||||
|
||||
installed_edjeluadir = $(datadir)/elua/modules/edje
|
||||
nodist_installed_edjelua_DATA = $(generated_edje_lua_all)
|
||||
|
||||
endif
|
||||
|
|
|
@ -40,3 +40,16 @@ dist_installed_eflheaders_DATA = \
|
|||
|
||||
installed_eflinterfacesdir = $(includedir)/efl-@VMAJ@/interfaces
|
||||
nodist_installed_eflinterfaces_DATA = $(efl_eolian_files_h)
|
||||
|
||||
if HAVE_ELUA
|
||||
|
||||
efl_eolian_lua = $(efl_eolian_files:%.eo=%.eo.lua)
|
||||
|
||||
generated_efl_lua_all = $(efl_eolian_lua)
|
||||
|
||||
CLEANFILES += $(generated_efl_lua_all)
|
||||
|
||||
installed_eflluadir = $(datadir)/elua/modules/efl
|
||||
nodist_installed_efllua_DATA = $(generated_efl_lua_all)
|
||||
|
||||
endif
|
||||
|
|
|
@ -10,7 +10,7 @@ bin_elua_elua_SOURCES = \
|
|||
|
||||
bin_elua_elua_CPPFLAGS = -I$(top_builddir)/src/lib/efl @ELUA_CFLAGS@ \
|
||||
-DLOCALE_DIR=\"@LOCALE_DIR@\" \
|
||||
-DPACKAGE_BUILD_DIR=\"$(abs_top_builddir)\" \
|
||||
-DPACKAGE_SRC_DIR=\"$(abs_top_srcdir)\" \
|
||||
-DPACKAGE_BIN_DIR=\"$(bindir)\" \
|
||||
-DPACKAGE_DATA_DIR=\"$(datadir)/elua\"
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
if HAVE_ELUA_BIN
|
||||
ELUA_GEN = @elua_bin@
|
||||
ELUA_GEN = @elua_bin@ :lualian
|
||||
_ELUA_GEN_DEP = @elua_bin@
|
||||
else
|
||||
ELUA_GEN = EFL_RUN_IN_TREE=1 $(top_builddir)/src/bin/elua/elua${EXEEXT}
|
||||
ELUA_GEN = EFL_RUN_IN_TREE=1 $(top_builddir)/src/bin/elua/elua${EXEEXT} :lualian
|
||||
_ELUA_GEN_DEP = bin/elua/elua${EXEEXT}
|
||||
endif
|
||||
|
||||
|
@ -12,7 +12,7 @@ am__v_ELUA_0 = @echo " ELUA " $@;
|
|||
|
||||
SUFFIXES += .lua
|
||||
|
||||
%.lua: %.eo ${_ELUA_GEN_DEP}
|
||||
$(AM_V_ELUA)$(ELUA_GEN) :lualian $(ELUA_GEN_FLAGS) -o $@ $<
|
||||
%.eo.lua: %.eo ${_ELUA_GEN_DEP}
|
||||
$(AM_V_ELUA)$(ELUA_GEN) -o $@ $<
|
||||
|
||||
CLEANFILES += $(BUILT_SOURCES)
|
||||
|
|
|
@ -257,3 +257,16 @@ tests/emotion/data/video_frame_top.png \
|
|||
tests/emotion/data/whb.png \
|
||||
tests/emotion/data/window_inner_shadow.png \
|
||||
modules/emotion/generic/README
|
||||
|
||||
if HAVE_ELUA
|
||||
|
||||
emotion_eolian_lua = $(emotion_eolian_files:%.eo=%.eo.lua)
|
||||
|
||||
generated_emotion_lua_all = $(emotion_eolian_lua)
|
||||
|
||||
CLEANFILES += $(generated_emotion_lua_all)
|
||||
|
||||
installed_emotionluadir = $(datadir)/elua/modules/emotion
|
||||
nodist_installed_emotionlua_DATA = $(generated_emotion_lua_all)
|
||||
|
||||
endif
|
||||
|
|
|
@ -1965,3 +1965,15 @@ tests/evas/images/Light_exif_90.jpg \
|
|||
tests/evas/images/Light_exif_transverse.jpg \
|
||||
tests/evas/images/Light_exif_270.jpg
|
||||
|
||||
if HAVE_ELUA
|
||||
|
||||
evas_eolian_lua = $(evas_eolian_files:%.eo=%.eo.lua)
|
||||
|
||||
generated_evas_lua_all = $(evas_eolian_lua)
|
||||
|
||||
CLEANFILES += $(generated_evas_lua_all)
|
||||
|
||||
installed_evasluadir = $(datadir)/elua/modules/evas
|
||||
nodist_installed_evaslua_DATA = $(generated_evas_lua_all)
|
||||
|
||||
endif
|
||||
|
|
|
@ -18,7 +18,7 @@ local gen_file = function(opts, i, fname)
|
|||
else
|
||||
printv(" Output file: printing to stdout...")
|
||||
end
|
||||
lualian.generate(fname, opts["L"], fstream)
|
||||
lualian.generate(fname, fstream)
|
||||
end
|
||||
|
||||
getopt.parse {
|
||||
|
@ -37,7 +37,6 @@ getopt.parse {
|
|||
{ "I", "include", true, help = "Include a directory.", metavar = "DIR",
|
||||
list = {}
|
||||
},
|
||||
{ "L", "library", true, help = "Specify a C library name." },
|
||||
{ "o", "output", true, help = "Specify output file name(s), by "
|
||||
.. "default goes to stdout.",
|
||||
list = {}
|
||||
|
@ -49,10 +48,6 @@ getopt.parse {
|
|||
end,
|
||||
done_cb = function(parser, opts, args)
|
||||
if not opts["h"] then
|
||||
if not opts["L"] then
|
||||
io.stderr:write("library name not specified\n")
|
||||
getopt.help(parser, io.stderr)
|
||||
else
|
||||
for i, v in ipairs(opts["I"] or {}) do
|
||||
lualian.include_dir(v)
|
||||
end
|
||||
|
@ -65,7 +60,6 @@ getopt.parse {
|
|||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
}
|
||||
|
||||
return true
|
||||
|
|
|
@ -136,9 +136,9 @@ elua_register_require(lua_State *L)
|
|||
elua_appload_ref = luaL_ref(L, LUA_REGISTRYINDEX);
|
||||
if (getenv("EFL_RUN_IN_TREE"))
|
||||
{
|
||||
corepath = PACKAGE_BUILD_DIR "/src/bin/elua/core";
|
||||
modpath = PACKAGE_BUILD_DIR "/src/bin/elua/modules";
|
||||
appspath = PACKAGE_BUILD_DIR "/src/bin/elua/apps";
|
||||
corepath = PACKAGE_SRC_DIR "/src/bin/elua/core";
|
||||
modpath = PACKAGE_SRC_DIR "/src/bin/elua/modules";
|
||||
appspath = PACKAGE_SRC_DIR "/src/bin/elua/apps";
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -466,9 +466,9 @@ elua_main(lua_State *L)
|
|||
{
|
||||
Arg_Data *v = malloc(sizeof(Arg_Data));
|
||||
v->type = ARG_LIBDIR;
|
||||
v->value = PACKAGE_BUILD_DIR "/src/bindings/luajit";
|
||||
v->value = PACKAGE_SRC_DIR "/src/bindings/luajit";
|
||||
largs = eina_list_append(largs, v);
|
||||
coref = PACKAGE_BUILD_DIR "/src/bin/elua/core";
|
||||
coref = PACKAGE_SRC_DIR "/src/bin/elua/core";
|
||||
}
|
||||
else if (!(coref = coredir))
|
||||
{
|
||||
|
|
|
@ -502,10 +502,9 @@ end
|
|||
}
|
||||
|
||||
local File = Node:clone {
|
||||
__ctor = function(self, fname, klass, libname, ch)
|
||||
__ctor = function(self, fname, klass, ch)
|
||||
self.fname = fname:match(".+/(.+)") or fname
|
||||
self.klass = klass
|
||||
self.libname = libname
|
||||
self.children = ch
|
||||
end,
|
||||
|
||||
|
@ -531,33 +530,27 @@ local util = require("util")
|
|||
local ffi = require("ffi")
|
||||
local eo = require("eo")
|
||||
|
||||
local M = ...
|
||||
local M, __lib = ...
|
||||
|
||||
local __lib
|
||||
local __class
|
||||
local __body
|
||||
|
||||
local init = function()
|
||||
__lib = util.lib_load("%s")
|
||||
__class = __lib.%s_class_get()
|
||||
eo.class_register("%s", %s, __body, __class)
|
||||
]]):format(self.fname, kn, self.libname, ckls.prefix, knu, paru))
|
||||
]]):format(self.fname, kn, ckls.prefix, knu, paru))
|
||||
|
||||
if ckls.mixins then for i, v in ipairs(ckls.mixins) do
|
||||
s:write((" eo.class_mixin(\"%s\", \"%s\")\n"):format(knu,
|
||||
v:gsub("%.", "_")))
|
||||
end end
|
||||
|
||||
s:write(([[
|
||||
s:write([[
|
||||
end
|
||||
|
||||
local shutdown = function()
|
||||
util.lib_unload("%s")
|
||||
end
|
||||
cutil.init_module(init, function() end)
|
||||
|
||||
cutil.init_module(init, shutdown)
|
||||
|
||||
]]):format(self.libname))
|
||||
]])
|
||||
|
||||
self:gen_children(s)
|
||||
|
||||
|
@ -651,7 +644,7 @@ M.system_directory_scan = function()
|
|||
return eolian.system_directory_scan()
|
||||
end
|
||||
|
||||
M.generate = function(fname, libname, fstream)
|
||||
M.generate = function(fname, fstream)
|
||||
if not eolian.eo_file_parse(fname) then
|
||||
error("Failed parsing file: " .. fname)
|
||||
end
|
||||
|
@ -670,7 +663,7 @@ M.generate = function(fname, libname, fstream)
|
|||
else
|
||||
error(klass:full_name_get() .. ": unknown type")
|
||||
end
|
||||
File(fname, klass, libname, { cl }):generate(fstream or io.stdout)
|
||||
File(fname, klass, { cl }):generate(fstream or io.stdout)
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
Loading…
Reference in New Issue