elua: remove EFL_RUN_IN_TREE hack (pass cmdline args)
authorDaniel Kolesa <d.kolesa@samsung.com>
Thu, 9 Apr 2015 16:33:35 +0000 (17:33 +0100)
committerDaniel Kolesa <d.kolesa@osg.samsung.com>
Wed, 6 May 2015 14:05:19 +0000 (15:05 +0100)
src/Makefile_Elua.am
src/Makefile_Elua_Helper.am
src/bin/elua/main.c

index a6609d2..8a5fc82 100644 (file)
@@ -14,7 +14,6 @@ lib_elua_libelua_la_SOURCES = \
 
 lib_elua_libelua_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl @ELUA_CFLAGS@ \
        -DLOCALE_DIR=\"@LOCALE_DIR@\" \
-       -DPACKAGE_SRC_DIR=\"$(abs_top_srcdir)\" \
        -DPACKAGE_BIN_DIR=\"$(bindir)\" \
        -DPACKAGE_DATA_DIR=\"$(datadir)/elua\"
 
@@ -33,7 +32,6 @@ bin_elua_elua_SOURCES = \
 
 bin_elua_elua_CPPFLAGS = -I$(top_builddir)/src/lib/efl @ELUA_CFLAGS@ \
        -DLOCALE_DIR=\"@LOCALE_DIR@\" \
-       -DPACKAGE_SRC_DIR=\"$(abs_top_srcdir)\" \
        -DPACKAGE_BIN_DIR=\"$(bindir)\" \
        -DPACKAGE_DATA_DIR=\"$(datadir)/elua\"
 
index 0be2ad0..479a31d 100644 (file)
@@ -3,7 +3,12 @@ ELUA_GEN = @elua_bin@ lualian
 _ELUA_GEN_DEP = @elua_bin@
 else
 ELUA_GEN = ELUA_EOLIAN_LIBRARY_PATH=$(top_builddir)/src/lib/eolian/.libs \
-       EFL_RUN_IN_TREE=1 $(top_builddir)/src/bin/elua/elua${EXEEXT} lualian
+       $(top_builddir)/src/bin/elua/elua${EXEEXT} \
+       -I$(abs_top_srcdir)/src/bindings/luajit \
+       -C$(abs_top_srcdir)/src/scripts/elua/core \
+       -M$(abs_top_srcdir)/src/scripts/elua/modules \
+       -A$(abs_top_srcdir)/src/scripts/elua/apps \
+       lualian
 _ELUA_GEN_DEP = bin/elua/elua${EXEEXT} scripts/elua/apps/lualian.lua \
        scripts/elua/modules/lualian.lua \
        scripts/elua/modules/getopt.lua scripts/elua/core/util.lua \
index 44113c3..2873339 100644 (file)
@@ -119,40 +119,31 @@ elua_register_require(lua_State *L)
    elua_require_ref = luaL_ref(L, LUA_REGISTRYINDEX);
    lua_pushvalue(L, 2);
    elua_appload_ref = luaL_ref(L, LUA_REGISTRYINDEX);
-   if (getenv("EFL_RUN_IN_TREE"))
+   if (!corepath)
      {
-        corepath = PACKAGE_SRC_DIR "/src/scripts/elua/core";
-        modpath  = PACKAGE_SRC_DIR "/src/scripts/elua/modules";
-        appspath = PACKAGE_SRC_DIR "/src/scripts/elua/apps";
+        if (noenv || !(corepath = getenv("ELUA_CORE_DIR")) || !corepath[0])
+          {
+             corepath = corepathbuf;
+             snprintf(corepathbuf, sizeof(corepathbuf), "%s/core",
+                      eina_prefix_data_get(elua_prefix));
+          }
      }
-   else
+   if (!modpath)
      {
-        if (!corepath)
+        if (noenv || !(modpath = getenv("ELUA_MODULES_DIR")) || !modpath[0])
           {
-             if (noenv || !(corepath = getenv("ELUA_CORE_DIR")) || !corepath[0])
-               {
-                  corepath = corepathbuf;
-                  snprintf(corepathbuf, sizeof(corepathbuf), "%s/core",
-                           eina_prefix_data_get(elua_prefix));
-               }
+             modpath = modpathbuf;
+             snprintf(modpathbuf, sizeof(modpathbuf), "%s/modules",
+                      eina_prefix_data_get(elua_prefix));
           }
-        if (!modpath)
-          {
-             if (noenv || !(modpath = getenv("ELUA_MODULES_DIR")) || !modpath[0])
-               {
-                  modpath = modpathbuf;
-                  snprintf(modpathbuf, sizeof(modpathbuf), "%s/modules",
-                           eina_prefix_data_get(elua_prefix));
-               }
-          }
-        if (!appspath)
+     }
+   if (!appspath)
+     {
+        if (noenv || !(appspath = getenv("ELUA_APPS_DIR")) || !appspath[0])
           {
-             if (noenv || !(appspath = getenv("ELUA_APPS_DIR")) || !appspath[0])
-               {
-                  appspath = appspathbuf;
-                  snprintf(appspathbuf, sizeof(appspathbuf), "%s/apps",
-                           eina_prefix_data_get(elua_prefix));
-               }
+             appspath = appspathbuf;
+             snprintf(appspathbuf, sizeof(appspathbuf), "%s/apps",
+                      eina_prefix_data_get(elua_prefix));
           }
      }
    lua_pushfstring(L, "%s/?.lua;", corepath);
@@ -388,15 +379,7 @@ elua_main(lua_State *L)
         return 0;
      }
 
-   if (getenv("EFL_RUN_IN_TREE"))
-     {
-        Arg_Data *v = malloc(sizeof(Arg_Data));
-        v->type     = ARG_LIBDIR;
-        v->value    = PACKAGE_SRC_DIR "/src/bindings/luajit";
-        largs       = eina_list_append(largs, v);
-        coref       = PACKAGE_SRC_DIR "/src/scripts/elua/core";
-     }
-   else if (!(coref = coredir))
+   if (!(coref = coredir))
      {
         if (noenv || !(coref = getenv("ELUA_CORE_DIR")) || !coref[0])
           {