From c76b4315010575826a37cabb2dcfa5638baf2161 Mon Sep 17 00:00:00 2001 From: Thijs Schreijer Date: Thu, 4 Apr 2013 10:48:31 +0200 Subject: fix lib extension and remove default mcvcr80 runtime for MinGW --- src/luarocks/build/builtin.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/luarocks/build/builtin.lua b/src/luarocks/build/builtin.lua index 485ff370..e0f1c848 100644 --- a/src/luarocks/build/builtin.lua +++ b/src/luarocks/build/builtin.lua @@ -73,9 +73,9 @@ function run(rockspec) compile_library = function(library, objects, libraries, libdirs, name) local extras = { unpack(objects) } add_flags(extras, "-L%s", libdirs) - add_flags(extras, "%s.lib", libraries) + add_flags(extras, "-l%s", libraries) extras[#extras+1] = dir.path(variables.LUA_LIBDIR, variables.LUALIB) - extras[#extras+1] = "-l" .. (variables.MSVCRT or "msvcr80") + extras[#extras+1] = "-l" .. (variables.MSVCRT or "m") local ok = execute(variables.LD.." "..variables.LIBFLAG, "-o", library, unpack(extras)) return ok end @@ -89,7 +89,7 @@ function run(rockspec) local ok = execute(variables.RC, "-o", resname, rcname) if not ok then return ok end ok = execute(variables.LD, "-o", wrapname, resname, variables.WRAPPER, - dir.path(variables.LUA_LIBDIR, variables.LUALIB), "-l" .. (variables.MSVCRT or "msvcr80"), "-luser32") + dir.path(variables.LUA_LIBDIR, variables.LUALIB), "-l" .. (variables.MSVCRT or "m"), "-luser32") return ok, wrapname end elseif cfg.is_platform("win32") then -- cgit v1.2.3-55-g6feb From 2c5dcbcc655a02d1d91f85113a84180944e8d57b Mon Sep 17 00:00:00 2001 From: Thijs Schreijer Date: Thu, 4 Apr 2013 19:15:30 +0200 Subject: added some clarification to the installer batch file help text --- install.bat | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/install.bat b/install.bat index 86766eb1..16a0ffc0 100644 --- a/install.bat +++ b/install.bat @@ -29,7 +29,8 @@ IF [%1]==[/?] ( ECHO Installs LuaRocks. ECHO. ECHO /P [dir] Where to install. - ECHO Default is %PREFIX% + ECHO Default is %PREFIX% (version; %VERSION%, will be + ECHO appended to this path^) ECHO /CONFIG [dir] Location where the config file should be installed. ECHO Default is same place of installation ECHO /TREE [dir] Root of the local tree of installed rocks. @@ -38,6 +39,8 @@ IF [%1]==[/?] ( ECHO Default is TREE/bin. ECHO. ECHO /L Install LuaRocks' own copy of Lua even if detected. + ECHO (/LUA, /INC, /LIB, /BIN will be ignored when used + ECHO with /L^) ECHO /LUA [dir] Location where Lua is installed - e.g. c:\lua\5.1\ ECHO /INC [dir] Location of Lua includes - e.g. c:\lua\5.1\include ECHO /LIB [dir] Location of Lua libraries -e.g. c:\lua\5.1\lib @@ -157,7 +160,7 @@ FOR %%L IN (%LUA_PREFIX% c:\lua\5.1.2 c:\lua c:\kepler\1.1) DO ( SET LUA_INTERPRETER=luajit.exe GOTO INTERPRETER_IS_SET ) - ECHO Lua executable lua.exe or lua5.1.exe not found in %LUA_BINDIR% + ECHO Lua executable lua.exe, luajit.exe or lua5.1.exe not found in %LUA_BINDIR% GOTO ERROR ) SET CURR=%%L -- cgit v1.2.3-55-g6feb From f730d9d661dec04bd6c3c7aa66d3ef917ae99adb Mon Sep 17 00:00:00 2001 From: Thijs Schreijer Date: Thu, 4 Apr 2013 21:29:06 +0200 Subject: more clarification of help text --- install.bat | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/install.bat b/install.bat index 16a0ffc0..2ded3802 100644 --- a/install.bat +++ b/install.bat @@ -42,9 +42,16 @@ IF [%1]==[/?] ( ECHO (/LUA, /INC, /LIB, /BIN will be ignored when used ECHO with /L^) ECHO /LUA [dir] Location where Lua is installed - e.g. c:\lua\5.1\ + ECHO This is the base directory, the installer will look + ECHO for subdirectories bin, lib, include. Alternatively + ECHO these can be specified explicitly using the /INC, + ECHO /LIB, and /BIN options. ECHO /INC [dir] Location of Lua includes - e.g. c:\lua\5.1\include + ECHO If provided overrides sub directory found using /LUA. ECHO /LIB [dir] Location of Lua libraries -e.g. c:\lua\5.1\lib + ECHO If provided overrides sub directory found using /LUA. ECHO /BIN [dir] Location of Lua executables - e.g. c:\lua\5.1\bin + ECHO If provided overrides sub directory found using /LUA. ECHO. ECHO /MW Use mingw as build system instead of MSVC ECHO. -- cgit v1.2.3-55-g6feb From e1bcb8ae718048eb8537f813f7bf93066f4817d7 Mon Sep 17 00:00:00 2001 From: Thijs Schreijer Date: Thu, 4 Apr 2013 22:07:03 +0200 Subject: added comments in th installer, added slightly more verbose output during installing, and fixed the bug of MinGW binaries being overwritten. --- install.bat | 59 ++++++++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 42 insertions(+), 17 deletions(-) diff --git a/install.bat b/install.bat index 2ded3802..a2291950 100644 --- a/install.bat +++ b/install.bat @@ -259,22 +259,24 @@ ECHO Installing LuaRocks in %FULL_PREFIX%... IF NOT EXIST "%BINDIR%" %MKDIR% "%BINDIR%" IF ERRORLEVEL 1 GOTO ERROR IF [%INSTALL_LUA%]==[ON] ( + REM Copy the included Lua interpreter binaries IF NOT EXIST "%LUA_BINDIR%" %MKDIR% "%LUA_BINDIR%" IF NOT EXIST "%LUA_INCDIR%" %MKDIR% "%LUA_INCDIR%" -REM IF [%USE_MINGW%]==[ON] ( -REM COPY lua5.1\mingw32-bin\*.* "%LUA_BINDIR%" >NUL -REM ) ELSE ( - COPY lua5.1\bin\*.* "%LUA_BINDIR%" >NUL -REM ) + COPY lua5.1\bin\*.* "%LUA_BINDIR%" >NUL COPY lua5.1\include\*.* "%LUA_INCDIR%" >NUL + ECHO Installed the LuaRocks bundled Lua interpreter in %LUA_BINDIR% ) +REM Copy the LuaRocks binaries COPY bin\*.* "%BINDIR%" >NUL IF ERRORLEVEL 1 GOTO ERROR +REM Create start scripts COPY src\bin\*.* "%BINDIR%" >NUL IF ERRORLEVEL 1 GOTO ERROR FOR %%C IN (luarocks luarocks-admin) DO ( + REM rename unix-lua scripts to .lua files RENAME "%BINDIR%\%%C" %%C.lua IF ERRORLEVEL 1 GOTO ERROR + REM create a bootstrap batch file for the lua file, to start them DEL /F /Q "%BINDIR%\%%C.bat" 2>NUL ECHO @ECHO OFF>> "%BINDIR%\%%C.bat" ECHO SETLOCAL>> "%BINDIR%\%%C.bat" @@ -282,12 +284,17 @@ FOR %%C IN (luarocks luarocks-admin) DO ( ECHO SET PATH=%BINDIR%\;%%PATH%%>> "%BINDIR%\%%C.bat" ECHO "%LUA_INTERPRETER%" "%BINDIR%\%%C.lua" %%*>> "%BINDIR%\%%C.bat" ECHO ENDLOCAL>> "%BINDIR%\%%C.bat" + ECHO Created LuaRocks command: %BINDIR%\%%C.bat ) +REM Copy the LuaRocks lua source files IF NOT EXIST "%LUADIR%\luarocks" %MKDIR% "%LUADIR%\luarocks" IF ERRORLEVEL 1 GOTO ERROR XCOPY /S src\luarocks\*.* "%LUADIR%\luarocks" >NUL IF ERRORLEVEL 1 GOTO ERROR +ECHO. +ECHO Configuring LuaRocks... +REM Create a site-config file IF EXIST "%LUADIR%\luarocks\site_config.lua" RENAME "%LUADIR%\luarocks\site_config.lua" site_config.lua.bak ECHO module("luarocks.site_config")>> "%LUADIR%\luarocks\site_config.lua" ECHO LUA_INCDIR=[[%LUA_INCDIR%]]>> "%LUADIR%\luarocks\site_config.lua" @@ -309,7 +316,9 @@ IF NOT [%FORCE_CONFIG%]==[] ECHO local LUAROCKS_FORCE_CONFIG=true>> "%LUADIR%\lu IF EXIST "%LUADIR%\luarocks\site_config.lua.bak" TYPE "%LUADIR%\luarocks\site_config.lua.bak">> "%LUADIR%\luarocks\site_config.lua" IF EXIST "%LUADIR%\luarocks\site_config.lua.bak" DEL /F /Q "%LUADIR%\luarocks\site_config.lua.bak" +ECHO Created LuaRocks site-config file: %LUADIR%\luarocks\site_config.lua +REM create config file SET CONFIG_FILE=%SYSCONFDIR%\config.lua IF NOT EXIST "%SYSCONFDIR%" %MKDIR% "%SYSCONFDIR%" @@ -322,38 +331,54 @@ IF NOT EXIST "%CONFIG_FILE%" ( ECHO [[%ROCKS_TREE%]]>> "%CONFIG_FILE%" ECHO }>> "%CONFIG_FILE%" IF NOT [%SCRIPTS_DIR%]==[] ECHO scripts_dir=[[%SCRIPTS_DIR%]]>> "%CONFIG_FILE%" + ECHO Created LuaRocks config file: %CONFIG_FILE% +) ELSE ( + ECHO LuaRocks config file already exists: %CONFIG_FILE% ) IF [%SCRIPTS_DIR%]==[] ( %MKDIR% "%ROCKS_TREE%"\bin >NUL -REM IF [%USE_MINGW%]==[ON] ( -REM COPY lua5.1\mingw32-bin\*.dll "%ROCKS_TREE%"\bin >NUL -REM ) ELSE ( + IF [%USE_MINGW%]==[] ( + REM definitly not for MinGW because of conflicting runtimes + REM but is it ok to do it for others??? COPY lua5.1\bin\*.dll "%ROCKS_TREE%"\bin >NUL -REM ) -) -IF NOT [%SCRIPTS_DIR%]==[] ( + ) +) ELSE ( %MKDIR% "%SCRIPTS_DIR%" >NUL -REM IF [%USE_MINGW%]==[ON] ( -REM COPY lua5.1\mingw32-bin\*.dll "%SCRIPTS_DIR%" >NUL -REM ) ELSE ( + IF [%USE_MINGW%]==[] ( + REM definitly not for MinGW because of conflicting runtimes + REM but is it ok to do it for others??? COPY lua5.1\bin\*.dll "%SCRIPTS_DIR%" >NUL -REM ) + ) ) -IF NOT EXIST "%ROCKS_TREE%" %MKDIR% "%ROCKS_TREE%" -IF NOT EXIST "%APPDATA%/luarocks" %MKDIR% "%APPDATA%/luarocks" +ECHO. +ECHO Creating rocktrees... +IF NOT EXIST "%ROCKS_TREE%" ( + %MKDIR% "%ROCKS_TREE%" + ECHO Created rocktree: "%ROCKS_TREE%" +) ELSE ( + ECHO Rocktree exists: "%ROCKS_TREE%" +) +IF NOT EXIST "%APPDATA%/luarocks" ( + %MKDIR% "%APPDATA%/luarocks" + ECHO Created rocktree: "%APPDATA%/luarocks" +) ELSE ( + ECHO Rocktree exists: "%APPDATA%/luarocks" +) REM *********************************************************** REM Exit handlers REM *********************************************************** +ECHO. ECHO LuaRocks is installed! :QUIT ENDLOCAL EXIT /B 0 :ERROR +ECHO. ECHO Failed installing LuaRocks. ENDLOCAL EXIT /B 1 -- cgit v1.2.3-55-g6feb From d6887107864b27abab53273d7dfa3a70fe70ee3a Mon Sep 17 00:00:00 2001 From: Thijs Schreijer Date: Thu, 4 Apr 2013 23:19:30 +0200 Subject: added user instructions for updating path variables --- install.bat | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/install.bat b/install.bat index a2291950..cd02af1a 100644 --- a/install.bat +++ b/install.bat @@ -362,15 +362,20 @@ IF NOT EXIST "%ROCKS_TREE%" ( ) IF NOT EXIST "%APPDATA%/luarocks" ( %MKDIR% "%APPDATA%/luarocks" - ECHO Created rocktree: "%APPDATA%/luarocks" + ECHO Created rocktree: "%APPDATA%\luarocks" ) ELSE ( - ECHO Rocktree exists: "%APPDATA%/luarocks" + ECHO Rocktree exists: "%APPDATA%\luarocks" ) REM *********************************************************** REM Exit handlers REM *********************************************************** +ECHO. +ECHO You may want to add the following elements to your paths; +ECHO PATH : %LUA_BINDIR%;%FULL_PREFIX% +ECHO LUA_PATH : %ROCKS_TREE%\share\lua\5.1\?.lua;%ROCKS_TREE%\share\lua\5.1\?\init.lua +ECHO LUA_CPATH: %LUA_LIBDIR%\lua\5.1\?.dll ECHO. ECHO LuaRocks is installed! :QUIT -- cgit v1.2.3-55-g6feb From c5bffdc43848d00ac97cfd402f33f19b506dd65c Mon Sep 17 00:00:00 2001 From: Thijs Schreijer Date: Fri, 5 Apr 2013 19:11:18 +0200 Subject: moved some blocks around to make it more logical --- install.bat | 43 ++++++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/install.bat b/install.bat index cd02af1a..568bc0f0 100644 --- a/install.bat +++ b/install.bat @@ -269,6 +269,11 @@ IF [%INSTALL_LUA%]==[ON] ( REM Copy the LuaRocks binaries COPY bin\*.* "%BINDIR%" >NUL IF ERRORLEVEL 1 GOTO ERROR +REM Copy the LuaRocks lua source files +IF NOT EXIST "%LUADIR%\luarocks" %MKDIR% "%LUADIR%\luarocks" +IF ERRORLEVEL 1 GOTO ERROR +XCOPY /S src\luarocks\*.* "%LUADIR%\luarocks" >NUL +IF ERRORLEVEL 1 GOTO ERROR REM Create start scripts COPY src\bin\*.* "%BINDIR%" >NUL IF ERRORLEVEL 1 GOTO ERROR @@ -286,11 +291,23 @@ FOR %%C IN (luarocks luarocks-admin) DO ( ECHO ENDLOCAL>> "%BINDIR%\%%C.bat" ECHO Created LuaRocks command: %BINDIR%\%%C.bat ) -REM Copy the LuaRocks lua source files -IF NOT EXIST "%LUADIR%\luarocks" %MKDIR% "%LUADIR%\luarocks" -IF ERRORLEVEL 1 GOTO ERROR -XCOPY /S src\luarocks\*.* "%LUADIR%\luarocks" >NUL -IF ERRORLEVEL 1 GOTO ERROR +REM configure 'scripts' directory +IF [%SCRIPTS_DIR%]==[] ( + %MKDIR% "%ROCKS_TREE%"\bin >NUL + IF [%USE_MINGW%]==[] ( + REM definitly not for MinGW because of conflicting runtimes + REM but is it ok to do it for others??? + COPY lua5.1\bin\*.dll "%ROCKS_TREE%"\bin >NUL + ) +) ELSE ( + %MKDIR% "%SCRIPTS_DIR%" >NUL + IF [%USE_MINGW%]==[] ( + REM definitly not for MinGW because of conflicting runtimes + REM but is it ok to do it for others??? + COPY lua5.1\bin\*.dll "%SCRIPTS_DIR%" >NUL + ) +) + ECHO. ECHO Configuring LuaRocks... @@ -336,22 +353,6 @@ IF NOT EXIST "%CONFIG_FILE%" ( ECHO LuaRocks config file already exists: %CONFIG_FILE% ) -IF [%SCRIPTS_DIR%]==[] ( - %MKDIR% "%ROCKS_TREE%"\bin >NUL - IF [%USE_MINGW%]==[] ( - REM definitly not for MinGW because of conflicting runtimes - REM but is it ok to do it for others??? - COPY lua5.1\bin\*.dll "%ROCKS_TREE%"\bin >NUL - ) -) ELSE ( - %MKDIR% "%SCRIPTS_DIR%" >NUL - IF [%USE_MINGW%]==[] ( - REM definitly not for MinGW because of conflicting runtimes - REM but is it ok to do it for others??? - COPY lua5.1\bin\*.dll "%SCRIPTS_DIR%" >NUL - ) -) - ECHO. ECHO Creating rocktrees... IF NOT EXIST "%ROCKS_TREE%" ( -- cgit v1.2.3-55-g6feb From c3d3e637776ba67c8bfdb202df42938bdee98f48 Mon Sep 17 00:00:00 2001 From: Thijs Schreijer Date: Sat, 6 Apr 2013 07:52:19 +0200 Subject: Updated installer batch file library name to link against is now configurable, and a default list to look for is set Library and runtime will be written into the config files now /L can no longer be used with /LUA /INC /BIN /LIB (will error and exit) More verbose output while searching for a Lua installation --- install.bat | 92 +++++++++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 74 insertions(+), 18 deletions(-) diff --git a/install.bat b/install.bat index 568bc0f0..88ea283e 100644 --- a/install.bat +++ b/install.bat @@ -2,7 +2,7 @@ REM Boy, it feels like 1994 all over again. -SETLOCAL +SETLOCAL ENABLEDELAYEDEXPANSION SET PREFIX=C:\LuaRocks SET VERSION=2.0 @@ -16,12 +16,16 @@ SET LUA_PREFIX= SET LUA_BINDIR= SET LUA_INCDIR= SET LUA_LIBDIR= +SET LUA_LIBNAME= SET FORCE_CONFIG= SET MKDIR=.\bin\mkdir -p +SET LUA_LIB_NAMES=lua5.1.lib lua51.dll liblua.dll.a REM *********************************************************** REM Option parser REM *********************************************************** +ECHO LuaRocks %VERSION%.x installer. +ECHO. :PARSE_LOOP IF [%1]==[] GOTO DONE_PARSING @@ -29,7 +33,7 @@ IF [%1]==[/?] ( ECHO Installs LuaRocks. ECHO. ECHO /P [dir] Where to install. - ECHO Default is %PREFIX% (version; %VERSION%, will be + ECHO Default is %PREFIX% ^(version; %VERSION%, will be ECHO appended to this path^) ECHO /CONFIG [dir] Location where the config file should be installed. ECHO Default is same place of installation @@ -39,8 +43,7 @@ IF [%1]==[/?] ( ECHO Default is TREE/bin. ECHO. ECHO /L Install LuaRocks' own copy of Lua even if detected. - ECHO (/LUA, /INC, /LIB, /BIN will be ignored when used - ECHO with /L^) + ECHO ^(/LUA, /INC, /LIB, /BIN cannot be used with /L^) ECHO /LUA [dir] Location where Lua is installed - e.g. c:\lua\5.1\ ECHO This is the base directory, the installer will look ECHO for subdirectories bin, lib, include. Alternatively @@ -138,6 +141,14 @@ ECHO Unrecognized option: %1 GOTO ERROR :DONE_PARSING +REM check for combination flags +IF [%INSTALL_LUA%]==[ON] ( + IF NOT [%LUA_INCDIR%%LUA_BINDIR%%LUA_LIBDIR%%LUA_PREFIX%]==[] ( + ECHO Cannot combine option /L with any of /LUA /BIN /LIB /INC + GOTO ERROR + ) +) + SET FULL_PREFIX=%PREFIX%\%VERSION% SET BINDIR=%FULL_PREFIX% @@ -151,20 +162,25 @@ REM *********************************************************** IF [%INSTALL_LUA%]==[ON] GOTO USE_OWN_LUA +ECHO Looking for Lua interpreter FOR %%L IN (%LUA_PREFIX% c:\lua\5.1.2 c:\lua c:\kepler\1.1) DO ( + ECHO checking %%L SET CURR=%%L IF EXIST "%%L" ( IF NOT [%LUA_BINDIR%]==[] ( IF EXIST %LUA_BINDIR%\lua5.1.exe ( SET LUA_INTERPRETER=lua5.1.exe + ECHO Found .\!LUA_INTERPRETER! GOTO INTERPRETER_IS_SET ) IF EXIST %LUA_BINDIR%\lua.exe ( SET LUA_INTERPRETER=lua.exe + ECHO Found .\!LUA_INTERPRETER! GOTO INTERPRETER_IS_SET ) IF EXIST %LUA_BINDIR%\luajit.exe ( SET LUA_INTERPRETER=luajit.exe + ECHO Found .\!LUA_INTERPRETER! GOTO INTERPRETER_IS_SET ) ECHO Lua executable lua.exe, luajit.exe or lua5.1.exe not found in %LUA_BINDIR% @@ -175,51 +191,78 @@ FOR %%L IN (%LUA_PREFIX% c:\lua\5.1.2 c:\lua c:\kepler\1.1) DO ( IF EXIST "%%L%%E\lua5.1.exe" ( SET LUA_INTERPRETER=lua5.1.exe SET LUA_BINDIR=%%L%%E + ECHO Found .\%%E\!LUA_INTERPRETER! GOTO INTERPRETER_IS_SET ) IF EXIST "%%L%%E\lua.exe" ( SET LUA_INTERPRETER=lua.exe SET LUA_BINDIR=%%L%%E + ECHO Found .\%%E\!LUA_INTERPRETER! GOTO INTERPRETER_IS_SET ) IF EXIST "%%L%%E\luajit.exe" ( SET LUA_INTERPRETER=luajit.exe SET LUA_BINDIR=%%L%%E + ECHO Found .\%%E\!LUA_INTERPRETER! GOTO INTERPRETER_IS_SET ) ) + ECHO No Lua interpreter found GOTO TRY_NEXT_LUA_DIR :INTERPRETER_IS_SET - IF NOT "%LUA_LIBDIR%"=="" ( - IF EXIST %LUA_LIBDIR%\lua5.1.lib GOTO LIBDIR_IS_SET - ECHO lua5.1.lib not found in %LUA_LIBDIR% + ECHO Interpreter found, now looking for link libraries... + IF NOT [%LUA_LIBDIR%]==[] ( + FOR %%T IN (%LUA_LIB_NAMES%) DO ( + ECHO checking for %LUA_LIBDIR%\%%T + IF EXIST "%LUA_LIBDIR%\%%T" ( + SET LUA_LIBNAME=%%T + ECHO Found %%T + GOTO LIBDIR_IS_SET + ) + ) + ECHO link library ^(one of; %LUA_LIB_NAMES%^) not found in %LUA_LIBDIR% GOTO ERROR ) FOR %%E IN (\ \lib\ \bin\) DO ( - IF EXIST "%CURR%%%E\lua5.1.lib" ( - SET LUA_LIBDIR=%CURR%%%E - GOTO LIBDIR_IS_SET + FOR %%S IN (%LUA_LIB_NAMES%) DO ( + ECHO checking for %CURR%%%E\%%S + IF EXIST "%CURR%%%E\%%S" ( + SET LUA_LIBDIR=%CURR%%%E + SET LUA_LIBNAME=%%S + ECHO Found %%S + GOTO LIBDIR_IS_SET + ) ) ) GOTO TRY_NEXT_LUA_DIR :LIBDIR_IS_SET + ECHO Link library found, now looking for headers... IF NOT [%LUA_INCDIR%]==[] ( - IF EXIST %LUA_INCDIR%\lua.h GOTO INCDIR_IS_SET + ECHO checking for %LUA_INCDIR%\lua.h + IF EXIST %LUA_INCDIR%\lua.h ( + ECHO Found lua.h + GOTO INCDIR_IS_SET + ) ECHO lua.h not found in %LUA_INCDIR% GOTO ERROR ) FOR %%E IN (\ \include\) DO ( + ECHO checking for %CURR%%%E\lua.h IF EXIST "%CURR%%%E\lua.h" ( SET LUA_INCDIR=%CURR%%%E + ECHO Found lua.h GOTO INCDIR_IS_SET ) ) GOTO TRY_NEXT_LUA_DIR :INCDIR_IS_SET - %LUA_BINDIR%\%LUA_INTERPRETER% -v 2>NUL + ECHO Headers found, now testing interpreter... + %LUA_BINDIR%\%LUA_INTERPRETER% -v 2>NUL IF NOT ERRORLEVEL 1 ( + ECHO Ok GOTO LUA_IS_SET ) + ECHO Interpreter returned an error, not ok ) :TRY_NEXT_LUA_DIR REM wtf @@ -232,13 +275,16 @@ SET LUA_INTERPRETER=lua5.1 SET LUA_BINDIR=%BINDIR% SET LUA_LIBDIR=%LIBDIR% SET LUA_INCDIR=%INCDIR% +SET LUA_LIBNAME=lua5.1.lib :LUA_IS_SET ECHO. ECHO Will configure LuaRocks with the following paths: -ECHO Lua interpreter: %LUA_INTERPRETER% -ECHO Lua binaries: %LUA_BINDIR% -ECHO Lua libraries: %LUA_LIBDIR% -ECHO Lua includes: %LUA_INCDIR% +ECHO LuaRocks : %FULL_PREFIX% +ECHO Lua interpreter: %LUA_BINDIR%\%LUA_INTERPRETER% +ECHO Lua binaries : %LUA_BINDIR% +ECHO Lua libraries : %LUA_LIBDIR% +ECHO Lua includes : %LUA_INCDIR% +ECHO Binaries will be linked against: %LUA_LIBNAME% ECHO. REM *********************************************************** @@ -248,6 +294,7 @@ REM *********************************************************** IF [%FORCE%]==[ON] ( ECHO Removing %FULL_PREFIX%... RD /S /Q "%FULL_PREFIX%" + ECHO. ) IF NOT EXIST "%FULL_PREFIX%" GOTO NOT_EXIST_PREFIX @@ -348,6 +395,14 @@ IF NOT EXIST "%CONFIG_FILE%" ( ECHO [[%ROCKS_TREE%]]>> "%CONFIG_FILE%" ECHO }>> "%CONFIG_FILE%" IF NOT [%SCRIPTS_DIR%]==[] ECHO scripts_dir=[[%SCRIPTS_DIR%]]>> "%CONFIG_FILE%" + ECHO variables = {>> "%CONFIG_FILE%" + IF [%USE_MINGW%]==[ON] ( + ECHO MSVCRT = 'm',>> "%CONFIG_FILE%" + ) ELSE ( + ECHO MSVCRT = 'msvcr80',>> "%CONFIG_FILE%" + ) + ECHO LUALIB = '%LUA_LIB_NAME%'>> "%CONFIG_FILE%" + ECHO }>> "%CONFIG_FILE%" ECHO Created LuaRocks config file: %CONFIG_FILE% ) ELSE ( ECHO LuaRocks config file already exists: %CONFIG_FILE% @@ -372,19 +427,20 @@ REM *********************************************************** REM Exit handlers REM *********************************************************** +ECHO. +ECHO *** LuaRocks is installed! *** ECHO. ECHO You may want to add the following elements to your paths; ECHO PATH : %LUA_BINDIR%;%FULL_PREFIX% ECHO LUA_PATH : %ROCKS_TREE%\share\lua\5.1\?.lua;%ROCKS_TREE%\share\lua\5.1\?\init.lua ECHO LUA_CPATH: %LUA_LIBDIR%\lua\5.1\?.dll ECHO. -ECHO LuaRocks is installed! :QUIT ENDLOCAL EXIT /B 0 :ERROR ECHO. -ECHO Failed installing LuaRocks. +ECHO Failed installing LuaRocks. Run with /? for help. ENDLOCAL EXIT /B 1 -- cgit v1.2.3-55-g6feb From c2ef47e57b0fa3fbf6f157192a4138d776ded690 Mon Sep 17 00:00:00 2001 From: Thijs Schreijer Date: Sat, 6 Apr 2013 10:05:05 +0200 Subject: installer bugfix in case of quoted arguments for paths --- install.bat | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/install.bat b/install.bat index 88ea283e..d79a1619 100644 --- a/install.bat +++ b/install.bat @@ -68,27 +68,27 @@ IF [%1]==[/?] ( GOTO QUIT ) IF /I [%1]==[/P] ( - SET PREFIX=%2 - SET SYSCONFDIR=%2 - SET ROCKS_TREE=%2 + SET PREFIX=%~2 + SET SYSCONFDIR=%~2 + SET ROCKS_TREE=%~2 SHIFT /1 SHIFT /1 GOTO PARSE_LOOP ) IF /I [%1]==[/CONFIG] ( - SET SYSCONFDIR=%2 + SET SYSCONFDIR=%~2 SHIFT /1 SHIFT /1 GOTO PARSE_LOOP ) IF /I [%1]==[/TREE] ( - SET ROCKS_TREE=%2 + SET ROCKS_TREE=%~2 SHIFT /1 SHIFT /1 GOTO PARSE_LOOP ) IF /I [%1]==[/SCRIPTS] ( - SET SCRIPTS_DIR=%2 + SET SCRIPTS_DIR=%~2 SHIFT /1 SHIFT /1 GOTO PARSE_LOOP @@ -104,25 +104,25 @@ IF /I [%1]==[/MW] ( GOTO PARSE_LOOP ) IF /I [%1]==[/LUA] ( - SET LUA_PREFIX=%2 + SET LUA_PREFIX=%~2 SHIFT /1 SHIFT /1 GOTO PARSE_LOOP ) IF /I [%1]==[/LIB] ( - SET LUA_LIBDIR=%2 + SET LUA_LIBDIR=%~2 SHIFT /1 SHIFT /1 GOTO PARSE_LOOP ) IF /I [%1]==[/INC] ( - SET LUA_INCDIR=%2 + SET LUA_INCDIR=%~2 SHIFT /1 SHIFT /1 GOTO PARSE_LOOP ) IF /I [%1]==[/BIN] ( - SET LUA_BINDIR=%2 + SET LUA_BINDIR=%~2 SHIFT /1 SHIFT /1 GOTO PARSE_LOOP -- cgit v1.2.3-55-g6feb From a5bb84bbe8581c9c1d1f8ee74b510be54556ea1d Mon Sep 17 00:00:00 2001 From: Thijs Schreijer Date: Sat, 6 Apr 2013 10:12:50 +0200 Subject: fixed installer: typo in write config file --- install.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.bat b/install.bat index d79a1619..603ec5ec 100644 --- a/install.bat +++ b/install.bat @@ -401,7 +401,7 @@ IF NOT EXIST "%CONFIG_FILE%" ( ) ELSE ( ECHO MSVCRT = 'msvcr80',>> "%CONFIG_FILE%" ) - ECHO LUALIB = '%LUA_LIB_NAME%'>> "%CONFIG_FILE%" + ECHO LUALIB = '%LUA_LIBNAME%'>> "%CONFIG_FILE%" ECHO }>> "%CONFIG_FILE%" ECHO Created LuaRocks config file: %CONFIG_FILE% ) ELSE ( -- cgit v1.2.3-55-g6feb