summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2013-04-12 23:05:43 -0300
committerHisham Muhammad <hisham@gobolinux.org>2013-04-12 23:05:43 -0300
commit130f460fca140b2873d284d0057b326b64621d1d (patch)
tree825a90c51e9fd9b15f98d1c7e9a38eca439862c5 /configure
parent26db61478504c7b13099b942aeebbdd6ffa4472b (diff)
downloadluarocks-130f460fca140b2873d284d0057b326b64621d1d.tar.gz
luarocks-130f460fca140b2873d284d0057b326b64621d1d.tar.bz2
luarocks-130f460fca140b2873d284d0057b326b64621d1d.zip
General improvements for Lua 5.1 and 5.2 coexistance:
* Add --versioned-rocks-dir option to Unix installer, which makes it use paths such as /lib/luarocks/rocks-5.X, and /etc/luarocks/config-5.X.lua (where X is 1 or 2). * Make configure script on Unix autodetect the presence of previous LuaRocks installations and adapt accordingly to avoid conflicts. * Support luarocks.site_config_5_X for users who wish to run two versions from the same source tree (may be useful for LR development). * Try to load config-5.X.lua from home directory before trying config.lua.
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure47
1 files changed, 34 insertions, 13 deletions
diff --git a/configure b/configure
index 2e98a9e5..42ecf03b 100755
--- a/configure
+++ b/configure
@@ -38,7 +38,7 @@ system's package manager.
38--rocks-tree=FILE Root of the local tree of installed rocks. 38--rocks-tree=FILE Root of the local tree of installed rocks.
39 Default is \$PREFIX 39 Default is \$PREFIX
40 40
41--lua-version=VERSION Use specific Lua version: 5.1 or 5.2 (EXPERIMENTAL) 41--lua-version=VERSION Use specific Lua version: 5.1 or 5.2
42 Default is "$LUA_VERSION" 42 Default is "$LUA_VERSION"
43--lua-suffix=SUFFIX Versioning suffix to use in Lua filenames. 43--lua-suffix=SUFFIX Versioning suffix to use in Lua filenames.
44 Default is "$LUA_SUFFIX" (lua$LUA_SUFFIX...) 44 Default is "$LUA_SUFFIX" (lua$LUA_SUFFIX...)
@@ -54,6 +54,9 @@ system's package manager.
54--with-md5-checker=TOOL Which tool to use as a downloader. 54--with-md5-checker=TOOL Which tool to use as a downloader.
55 Valid options are: md5sum, openssl 55 Valid options are: md5sum, openssl
56 Default is to auto-detect. 56 Default is to auto-detect.
57--versioned-rocks-dir Use a versioned rocks dir, such as
58 \$PREFIX/lib/luarocks/rocks-$LUA_VERSION/.
59 Default is to auto-detect the necessity.
57--force-config Use a single config location. Do not use the 60--force-config Use a single config location. Do not use the
58 \$LUAROCKS_CONFIG variable or the user's home 61 \$LUAROCKS_CONFIG variable or the user's home
59 directory. Useful to avoid conflicts when LuaRocks 62 directory. Useful to avoid conflicts when LuaRocks
@@ -162,6 +165,9 @@ do
162 --force-config) 165 --force-config)
163 FORCE_CONFIG=yes 166 FORCE_CONFIG=yes
164 ;; 167 ;;
168 --versioned-rocks-dir)
169 VERSIONED_ROCKS_DIR=yes
170 ;;
165 --lua-suffix) 171 --lua-suffix)
166 [ -n "$value" ] || die "Missing value in flag $key." 172 [ -n "$value" ] || die "Missing value in flag $key."
167 LUA_SUFFIX="$value" 173 LUA_SUFFIX="$value"
@@ -277,18 +283,6 @@ then
277 done 283 done
278fi 284fi
279 285
280if [ "$LUA_VERSION" = "5.2" ]
281then
282 echo "******************************"
283 echo "WARNING: Lua 5.2 support is still experimental."
284 echo "Bug reports, patches and pull requests are welcome"
285 echo "at the GitHub project:"
286 echo "http://github.com/keplerproject/luarocks"
287 echo "and the mailing list:"
288 echo "https://lists.sourceforge.net/lists/listinfo/luarocks-developers"
289 echo "******************************"
290fi
291
292if [ "$LUA_DIR_SET" != "yes" ] 286if [ "$LUA_DIR_SET" != "yes" ]
293then 287then
294 echo_n "Looking for Lua... " 288 echo_n "Looking for Lua... "
@@ -376,6 +370,32 @@ else
376 die "Could not determine processor architecture. 'uname -m' failed." 370 die "Could not determine processor architecture. 'uname -m' failed."
377fi 371fi
378 372
373if [ "$LUA_VERSION" = "5.2" ]
374then
375 LUA_OTHER_VERSION=5.1
376else
377 LUA_OTHER_VERSION=5.2
378fi
379
380LUAROCKS_ROCKS_SUBDIR=/lib/luarocks/rocks
381if [ "$VERSIONED_ROCKS_DIR" = "yes" ]
382then
383 LUAROCKS_ROCKS_SUBDIR=$LUAROCKS_ROCKS_SUBDIR-$LUA_VERSION
384 echo "Using versioned rocks dir: $PREFIX$LUAROCKS_ROCKS_SUBDIR"
385elif [ -e "$PREFIX/share/lua/$LUA_VERSION/luarocks/site_config.lua" ]
386then
387 echo "Existing installation detected."
388 LUAROCKS_ROCKS_SUBDIR=`grep "LUAROCKS_ROCKS_SUBDIR" "$PREFIX/lib/lua/$LUA_VERSION/luarocks/site_config.lua" | sed 's,.*=\[\[(.*)\]\],\1,'`
389 echo "Using previously configured rocks dir: $LUAROCKS_ROCKS_DIR"
390elif [ -e "$PREFIX/share/lua/$LUA_OTHER_VERSION/luarocks/site_config.lua" ]
391then
392 echo "Existing installation detected for other Lua version ($LUA_OTHER_VERSION)."
393 LUAROCKS_ROCKS_SUBDIR=$LUAROCKS_ROCKS_SUBDIR-$LUA_VERSION
394 echo "Using versioned rocks dir: $PREFIX$LUAROCKS_ROCKS_SUBDIR"
395else
396 echo "Using unversioned rocks dir: $PREFIX$LUAROCKS_ROCKS_SUBDIR"
397fi
398
379if [ -f config.unix ]; then 399if [ -f config.unix ]; then
380 rm -f config.unix 400 rm -f config.unix
381fi 401fi
@@ -405,6 +425,7 @@ LUAROCKS_UNAME_M=$LUAROCKS_UNAME_M
405LUAROCKS_UNAME_S=$LUAROCKS_UNAME_S 425LUAROCKS_UNAME_S=$LUAROCKS_UNAME_S
406LUAROCKS_DOWNLOADER=$LUAROCKS_DOWNLOADER 426LUAROCKS_DOWNLOADER=$LUAROCKS_DOWNLOADER
407LUAROCKS_MD5CHECKER=$LUAROCKS_MD5CHECKER 427LUAROCKS_MD5CHECKER=$LUAROCKS_MD5CHECKER
428LUAROCKS_ROCKS_SUBDIR=$LUAROCKS_ROCKS_SUBDIR
408 429
409EOF 430EOF
410 431