diff options
| author | Hisham Muhammad <hisham@gobolinux.org> | 2013-04-12 23:05:43 -0300 |
|---|---|---|
| committer | Hisham Muhammad <hisham@gobolinux.org> | 2013-04-12 23:05:43 -0300 |
| commit | 130f460fca140b2873d284d0057b326b64621d1d (patch) | |
| tree | 825a90c51e9fd9b15f98d1c7e9a38eca439862c5 /configure | |
| parent | 26db61478504c7b13099b942aeebbdd6ffa4472b (diff) | |
| download | luarocks-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-x | configure | 47 |
1 files changed, 34 insertions, 13 deletions
| @@ -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 |
| 278 | fi | 284 | fi |
| 279 | 285 | ||
| 280 | if [ "$LUA_VERSION" = "5.2" ] | ||
| 281 | then | ||
| 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 "******************************" | ||
| 290 | fi | ||
| 291 | |||
| 292 | if [ "$LUA_DIR_SET" != "yes" ] | 286 | if [ "$LUA_DIR_SET" != "yes" ] |
| 293 | then | 287 | then |
| 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." |
| 377 | fi | 371 | fi |
| 378 | 372 | ||
| 373 | if [ "$LUA_VERSION" = "5.2" ] | ||
| 374 | then | ||
| 375 | LUA_OTHER_VERSION=5.1 | ||
| 376 | else | ||
| 377 | LUA_OTHER_VERSION=5.2 | ||
| 378 | fi | ||
| 379 | |||
| 380 | LUAROCKS_ROCKS_SUBDIR=/lib/luarocks/rocks | ||
| 381 | if [ "$VERSIONED_ROCKS_DIR" = "yes" ] | ||
| 382 | then | ||
| 383 | LUAROCKS_ROCKS_SUBDIR=$LUAROCKS_ROCKS_SUBDIR-$LUA_VERSION | ||
| 384 | echo "Using versioned rocks dir: $PREFIX$LUAROCKS_ROCKS_SUBDIR" | ||
| 385 | elif [ -e "$PREFIX/share/lua/$LUA_VERSION/luarocks/site_config.lua" ] | ||
| 386 | then | ||
| 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" | ||
| 390 | elif [ -e "$PREFIX/share/lua/$LUA_OTHER_VERSION/luarocks/site_config.lua" ] | ||
| 391 | then | ||
| 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" | ||
| 395 | else | ||
| 396 | echo "Using unversioned rocks dir: $PREFIX$LUAROCKS_ROCKS_SUBDIR" | ||
| 397 | fi | ||
| 398 | |||
| 379 | if [ -f config.unix ]; then | 399 | if [ -f config.unix ]; then |
| 380 | rm -f config.unix | 400 | rm -f config.unix |
| 381 | fi | 401 | fi |
| @@ -405,6 +425,7 @@ LUAROCKS_UNAME_M=$LUAROCKS_UNAME_M | |||
| 405 | LUAROCKS_UNAME_S=$LUAROCKS_UNAME_S | 425 | LUAROCKS_UNAME_S=$LUAROCKS_UNAME_S |
| 406 | LUAROCKS_DOWNLOADER=$LUAROCKS_DOWNLOADER | 426 | LUAROCKS_DOWNLOADER=$LUAROCKS_DOWNLOADER |
| 407 | LUAROCKS_MD5CHECKER=$LUAROCKS_MD5CHECKER | 427 | LUAROCKS_MD5CHECKER=$LUAROCKS_MD5CHECKER |
| 428 | LUAROCKS_ROCKS_SUBDIR=$LUAROCKS_ROCKS_SUBDIR | ||
| 408 | 429 | ||
| 409 | EOF | 430 | EOF |
| 410 | 431 | ||
