aboutsummaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure61
1 files changed, 38 insertions, 23 deletions
diff --git a/configure b/configure
index d92a3915..8b6d0d24 100755
--- a/configure
+++ b/configure
@@ -2,9 +2,10 @@
2 2
3# Defaults 3# Defaults
4 4
5PREFIX="/usr/local" 5prefix="/usr/local"
6SYSCONFDIR="$PREFIX/etc/luarocks" 6sysconfdir="$prefix/etc"
7ROCKS_TREE="$PREFIX" 7luarocksconfdir="$sysconfdir/luarocks"
8ROCKS_TREE="$prefix"
8 9
9# ---------------------------------------------------------------------------- 10# ----------------------------------------------------------------------------
10# FUNCTION DEFINITIONS 11# FUNCTION DEFINITIONS
@@ -94,10 +95,13 @@ Where to install LuaRocks:
94-------------------------- 95--------------------------
95 96
96--prefix=PREFIX Directory where LuaRocks should be installed. 97--prefix=PREFIX Directory where LuaRocks should be installed.
97 - Default is $PREFIX 98 - Default is $prefix
98--sysconfdir=SYSCONFDIR Where the config file should be installed. 99--sysconfdir=SYSCONFDIR Where system config files should be installed.
99 - Default is $SYSCONFDIR 100 - Default is $sysconfdir
100 (PREFIX/etc/luarocks) 101 (PREFIX/etc)
102--luarocksconfdir=DIR Where the luarocks config file should be installed.
103 - Default is $luarocksconfdir
104 (SYSCONFDIR/luarocks)
101 105
102Where to install files provided by rocks: 106Where to install files provided by rocks:
103----------------------------------------- 107-----------------------------------------
@@ -108,7 +112,7 @@ Where to install files provided by rocks:
108 "luarocks path --help" after installation. 112 "luarocks path --help" after installation.
109 Avoid using paths controlled by your 113 Avoid using paths controlled by your
110 system's package manager, such as /usr. 114 system's package manager, such as /usr.
111 - Default is $PREFIX 115 - Default is $prefix
112 (PREFIX) 116 (PREFIX)
113 117
114Where is your Lua interpreter: 118Where is your Lua interpreter:
@@ -234,13 +238,18 @@ do
234 # -------------------------- 238 # --------------------------
235 --prefix) 239 --prefix)
236 [ -n "$value" ] || die "Missing value in flag $key." 240 [ -n "$value" ] || die "Missing value in flag $key."
237 PREFIX="$(canonicalpath "$value")" 241 prefix="$(canonicalpath "$value")"
238 PREFIX_SET=yes 242 prefix_SET=yes
239 ;; 243 ;;
240 --sysconfdir) 244 --sysconfdir)
241 [ -n "$value" ] || die "Missing value in flag $key." 245 [ -n "$value" ] || die "Missing value in flag $key."
242 SYSCONFDIR="$(canonicalpath "$value")" 246 sysconfdir="$(canonicalpath "$value")"
243 SYSCONFDIR_SET=yes 247 sysconfdir_SET=yes
248 ;;
249 --luarocksconfdir)
250 [ -n "$value" ] || die "Missing value in flag $key."
251 luarocksconfdir="$(canonicalpath "$value")"
252 luarocksconfdir_SET=yes
244 ;; 253 ;;
245 254
246 255
@@ -329,17 +338,23 @@ echo
329# Derive options from the ones given 338# Derive options from the ones given
330# ---------------------------------------- 339# ----------------------------------------
331 340
332if [ "$PREFIX_SET" = "yes" ] && [ ! "$SYSCONFDIR_SET" = "yes" ] 341if [ "$prefix_SET" = "yes" ] && [ ! "$sysconfdir_SET" = "yes" ]
333then 342then
334 if [ "$PREFIX" = "/usr" ] 343 if [ "$prefix" = "/usr" ]
335 then SYSCONFDIR=/etc/luarocks 344 then sysconfdir=/etc
336 else SYSCONFDIR=$PREFIX/etc/luarocks 345 else sysconfdir=$prefix/etc
337 fi 346 fi
347 sysconfdir_SET=yes
348fi
349
350if [ "$sysconfdir_SET" = "yes" ] && [ ! "$luarocksconfdir_SET" = "yes" ]
351then
352 luarocksconfdir=$sysconfdir/luarocks
338fi 353fi
339 354
340if [ "$PREFIX_SET" = "yes" ] && [ ! "$ROCKS_TREE_SET" = "yes" ] 355if [ "$prefix_SET" = "yes" ] && [ ! "$ROCKS_TREE_SET" = "yes" ]
341then 356then
342 ROCKS_TREE=$PREFIX 357 ROCKS_TREE=$prefix
343fi 358fi
344 359
345# ---------------------------------------- 360# ----------------------------------------
@@ -477,8 +492,8 @@ cat <<EOF > config.unix
477# This file was automatically generated by the configure script. 492# This file was automatically generated by the configure script.
478# Run "./configure --help" for details. 493# Run "./configure --help" for details.
479 494
480PREFIX=$PREFIX 495prefix=$prefix
481SYSCONFDIR=$SYSCONFDIR 496luarocksconfdir=$luarocksconfdir
482ROCKS_TREE=$ROCKS_TREE 497ROCKS_TREE=$ROCKS_TREE
483LUA_VERSION=$LUA_VERSION 498LUA_VERSION=$LUA_VERSION
484LUA_INTERPRETER=$LUA_INTERPRETER 499LUA_INTERPRETER=$LUA_INTERPRETER
@@ -509,16 +524,16 @@ echo
509BLUE "Done configuring." 524BLUE "Done configuring."
510echo 525echo
511echo 526echo
512echo "LuaRocks will be installed at......: $(GREEN "$PREFIX")" 527echo "LuaRocks will be installed at......: $(GREEN "$prefix")"
513echo "LuaRocks will install rocks at.....: $(GREEN "$ROCKS_TREE")" 528echo "LuaRocks will install rocks at.....: $(GREEN "$ROCKS_TREE")"
514echo "LuaRocks configuration directory...: $(GREEN "$SYSCONFDIR")" 529echo "LuaRocks configuration directory...: $(GREEN "$luarocksconfdir")"
515echo "Using Lua from.....................: $(GREEN "$LUA_DIR")" 530echo "Using Lua from.....................: $(GREEN "$LUA_DIR")"
516if [ "$LUA_BINDIR_SET" = "yes" ]; then echo "Lua bin directory..................: $(GREEN "$LUA_BINDIR")" ; fi 531if [ "$LUA_BINDIR_SET" = "yes" ]; then echo "Lua bin directory..................: $(GREEN "$LUA_BINDIR")" ; fi
517if [ "$LUA_INCDIR_SET" = "yes" ]; then echo "Lua include directory..............: $(GREEN "$LUA_INCDIR")" ; fi 532if [ "$LUA_INCDIR_SET" = "yes" ]; then echo "Lua include directory..............: $(GREEN "$LUA_INCDIR")" ; fi
518if [ "$LUA_LIBDIR_SET" = "yes" ]; then echo "Lua lib directory..................: $(GREEN "$LUA_LIBDIR")" ; fi 533if [ "$LUA_LIBDIR_SET" = "yes" ]; then echo "Lua lib directory..................: $(GREEN "$LUA_LIBDIR")" ; fi
519echo 534echo
520echo "* Type $(BOLD make) and $(BOLD make install):" 535echo "* Type $(BOLD make) and $(BOLD make install):"
521echo " to install to $PREFIX as usual." 536echo " to install to $prefix as usual."
522echo "* Type $(BOLD make bootstrap):" 537echo "* Type $(BOLD make bootstrap):"
523echo " to install LuaRocks into $ROCKS_TREE as a rock." 538echo " to install LuaRocks into $ROCKS_TREE as a rock."
524echo 539echo