diff options
author | Thijs Schreijer <thijs@thijsschreijer.nl> | 2013-04-12 17:43:20 +0200 |
---|---|---|
committer | Thijs Schreijer <thijs@thijsschreijer.nl> | 2013-04-12 17:43:20 +0200 |
commit | 1754ff1e260721c8b36336038a57faf9d1db09e6 (patch) | |
tree | dc046fb0ace4199f1b1df782bc9c7b70be53bde3 | |
parent | 9cb1ccaeafb02c48d1aa87e746b1d2716454485f (diff) | |
download | luarocks-1754ff1e260721c8b36336038a57faf9d1db09e6.tar.gz luarocks-1754ff1e260721c8b36336038a57faf9d1db09e6.tar.bz2 luarocks-1754ff1e260721c8b36336038a57faf9d1db09e6.zip |
updated installer to support 5.2 (extra command switch /LV)
-rw-r--r-- | install.bat | 48 |
1 files changed, 38 insertions, 10 deletions
diff --git a/install.bat b/install.bat index 1bc58bd0..8d7ca1b7 100644 --- a/install.bat +++ b/install.bat | |||
@@ -20,7 +20,9 @@ SET LUA_LIBNAME= | |||
20 | SET FORCE_CONFIG= | 20 | SET FORCE_CONFIG= |
21 | SET USE_MINGW= | 21 | SET USE_MINGW= |
22 | SET MKDIR=.\bin\mkdir -p | 22 | SET MKDIR=.\bin\mkdir -p |
23 | SET LUA_LIB_NAMES=lua5.1.lib lua51.dll liblua.dll.a | 23 | SET LUA_VERSION=5.1 |
24 | SET LUA_SHORTV= | ||
25 | SET LUA_LIB_NAMES=lua5.1.lib lua51.dll liblua.dll.a | ||
24 | SET REGISTRY=OFF | 26 | SET REGISTRY=OFF |
25 | SET P_SET=FALSE | 27 | SET P_SET=FALSE |
26 | 28 | ||
@@ -45,7 +47,10 @@ IF [%1]==[/?] ( | |||
45 | ECHO /SCRIPTS [dir] Where to install scripts installed by rocks. | 47 | ECHO /SCRIPTS [dir] Where to install scripts installed by rocks. |
46 | ECHO Default is TREE/bin. | 48 | ECHO Default is TREE/bin. |
47 | ECHO. | 49 | ECHO. |
48 | ECHO /L Install LuaRocks' own copy of Lua even if detected. | 50 | ECHO /LV [version] Lua version to use; either 5.1 or 5.2. |
51 | ECHO Default is 5.1 | ||
52 | ECHO /L Install LuaRocks' own copy of Lua even if detected, | ||
53 | ECHO this will always be a 5.1 installation. | ||
49 | ECHO ^(/LUA, /INC, /LIB, /BIN cannot be used with /L^) | 54 | ECHO ^(/LUA, /INC, /LIB, /BIN cannot be used with /L^) |
50 | ECHO /LUA [dir] Location where Lua is installed - e.g. c:\lua\5.1\ | 55 | ECHO /LUA [dir] Location where Lua is installed - e.g. c:\lua\5.1\ |
51 | ECHO This is the base directory, the installer will look | 56 | ECHO This is the base directory, the installer will look |
@@ -100,6 +105,12 @@ IF /I [%1]==[/SCRIPTS] ( | |||
100 | SHIFT /1 | 105 | SHIFT /1 |
101 | GOTO PARSE_LOOP | 106 | GOTO PARSE_LOOP |
102 | ) | 107 | ) |
108 | IF /I [%1]==[/LV] ( | ||
109 | SET LUA_VERSION=%~2 | ||
110 | SHIFT /1 | ||
111 | SHIFT /1 | ||
112 | GOTO PARSE_LOOP | ||
113 | ) | ||
103 | IF /I [%1]==[/L] ( | 114 | IF /I [%1]==[/L] ( |
104 | SET INSTALL_LUA=ON | 115 | SET INSTALL_LUA=ON |
105 | SHIFT /1 | 116 | SHIFT /1 |
@@ -163,14 +174,27 @@ IF [%INSTALL_LUA%]==[ON] ( | |||
163 | ECHO Cannot combine option /L with any of /LUA /BIN /LIB /INC | 174 | ECHO Cannot combine option /L with any of /LUA /BIN /LIB /INC |
164 | GOTO ERROR | 175 | GOTO ERROR |
165 | ) | 176 | ) |
177 | IF NOT [%LUA_VERSION%]==[5.1] ( | ||
178 | ECHO Bundled Lua version is 5.1, cannot install 5.2 | ||
179 | GOTO ERROR | ||
180 | ) | ||
181 | ) | ||
182 | IF NOT [%LUA_VERSION%]==[5.1] ( | ||
183 | IF [%LUA_VERSION%]==[5.2] ( | ||
184 | SET LUA_LIB_NAMES=%LUA_LIB_NAMES:5.1=5.2% | ||
185 | SET LUA_LIB_NAMES=%LUA_LIB_NAMES:51=52% | ||
186 | ) ELSE ( | ||
187 | ECHO Bad argument: /LV must either be 5.1 or 5.2 | ||
188 | GOTO ERROR | ||
189 | ) | ||
166 | ) | 190 | ) |
167 | 191 | ||
168 | SET FULL_PREFIX=%PREFIX%\%VERSION% | 192 | SET FULL_PREFIX=%PREFIX%\%VERSION% |
169 | |||
170 | SET BINDIR=%FULL_PREFIX% | 193 | SET BINDIR=%FULL_PREFIX% |
171 | SET LIBDIR=%FULL_PREFIX% | 194 | SET LIBDIR=%FULL_PREFIX% |
172 | SET LUADIR=%FULL_PREFIX%\lua | 195 | SET LUADIR=%FULL_PREFIX%\lua |
173 | SET INCDIR=%FULL_PREFIX%\include | 196 | SET INCDIR=%FULL_PREFIX%\include |
197 | SET LUA_SHORTV=%LUA_VERSION:.=% | ||
174 | 198 | ||
175 | REM *********************************************************** | 199 | REM *********************************************************** |
176 | REM Detect Lua | 200 | REM Detect Lua |
@@ -184,8 +208,8 @@ FOR %%L IN (%LUA_PREFIX% c:\lua\5.1.2 c:\lua c:\kepler\1.1) DO ( | |||
184 | SET CURR=%%L | 208 | SET CURR=%%L |
185 | IF EXIST "%%L" ( | 209 | IF EXIST "%%L" ( |
186 | IF NOT [%LUA_BINDIR%]==[] ( | 210 | IF NOT [%LUA_BINDIR%]==[] ( |
187 | IF EXIST %LUA_BINDIR%\lua5.1.exe ( | 211 | IF EXIST %LUA_BINDIR%\lua%LUA_VERSION%.exe ( |
188 | SET LUA_INTERPRETER=lua5.1.exe | 212 | SET LUA_INTERPRETER=lua%LUA_VERSION%.exe |
189 | ECHO Found .\!LUA_INTERPRETER! | 213 | ECHO Found .\!LUA_INTERPRETER! |
190 | GOTO INTERPRETER_IS_SET | 214 | GOTO INTERPRETER_IS_SET |
191 | ) | 215 | ) |
@@ -199,13 +223,13 @@ FOR %%L IN (%LUA_PREFIX% c:\lua\5.1.2 c:\lua c:\kepler\1.1) DO ( | |||
199 | ECHO Found .\!LUA_INTERPRETER! | 223 | ECHO Found .\!LUA_INTERPRETER! |
200 | GOTO INTERPRETER_IS_SET | 224 | GOTO INTERPRETER_IS_SET |
201 | ) | 225 | ) |
202 | ECHO Lua executable lua.exe, luajit.exe or lua5.1.exe not found in %LUA_BINDIR% | 226 | ECHO Lua executable lua.exe, luajit.exe or lua%LUA_VERSION%.exe not found in %LUA_BINDIR% |
203 | GOTO ERROR | 227 | GOTO ERROR |
204 | ) | 228 | ) |
205 | SET CURR=%%L | 229 | SET CURR=%%L |
206 | FOR %%E IN (\ \bin\) DO ( | 230 | FOR %%E IN (\ \bin\) DO ( |
207 | IF EXIST "%%L%%E\lua5.1.exe" ( | 231 | IF EXIST "%%L%%E\lua%LUA_VERSION%.exe" ( |
208 | SET LUA_INTERPRETER=lua5.1.exe | 232 | SET LUA_INTERPRETER=lua%LUA_VERSION%.exe |
209 | SET LUA_BINDIR=%%L%%E | 233 | SET LUA_BINDIR=%%L%%E |
210 | ECHO Found .\%%E\!LUA_INTERPRETER! | 234 | ECHO Found .\%%E\!LUA_INTERPRETER! |
211 | GOTO INTERPRETER_IS_SET | 235 | GOTO INTERPRETER_IS_SET |
@@ -286,6 +310,10 @@ FOR %%L IN (%LUA_PREFIX% c:\lua\5.1.2 c:\lua c:\kepler\1.1) DO ( | |||
286 | ECHO Could not find Lua. Will install its own copy. | 310 | ECHO Could not find Lua. Will install its own copy. |
287 | ECHO See /? for options for specifying the location of Lua. | 311 | ECHO See /? for options for specifying the location of Lua. |
288 | :USE_OWN_LUA | 312 | :USE_OWN_LUA |
313 | IF NOT [LUA_VERSION]==[5.1] ( | ||
314 | ECHO Cannot install own copy because no 5.2 version is bundled | ||
315 | GOTO ERROR | ||
316 | ) | ||
289 | SET INSTALL_LUA=ON | 317 | SET INSTALL_LUA=ON |
290 | SET LUA_INTERPRETER=lua5.1 | 318 | SET LUA_INTERPRETER=lua5.1 |
291 | SET LUA_BINDIR=%BINDIR% | 319 | SET LUA_BINDIR=%BINDIR% |
@@ -457,8 +485,8 @@ ECHO *** LuaRocks is installed! *** | |||
457 | ECHO. | 485 | ECHO. |
458 | ECHO You may want to add the following elements to your paths; | 486 | ECHO You may want to add the following elements to your paths; |
459 | ECHO PATH : %LUA_BINDIR%;%FULL_PREFIX% | 487 | ECHO PATH : %LUA_BINDIR%;%FULL_PREFIX% |
460 | ECHO LUA_PATH : %ROCKS_TREE%\share\lua\5.1\?.lua;%ROCKS_TREE%\share\lua\5.1\?\init.lua | 488 | ECHO LUA_PATH : %ROCKS_TREE%\share\lua\%LUA_VERSION%\?.lua;%ROCKS_TREE%\share\lua\%LUA_VERSION%\?\init.lua |
461 | ECHO LUA_CPATH: %LUA_LIBDIR%\lua\5.1\?.dll | 489 | ECHO LUA_CPATH: %LUA_LIBDIR%\lua\%LUA_VERSION%\?.dll |
462 | ECHO. | 490 | ECHO. |
463 | :QUIT | 491 | :QUIT |
464 | ENDLOCAL | 492 | ENDLOCAL |