diff options
-rw-r--r-- | Makefile | 35 | ||||
-rw-r--r-- | install.bat | 29 |
2 files changed, 33 insertions, 31 deletions
@@ -44,56 +44,57 @@ build: src/luarocks/site_config.lua build_bins | |||
44 | 44 | ||
45 | src/luarocks/site_config.lua: config.unix | 45 | src/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 | ||
98 | dev: | 99 | dev: |
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 | |||
771 | end | 771 | end |
772 | local f = io.open(vars.LUADIR.."\\luarocks\\site_config.lua", "w") | 772 | local f = io.open(vars.LUADIR.."\\luarocks\\site_config.lua", "w") |
773 | f:write(S[=[ | 773 | f:write(S[=[ |
774 | module("luarocks.site_config") | 774 | local site_config = {} |
775 | LUA_INCDIR=[[$LUA_INCDIR]] | 775 | site_config.LUA_INCDIR=[[$LUA_INCDIR]] |
776 | LUA_LIBDIR=[[$LUA_LIBDIR]] | 776 | site_config.LUA_LIBDIR=[[$LUA_LIBDIR]] |
777 | LUA_BINDIR=[[$LUA_BINDIR]] | 777 | site_config.LUA_BINDIR=[[$LUA_BINDIR]] |
778 | LUA_INTERPRETER=[[$LUA_INTERPRETER]] | 778 | site_config.LUA_INTERPRETER=[[$LUA_INTERPRETER]] |
779 | ]=]) | 779 | ]=]) |
780 | if USE_MINGW then | 780 | if USE_MINGW then |
781 | f:write("LUAROCKS_UNAME_S=[[MINGW]]\n") | 781 | f:write("site_config.LUAROCKS_UNAME_S=[[MINGW]]\n") |
782 | else | 782 | else |
783 | f:write("LUAROCKS_UNAME_S=[[WindowsNT]]\n") | 783 | f:write("site_config.LUAROCKS_UNAME_S=[[WindowsNT]]\n") |
784 | end | 784 | end |
785 | f:write(S[=[ | 785 | f:write(S[=[ |
786 | LUAROCKS_UNAME_M=[[$UNAME_M]] | 786 | site_config.LUAROCKS_UNAME_M=[[$UNAME_M]] |
787 | LUAROCKS_SYSCONFIG=[[$SYSCONFDIR\config.lua]] | 787 | site_config.LUAROCKS_SYSCONFIG=[[$SYSCONFDIR\config.lua]] |
788 | LUAROCKS_ROCKS_TREE=[[$ROCKS_TREE]] | 788 | site_config.LUAROCKS_ROCKS_TREE=[[$ROCKS_TREE]] |
789 | LUAROCKS_PREFIX=[[$PREFIX]] | 789 | site_config.LUAROCKS_PREFIX=[[$PREFIX]] |
790 | LUAROCKS_DOWNLOADER=[[wget]] | 790 | site_config.LUAROCKS_DOWNLOADER=[[wget]] |
791 | LUAROCKS_MD5CHECKER=[[md5sum]] | 791 | site_config.LUAROCKS_MD5CHECKER=[[md5sum]] |
792 | ]=]) | 792 | ]=]) |
793 | if FORCE_CONFIG then | 793 | if FORCE_CONFIG then |
794 | f:write("local LUAROCKS_FORCE_CONFIG=true\n") | 794 | f:write("site_config.LUAROCKS_FORCE_CONFIG=true\n") |
795 | end | 795 | end |
796 | if exists(vars.LUADIR.."\\luarocks\\site_config.lua.bak") then | 796 | if 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"]]) |
802 | end | 802 | end |
803 | f:write("return site_config\n") | ||
803 | f:close() | 804 | f:close() |
804 | print(S[[Created LuaRocks site-config file: $LUADIR\luarocks\site_config.lua]]) | 805 | print(S[[Created LuaRocks site-config file: $LUADIR\luarocks\site_config.lua]]) |
805 | 806 | ||