]> git.e2factory.org Git - e2factory.git/commitdiff
Convert buildconfig into a new-style module
authorTobias Ulmer <tu@emlix.com>
Thu, 27 Jun 2013 13:01:58 +0000 (15:01 +0200)
committerTobias Ulmer <tu@emlix.com>
Wed, 16 Nov 2016 14:01:23 +0000 (15:01 +0100)
Signed-off-by: Tobias Ulmer <tu@emlix.com>
Makefile
generic/e2lib.lua
generic/e2option.lua
generic/tools.lua
global/e2-create-project.lua
global/e2-fetch-project.lua
global/e2-install-e2.lua
global/e2.lua
local/e2build.lua
local/e2tool.lua

index c9faa7299baf63fcffba84929205efbdcb18b947..48dfe95a9ab14d88eb24b767c7d09664cf0c959f 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -42,27 +42,30 @@ help:
 .SILENT: buildconfig.lua
 buildconfig.lua: Makefile make.vars
        echo 'writing buildconfig.lua'
-       echo 'module ("buildconfig")' > $@
-       echo 'PREFIX="$(PREFIX)"' >>$@
-       echo 'BINDIR="$(BINDIR)"' >>$@
-       echo 'LIBDIR="$(LIBDIR)"' >>$@
-       echo 'TOOLDIR="$(TOOLDIR)"' >>$@
-       echo 'SYSCONFDIR="$(SYSCONFDIR)"' >>$@
-       echo 'E2="$(E2)"' >>$@
-       echo 'LUA="$(LUA)"' >>$@
-       echo 'MAJOR="$(MAJOR)"' >>$@
-       echo 'MINOR="$(MINOR)"' >>$@
-       echo 'PATCHLEVEL="$(PATCHLEVEL)"' >>$@
-       echo 'EXTRAVERSION="$(EXTRAVERSION)"' >>$@
-       echo 'VERSION="$(VERSION)"' >>$@
-       echo 'VERSIONSTRING="$(VERSIONSTRING)"' >>$@
-       echo 'GLOBAL_INTERFACE_VERSION={' >>$@
+       echo 'local buildconfig = {}' > $@
+       echo 'local strict = require("strict")' >>$@
+       echo 'buildconfig.PREFIX="$(PREFIX)"' >>$@
+       echo 'buildconfig.BINDIR="$(BINDIR)"' >>$@
+       echo 'buildconfig.LIBDIR="$(LIBDIR)"' >>$@
+       echo 'buildconfig.TOOLDIR="$(TOOLDIR)"' >>$@
+       echo 'buildconfig.SYSCONFDIR="$(SYSCONFDIR)"' >>$@
+       echo 'buildconfig.E2="$(E2)"' >>$@
+       echo 'buildconfig.LUA="$(LUA)"' >>$@
+       echo 'buildconfig.MAJOR="$(MAJOR)"' >>$@
+       echo 'buildconfig.MINOR="$(MINOR)"' >>$@
+       echo 'buildconfig.PATCHLEVEL="$(PATCHLEVEL)"' >>$@
+       echo 'buildconfig.EXTRAVERSION="$(EXTRAVERSION)"' >>$@
+       echo 'buildconfig.VERSION="$(VERSION)"' >>$@
+       echo 'buildconfig.VERSIONSTRING="$(VERSIONSTRING)"' >>$@
+       echo 'buildconfig.GLOBAL_INTERFACE_VERSION={' >>$@
        set -e; for x in $(GLOBAL_INTERFACE_VERSION) ; do \
                echo " \"$$x\"," ; done >>$@
        echo '}' >>$@
-       echo 'SYNTAX={' >>$@
+       echo 'buildconfig.SYNTAX={' >>$@
        set -e; for x in $(SYNTAX) ; do echo " \"$$x\"," ; done >>$@
        echo '}' >>$@
+       echo 'return strict.lock(buildconfig)' >>$@
+
 
 all: buildconfig.lua
        set -e; for s in $(SUBDIRS) ; do \
index fe4624134318dd6c0b3a3ba45b96a64fd97e8a35..76a35ae8cf98778c23a35c5fd69d1b9471d933d5 100644 (file)
@@ -47,7 +47,7 @@ local e2lib = {}
 -- table that we are going to fill later (after the require block below).
 package.loaded["e2lib"] = e2lib
 
-require("buildconfig")
+local buildconfig = require("buildconfig")
 require("e2util")
 local lock = require("lock")
 local err = require("err")
index c04dcbc31401ff09e5d1ec2e023a96fd7723e1db..9155ce993b121dfd4f05552ef80c3ba21840ac61 100644 (file)
@@ -36,8 +36,8 @@ local plugin = require("plugin")
 local err = require("err")
 local strict = require("strict")
 local tools = require("tools")
+local buildconfig = require("buildconfig")
 require("e2util")
-require("buildconfig")
 
 local options = {}
 local aliases = {}
index cf7528ae6e7f97e364549c8dbb03fb49c4f75e2c..dca59df8e1788ae173afba66a9f801545e19dfa5 100644 (file)
@@ -31,7 +31,7 @@
 local tools = {}
 local e2lib = require("e2lib")
 local strict = require("strict")
-require("buildconfig")
+local buildconfig = require("buildconfig")
 
 local initialized = false
 
index 4857944cb55488870b3e9d8ee70f4314dbe0a904..c39976906af3c0626ff284b6a73902fdf01837fb 100644 (file)
@@ -33,7 +33,7 @@ local cache = require("cache")
 local generic_git = require("generic_git")
 local err = require("err")
 local e2option = require("e2option")
-require("buildconfig")
+local buildconfig = require("buildconfig")
 
 local function e2_create_project(arg)
     local rc, re = e2lib.init()
index 2829dd589481c228178d8a4cc94964f3b712b408..ef3dcaa875878a674cfcb122d3be33d807ca1d20 100644 (file)
@@ -33,7 +33,7 @@ local e2option = require("e2option")
 local generic_git = require("generic_git")
 local cache = require("cache")
 local err = require("err")
-require("buildconfig")
+local buildconfig = require("buildconfig")
 
 local function e2_fetch_project(arg)
     local rc, re = e2lib.init()
index a404d3423528dd29261477c79d40ff80dd546275..e4f331abe6b9dac2c05153558ff23be56d9d857a 100644 (file)
@@ -32,7 +32,7 @@ local e2lib = require("e2lib")
 local e2option = require("e2option")
 local generic_git = require("generic_git")
 local err = require("err")
-require("buildconfig")
+local buildconfig = require("buildconfig")
 
 local function e2_install_e2(arg)
     local rc, re = e2lib.init()
index 6dd4cca86e7fad4898a5c75f964c5b7f056708e0..8d148859fdf6c4220429e7620d7853b0f1128620 100644 (file)
@@ -31,7 +31,7 @@
 local e2lib = require("e2lib")
 local e2option = require("e2option")
 local err = require("err")
-require("buildconfig")
+local buildconfig = require("buildconfig")
 require("e2util")
 
 local function e2(arg)
index 6e3e2fc1ebac5f41b091cd23ff7c69afa5e18ede..18a774c8d86f597028a146e37ade0bb6e229abf6 100644 (file)
@@ -37,6 +37,7 @@ local scm = require("scm")
 local environment = require("environment")
 local e2tool = require("e2tool")
 local strict = require("strict")
+local buildconfig = require("buildconfig")
 
 -- Table driving the build process, see documentation at the bottom.
 local build_process = {}
index a85c5f770ebbdb568e765184062d1d8ae82d49e8..5ac452c3836b365a27ef133a599c25e5ad51a962 100644 (file)
@@ -44,6 +44,7 @@ local policy = require("policy")
 local strict = require("strict")
 local transport = require("transport")
 local cache = require("cache")
+local buildconfig = require("buildconfig")
 
 --- Info table contains sources, results, servers, caches and more...
 -- @table info