diff options
-rw-r--r-- | install.bat | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/install.bat b/install.bat index d0d641b7..2150d2c3 100644 --- a/install.bat +++ b/install.bat | |||
@@ -60,7 +60,7 @@ local function print_help() | |||
60 | print(S[[ | 60 | print(S[[ |
61 | Installs LuaRocks. | 61 | Installs LuaRocks. |
62 | 62 | ||
63 | /P [dir] ^(REQUIRED^) Where to install. | 63 | /P [dir] (REQUIRED) Where to install. |
64 | Note that version; $VERSION, will be | 64 | Note that version; $VERSION, will be |
65 | appended to this path. | 65 | appended to this path. |
66 | /CONFIG [dir] Location where the config file should be installed. | 66 | /CONFIG [dir] Location where the config file should be installed. |
@@ -74,7 +74,7 @@ Installs LuaRocks. | |||
74 | Default is 5.1 | 74 | Default is 5.1 |
75 | /L Install LuaRocks' own copy of Lua even if detected, | 75 | /L Install LuaRocks' own copy of Lua even if detected, |
76 | this will always be a 5.1 installation. | 76 | this will always be a 5.1 installation. |
77 | ^(/LUA, /INC, /LIB, /BIN cannot be used with /L^) | 77 | (/LUA, /INC, /LIB, /BIN cannot be used with /L) |
78 | /LUA [dir] Location where Lua is installed - e.g. c:\lua\5.1\ | 78 | /LUA [dir] Location where Lua is installed - e.g. c:\lua\5.1\ |
79 | This is the base directory, the installer will look | 79 | This is the base directory, the installer will look |
80 | for subdirectories bin, lib, include. Alternatively | 80 | for subdirectories bin, lib, include. Alternatively |
@@ -97,7 +97,7 @@ Installs LuaRocks. | |||
97 | /F Remove installation directory if it already exists. | 97 | /F Remove installation directory if it already exists. |
98 | 98 | ||
99 | /R Load registry information to register '.rockspec' | 99 | /R Load registry information to register '.rockspec' |
100 | extension with LuaRocks commands ^(right-click^). | 100 | extension with LuaRocks commands (right-click). |
101 | 101 | ||
102 | ]]) | 102 | ]]) |
103 | end | 103 | end |
@@ -111,7 +111,6 @@ local function parse_options(args) | |||
111 | if name == "/?" then | 111 | if name == "/?" then |
112 | print_help() | 112 | print_help() |
113 | os.exit(0) | 113 | os.exit(0) |
114 | |||
115 | elseif name == "/P" then | 114 | elseif name == "/P" then |
116 | vars.PREFIX = option.value | 115 | vars.PREFIX = option.value |
117 | vars.SYSCONFDIR = option.value | 116 | vars.SYSCONFDIR = option.value |
@@ -198,13 +197,13 @@ local function look_for_interpreter (directory) | |||
198 | vars.LUA_BINDIR = directory .. e | 197 | vars.LUA_BINDIR = directory .. e |
199 | print(" Found ."..e..vars.LUA_INTERPRETER) | 198 | print(" Found ."..e..vars.LUA_INTERPRETER) |
200 | return true | 199 | return true |
201 | 200 | ||
202 | elseif exists(directory..e.."\\lua.exe") then | 201 | elseif exists(directory..e.."\\lua.exe") then |
203 | vars.LUA_INTERPRETER = "lua.exe" | 202 | vars.LUA_INTERPRETER = "lua.exe" |
204 | vars.LUA_BINDIR = directory..e | 203 | vars.LUA_BINDIR = directory..e |
205 | print(" Found ."..e..vars.LUA_INTERPRETER) | 204 | print(" Found ."..e..vars.LUA_INTERPRETER) |
206 | return true | 205 | return true |
207 | 206 | ||
208 | elseif exists(directory..e.."\\luajit.exe") then | 207 | elseif exists(directory..e.."\\luajit.exe") then |
209 | vars.LUA_INTERPRETER = "luajit.exe" | 208 | vars.LUA_INTERPRETER = "luajit.exe" |
210 | vars.LUA_BINDIR = directory..e | 209 | vars.LUA_BINDIR = directory..e |
@@ -226,7 +225,7 @@ local function look_for_link_libraries (directory) | |||
226 | return true | 225 | return true |
227 | end | 226 | end |
228 | end | 227 | end |
229 | die(S"link library ^(one of; $LUA_LIB_NAMES^) not found in $LUA_LIBDIR") | 228 | die(S"link library (one of; $LUA_LIB_NAMES) not found in $LUA_LIBDIR") |
230 | end | 229 | end |
231 | 230 | ||
232 | for _, e in ipairs{ [[\]], [[\lib\]], [[\bin\]]} do | 231 | for _, e in ipairs{ [[\]], [[\lib\]], [[\bin\]]} do |
@@ -240,7 +239,7 @@ local function look_for_link_libraries (directory) | |||
240 | end | 239 | end |
241 | end | 240 | end |
242 | end | 241 | end |
243 | return true | 242 | return false |
244 | end | 243 | end |
245 | 244 | ||
246 | local function look_for_headers (directory) | 245 | local function look_for_headers (directory) |
@@ -261,13 +260,14 @@ local function look_for_headers (directory) | |||
261 | return true | 260 | return true |
262 | end | 261 | end |
263 | end | 262 | end |
263 | return false | ||
264 | end | 264 | end |
265 | 265 | ||
266 | local function look_for_lua_install () | 266 | local function look_for_lua_install () |
267 | print("Looking for Lua interpreter") | 267 | print("Looking for Lua interpreter") |
268 | local directories = { [[c:\lua5.1.2]], [[c:\lua]], [[c:\kepler\1.1]] } | 268 | local directories = { [[c:\lua5.1.2]], [[c:\lua]], [[c:\kepler\1.1]] } |
269 | if vars.LUA_PREFIX then | 269 | if vars.LUA_PREFIX then |
270 | table.insert(1, vars.LUA_PREFIX) | 270 | table.insert(directories, 1, vars.LUA_PREFIX) |
271 | end | 271 | end |
272 | if vars.LUA_BINDIR and vars.LUA_LIBDIR and vars.LUA_INCDIR then | 272 | if vars.LUA_BINDIR and vars.LUA_LIBDIR and vars.LUA_INCDIR then |
273 | if look_for_interpreter(vars.LUA_BINDIR) and | 273 | if look_for_interpreter(vars.LUA_BINDIR) and |
@@ -307,7 +307,7 @@ end | |||
307 | --- | 307 | --- |
308 | -- Poor man's command-line parsing | 308 | -- Poor man's command-line parsing |
309 | local config = {} | 309 | local config = {} |
310 | local with_arg = { | 310 | local with_arg = { -- options followed by an argument, others are flags |
311 | ["/P"] = true, | 311 | ["/P"] = true, |
312 | ["/CONFIG"] = true, | 312 | ["/CONFIG"] = true, |
313 | ["/TREE"] = true, | 313 | ["/TREE"] = true, |
@@ -360,6 +360,7 @@ if not look_for_lua_install() then | |||
360 | vars.LUA_LIBNAME = "lua5.1.lib" | 360 | vars.LUA_LIBNAME = "lua5.1.lib" |
361 | else | 361 | else |
362 | print(S[[ | 362 | print(S[[ |
363 | |||
363 | Will configure LuaRocks with the following paths: | 364 | Will configure LuaRocks with the following paths: |
364 | LuaRocks : $FULL_PREFIX | 365 | LuaRocks : $FULL_PREFIX |
365 | Lua interpreter: $LUA_BINDIR\$LUA_INTERPRETER | 366 | Lua interpreter: $LUA_BINDIR\$LUA_INTERPRETER |
@@ -443,14 +444,14 @@ end | |||
443 | -- configure 'scripts' directory | 444 | -- configure 'scripts' directory |
444 | if vars.SCRIPTS_DIR then | 445 | if vars.SCRIPTS_DIR then |
445 | mkdir(vars.SCRIPTS_DIR) | 446 | mkdir(vars.SCRIPTS_DIR) |
446 | if USE_MINGW then | 447 | if not USE_MINGW then |
447 | -- definitly not for MinGW because of conflicting runtimes | 448 | -- definitly not for MinGW because of conflicting runtimes |
448 | -- but is it ok to do it for others??? | 449 | -- but is it ok to do it for others??? |
449 | exec(S[[COPY lua5.1\bin\*.dll "$SCRIPTS_DIR" >NUL]]) | 450 | exec(S[[COPY lua5.1\bin\*.dll "$SCRIPTS_DIR" >NUL]]) |
450 | end | 451 | end |
451 | else | 452 | else |
453 | if not USE_MINGW then | ||
452 | mkdir(S[[$ROCKS_TREE\bin]]) | 454 | mkdir(S[[$ROCKS_TREE\bin]]) |
453 | if USE_MINGW then | ||
454 | -- definitly not for MinGW because of conflicting runtimes | 455 | -- definitly not for MinGW because of conflicting runtimes |
455 | -- but is it ok to do it for others??? | 456 | -- but is it ok to do it for others??? |
456 | exec(S[[COPY lua5.1\bin\*.dll "$ROCKS_TREE"\bin >NUL]]) | 457 | exec(S[[COPY lua5.1\bin\*.dll "$ROCKS_TREE"\bin >NUL]]) |