aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile35
-rw-r--r--install.bat29
2 files changed, 33 insertions, 31 deletions
diff --git a/Makefile b/Makefile
index a1b87b20..244563b7 100644
--- a/Makefile
+++ b/Makefile
@@ -44,56 +44,57 @@ build: src/luarocks/site_config.lua build_bins
44 44
45src/luarocks/site_config.lua: config.unix 45src/luarocks/site_config.lua: config.unix
46 rm -f src/luarocks/site_config.lua 46 rm -f src/luarocks/site_config.lua
47 echo 'module("luarocks.site_config")' >> src/luarocks/site_config.lua 47 echo 'local site_config = {}' >> src/luarocks/site_config.lua
48 if [ -n "$(PREFIX)" ] ;\ 48 if [ -n "$(PREFIX)" ] ;\
49 then \ 49 then \
50 echo "LUAROCKS_PREFIX=[[$(PREFIX)]]" >> src/luarocks/site_config.lua ;\ 50 echo "site_config.LUAROCKS_PREFIX=[[$(PREFIX)]]" >> src/luarocks/site_config.lua ;\
51 fi 51 fi
52 if [ -n "$(LUA_INCDIR)" ] ;\ 52 if [ -n "$(LUA_INCDIR)" ] ;\
53 then \ 53 then \
54 echo "LUA_INCDIR=[[$(LUA_INCDIR)]]" >> src/luarocks/site_config.lua ;\ 54 echo "site_config.LUA_INCDIR=[[$(LUA_INCDIR)]]" >> src/luarocks/site_config.lua ;\
55 fi 55 fi
56 if [ -n "$(LUA_LIBDIR)" ] ;\ 56 if [ -n "$(LUA_LIBDIR)" ] ;\
57 then \ 57 then \
58 echo "LUA_LIBDIR=[[$(LUA_LIBDIR)]]" >> src/luarocks/site_config.lua ;\ 58 echo "site_config.LUA_LIBDIR=[[$(LUA_LIBDIR)]]" >> src/luarocks/site_config.lua ;\
59 fi 59 fi
60 if [ -n "$(LUA_BINDIR)" ] ;\ 60 if [ -n "$(LUA_BINDIR)" ] ;\
61 then \ 61 then \
62 echo "LUA_BINDIR=[[$(LUA_BINDIR)]]" >> src/luarocks/site_config.lua ;\ 62 echo "site_config.LUA_BINDIR=[[$(LUA_BINDIR)]]" >> src/luarocks/site_config.lua ;\
63 fi 63 fi
64 if [ -n "$(LUA_SUFFIX)" ] ;\ 64 if [ -n "$(LUA_SUFFIX)" ] ;\
65 then \ 65 then \
66 echo "LUA_INTERPRETER=[[lua$(LUA_SUFFIX)]]" >> src/luarocks/site_config.lua ;\ 66 echo "site_config.LUA_INTERPRETER=[[lua$(LUA_SUFFIX)]]" >> src/luarocks/site_config.lua ;\
67 fi 67 fi
68 if [ -n "$(SYSCONFDIR)" ] ;\ 68 if [ -n "$(SYSCONFDIR)" ] ;\
69 then \ 69 then \
70 echo "LUAROCKS_SYSCONFDIR=[[$(SYSCONFDIR)]]" >> src/luarocks/site_config.lua ;\ 70 echo "site_config.LUAROCKS_SYSCONFDIR=[[$(SYSCONFDIR)]]" >> src/luarocks/site_config.lua ;\
71 fi 71 fi
72 if [ -n "$(ROCKS_TREE)" ] ;\ 72 if [ -n "$(ROCKS_TREE)" ] ;\
73 then \ 73 then \
74 echo "LUAROCKS_ROCKS_TREE=[[$(ROCKS_TREE)]]" >> src/luarocks/site_config.lua ;\ 74 echo "site_config.LUAROCKS_ROCKS_TREE=[[$(ROCKS_TREE)]]" >> src/luarocks/site_config.lua ;\
75 fi 75 fi
76 if [ -n "$(FORCE_CONFIG)" ] ;\ 76 if [ -n "$(FORCE_CONFIG)" ] ;\
77 then \ 77 then \
78 echo "LUAROCKS_FORCE_CONFIG=true" >> src/luarocks/site_config.lua ;\ 78 echo "site_config.LUAROCKS_FORCE_CONFIG=true" >> src/luarocks/site_config.lua ;\
79 fi 79 fi
80 if [ -n "$(LUAROCKS_ROCKS_SUBDIR)" ] ;\ 80 if [ -n "$(LUAROCKS_ROCKS_SUBDIR)" ] ;\
81 then \ 81 then \
82 echo "LUAROCKS_ROCKS_SUBDIR=[[$(LUAROCKS_ROCKS_SUBDIR)]]" >> src/luarocks/site_config.lua ;\ 82 echo "site_config.LUAROCKS_ROCKS_SUBDIR=[[$(LUAROCKS_ROCKS_SUBDIR)]]" >> src/luarocks/site_config.lua ;\
83 fi 83 fi
84 if [ "$(LUA_DIR_SET)" = "yes" ] ;\ 84 if [ "$(LUA_DIR_SET)" = "yes" ] ;\
85 then \ 85 then \
86 echo "LUA_DIR_SET=true" >> src/luarocks/site_config.lua ;\ 86 echo "site_config.LUA_DIR_SET=true" >> src/luarocks/site_config.lua ;\
87 fi 87 fi
88 echo "LUAROCKS_UNAME_S=[[$(LUAROCKS_UNAME_S)]]" >> src/luarocks/site_config.lua 88 echo "site_config.LUAROCKS_UNAME_S=[[$(LUAROCKS_UNAME_S)]]" >> src/luarocks/site_config.lua
89 echo "LUAROCKS_UNAME_M=[[$(LUAROCKS_UNAME_M)]]" >> src/luarocks/site_config.lua 89 echo "site_config.LUAROCKS_UNAME_M=[[$(LUAROCKS_UNAME_M)]]" >> src/luarocks/site_config.lua
90 echo "LUAROCKS_DOWNLOADER=[[$(LUAROCKS_DOWNLOADER)]]" >> src/luarocks/site_config.lua 90 echo "site_config.LUAROCKS_DOWNLOADER=[[$(LUAROCKS_DOWNLOADER)]]" >> src/luarocks/site_config.lua
91 echo "LUAROCKS_MD5CHECKER=[[$(LUAROCKS_MD5CHECKER)]]" >> src/luarocks/site_config.lua 91 echo "site_config.LUAROCKS_MD5CHECKER=[[$(LUAROCKS_MD5CHECKER)]]" >> src/luarocks/site_config.lua
92 if [ -n "$(MULTIARCH_SUBDIR)" ] ;\ 92 if [ -n "$(MULTIARCH_SUBDIR)" ] ;\
93 then \ 93 then \
94 echo 'LUAROCKS_EXTERNAL_DEPS_SUBDIRS={ bin="bin", lib={ "lib", [[$(MULTIARCH_SUBDIR)]] }, include="include" }' >> src/luarocks/site_config.lua ;\ 94 echo 'site_config.LUAROCKS_EXTERNAL_DEPS_SUBDIRS={ bin="bin", lib={ "lib", [[$(MULTIARCH_SUBDIR)]] }, include="include" }' >> src/luarocks/site_config.lua ;\
95 echo 'LUAROCKS_RUNTIME_EXTERNAL_DEPS_SUBDIRS={ bin="bin", lib={ "lib", [[$(MULTIARCH_SUBDIR)]] }, include="include" }' >> src/luarocks/site_config.lua ;\ 95 echo 'site_config.LUAROCKS_RUNTIME_EXTERNAL_DEPS_SUBDIRS={ bin="bin", lib={ "lib", [[$(MULTIARCH_SUBDIR)]] }, include="include" }' >> src/luarocks/site_config.lua ;\
96 fi 96 fi
97 echo "return site_config" >> src/luarocks/site_config.lua
97 98
98dev: 99dev:
99 $(MAKE) build_bins LUADIR=$(PWD)/src 100 $(MAKE) build_bins LUADIR=$(PWD)/src
diff --git a/install.bat b/install.bat
index 934154d0..287bad5b 100644
--- a/install.bat
+++ b/install.bat
@@ -771,27 +771,27 @@ if exists(S[[$LUADIR\luarocks\site_config.lua]]) then
771end 771end
772local f = io.open(vars.LUADIR.."\\luarocks\\site_config.lua", "w") 772local f = io.open(vars.LUADIR.."\\luarocks\\site_config.lua", "w")
773f:write(S[=[ 773f:write(S[=[
774module("luarocks.site_config") 774local site_config = {}
775LUA_INCDIR=[[$LUA_INCDIR]] 775site_config.LUA_INCDIR=[[$LUA_INCDIR]]
776LUA_LIBDIR=[[$LUA_LIBDIR]] 776site_config.LUA_LIBDIR=[[$LUA_LIBDIR]]
777LUA_BINDIR=[[$LUA_BINDIR]] 777site_config.LUA_BINDIR=[[$LUA_BINDIR]]
778LUA_INTERPRETER=[[$LUA_INTERPRETER]] 778site_config.LUA_INTERPRETER=[[$LUA_INTERPRETER]]
779]=]) 779]=])
780if USE_MINGW then 780if USE_MINGW then
781 f:write("LUAROCKS_UNAME_S=[[MINGW]]\n") 781 f:write("site_config.LUAROCKS_UNAME_S=[[MINGW]]\n")
782else 782else
783 f:write("LUAROCKS_UNAME_S=[[WindowsNT]]\n") 783 f:write("site_config.LUAROCKS_UNAME_S=[[WindowsNT]]\n")
784end 784end
785f:write(S[=[ 785f:write(S[=[
786LUAROCKS_UNAME_M=[[$UNAME_M]] 786site_config.LUAROCKS_UNAME_M=[[$UNAME_M]]
787LUAROCKS_SYSCONFIG=[[$SYSCONFDIR\config.lua]] 787site_config.LUAROCKS_SYSCONFIG=[[$SYSCONFDIR\config.lua]]
788LUAROCKS_ROCKS_TREE=[[$ROCKS_TREE]] 788site_config.LUAROCKS_ROCKS_TREE=[[$ROCKS_TREE]]
789LUAROCKS_PREFIX=[[$PREFIX]] 789site_config.LUAROCKS_PREFIX=[[$PREFIX]]
790LUAROCKS_DOWNLOADER=[[wget]] 790site_config.LUAROCKS_DOWNLOADER=[[wget]]
791LUAROCKS_MD5CHECKER=[[md5sum]] 791site_config.LUAROCKS_MD5CHECKER=[[md5sum]]
792]=]) 792]=])
793if FORCE_CONFIG then 793if FORCE_CONFIG then
794 f:write("local LUAROCKS_FORCE_CONFIG=true\n") 794 f:write("site_config.LUAROCKS_FORCE_CONFIG=true\n")
795end 795end
796if exists(vars.LUADIR.."\\luarocks\\site_config.lua.bak") then 796if exists(vars.LUADIR.."\\luarocks\\site_config.lua.bak") then
797 for line in io.lines(vars.LUADIR.."\\luarocks\\site_config.lua.bak", "r") do 797 for line in io.lines(vars.LUADIR.."\\luarocks\\site_config.lua.bak", "r") do
@@ -800,6 +800,7 @@ if exists(vars.LUADIR.."\\luarocks\\site_config.lua.bak") then
800 end 800 end
801 exec(S[[DEL /F /Q "$LUADIR\luarocks\site_config.lua.bak"]]) 801 exec(S[[DEL /F /Q "$LUADIR\luarocks\site_config.lua.bak"]])
802end 802end
803f:write("return site_config\n")
803f:close() 804f:close()
804print(S[[Created LuaRocks site-config file: $LUADIR\luarocks\site_config.lua]]) 805print(S[[Created LuaRocks site-config file: $LUADIR\luarocks\site_config.lua]])
805 806