aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--GNUmakefile12
-rwxr-xr-xbinary/all_in_one10
2 files changed, 14 insertions, 8 deletions
diff --git a/GNUmakefile b/GNUmakefile
index 86f965a7..90ceaf87 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -76,7 +76,9 @@ luarocks-admin: config.unix
76$(builddir)/luarocks: src/bin/luarocks config.unix 76$(builddir)/luarocks: src/bin/luarocks config.unix
77 mkdir -p "$(@D)" 77 mkdir -p "$(@D)"
78 (printf '$(SHEBANG)\n'\ 78 (printf '$(SHEBANG)\n'\
79 'package.loaded["luarocks.core.hardcoded"] = { SYSCONFDIR = [[$(luarocksconfdir)]] }\n'\ 79 'package.loaded["luarocks.core.hardcoded"] = { '\
80 "$$([ -n "$(FORCE_CONFIG)" ] && printf 'FORCE_CONFIG = true, ')"\
81 'SYSCONFDIR = [[$(luarocksconfdir)]] }\n'\
80 'package.path=[[$(luadir)/?.lua;]] .. package.path\n'; \ 82 'package.path=[[$(luadir)/?.lua;]] .. package.path\n'; \
81 tail -n +2 src/bin/luarocks \ 83 tail -n +2 src/bin/luarocks \
82 )> "$@" 84 )> "$@"
@@ -84,7 +86,9 @@ $(builddir)/luarocks: src/bin/luarocks config.unix
84$(builddir)/luarocks-admin: src/bin/luarocks-admin config.unix 86$(builddir)/luarocks-admin: src/bin/luarocks-admin config.unix
85 mkdir -p "$(@D)" 87 mkdir -p "$(@D)"
86 (printf '$(SHEBANG)\n'\ 88 (printf '$(SHEBANG)\n'\
87 'package.loaded["luarocks.core.hardcoded"] = { SYSCONFDIR = [[$(luarocksconfdir)]] }\n'\ 89 'package.loaded["luarocks.core.hardcoded"] = { '\
90 "$$([ -n "$(FORCE_CONFIG)" ] && printf 'FORCE_CONFIG = true, ')"\
91 'SYSCONFDIR = [[$(luarocksconfdir)]] }\n'\
88 'package.path=[[$(luadir)/?.lua;]] .. package.path\n'; \ 92 'package.path=[[$(luadir)/?.lua;]] .. package.path\n'; \
89 tail -n +2 src/bin/luarocks-admin \ 93 tail -n +2 src/bin/luarocks-admin \
90 )> "$@" 94 )> "$@"
@@ -97,11 +101,11 @@ binary: luarocks $(buildbinarydir)/luarocks.exe $(buildbinarydir)/luarocks-admin
97 101
98$(buildbinarydir)/luarocks.exe: src/bin/luarocks $(LUAROCKS_FILES) 102$(buildbinarydir)/luarocks.exe: src/bin/luarocks $(LUAROCKS_FILES)
99 (unset $(LUA_ENV_VARS); \ 103 (unset $(LUA_ENV_VARS); \
100 "$(LUA)" binary/all_in_one "$<" "$(LUA_DIR)" "^src/luarocks/admin/" "$(luarocksconfdir)" "$(@D)" $(BINARY_PLATFORM) $(CC) $(NM) $(SYSROOT)) 104 "$(LUA)" binary/all_in_one "$<" "$(LUA_DIR)" "^src/luarocks/admin/" "$(luarocksconfdir)" "$(@D)" "$(FORCE_CONFIG)" $(BINARY_PLATFORM) $(CC) $(NM) $(SYSROOT))
101 105
102$(buildbinarydir)/luarocks-admin.exe: src/bin/luarocks-admin $(LUAROCKS_FILES) 106$(buildbinarydir)/luarocks-admin.exe: src/bin/luarocks-admin $(LUAROCKS_FILES)
103 (unset $(LUA_ENV_VARS); \ 107 (unset $(LUA_ENV_VARS); \
104 "$(LUA)" binary/all_in_one "$<" "$(LUA_DIR)" "^src/luarocks/cmd/" "$(luarocksconfdir)" "$(@D)" $(BINARY_PLATFORM) $(CC) $(NM) $(SYSROOT)) 108 "$(LUA)" binary/all_in_one "$<" "$(LUA_DIR)" "^src/luarocks/cmd/" "$(luarocksconfdir)" "$(@D)" "$(FORCE_CONFIG)" $(BINARY_PLATFORM) $(CC) $(NM) $(SYSROOT))
105 109
106# ---------------------------------------- 110# ----------------------------------------
107# Regular install 111# Regular install
diff --git a/binary/all_in_one b/binary/all_in_one
index d6517d79..01758758 100755
--- a/binary/all_in_one
+++ b/binary/all_in_one
@@ -30,10 +30,11 @@ local LUA_DIR = arg[2] or "/usr"
30local EXCLUDE = arg[3] or "^src/luarocks/admin/" 30local EXCLUDE = arg[3] or "^src/luarocks/admin/"
31local SYSCONFDIR = arg[4] or "/etc/luarocks" 31local SYSCONFDIR = arg[4] or "/etc/luarocks"
32local TARGET = arg[5] or "build-binary" 32local TARGET = arg[5] or "build-binary"
33local MY_PLATFORM = arg[6] or "unix" 33local FORCE_CONFIG = (arg[6] == "yes")
34local CC = arg[7] or "gcc" 34local MY_PLATFORM = arg[7] or "unix"
35local NM = arg[8] or "nm" 35local CC = arg[8] or "gcc"
36local CROSSCOMPILER_SYSROOT = arg[9] or "/usr/lib/mingw-w64-sysroot/i686-w64-mingw32" 36local NM = arg[9] or "nm"
37local CROSSCOMPILER_SYSROOT = arg[10] or "/usr/lib/mingw-w64-sysroot/i686-w64-mingw32"
37 38
38local LUA_MODULES = TARGET .. "/lua_modules" 39local LUA_MODULES = TARGET .. "/lua_modules"
39local CONFIG_DIR = TARGET .. "/.luarocks" 40local CONFIG_DIR = TARGET .. "/.luarocks"
@@ -158,6 +159,7 @@ local function write_hardcoded_module(dir)
158 local hardcoded = { 159 local hardcoded = {
159 SYSTEM = system, 160 SYSTEM = system,
160 PROCESSOR = processor, 161 PROCESSOR = processor,
162 FORCE_CONFIG = FORCE_CONFIG,
161 163
162 SYSCONFDIR = if_platform("unix", SYSCONFDIR), 164 SYSCONFDIR = if_platform("unix", SYSCONFDIR),
163 165