aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--GNUmakefile34
-rwxr-xr-xconfigure16
2 files changed, 14 insertions, 36 deletions
diff --git a/GNUmakefile b/GNUmakefile
index 90ceaf87..a2a13e04 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -1,29 +1,19 @@
1 1
2-include config.unix 2-include config.unix
3 3
4# See https://www.gnu.org/software/make/manual/html_node/Makefile-Conventions.html 4datarootdir = $(prefix)/share
5prefix ?= /usr/local 5bindir = $(prefix)/bin
6datarootdir ?= $(prefix)/share 6sysconfdir = $(prefix)/etc
7bindir ?= $(prefix)/bin 7INSTALL = install
8sysconfdir ?= $(prefix)/etc 8INSTALL_DATA = $(INSTALL) -m 644
9INSTALL ?= install 9BINARY_PLATFORM = unix
10INSTALL_DATA ?= $(INSTALL) -m 644 10
11BINARY_PLATFORM ?= unix
12
13LUA_INTERPRETER ?= lua
14ifdef LUA_BINDIR
15LUA = $(LUA_BINDIR)/$(LUA_INTERPRETER)
16SHEBANG = \#!$(LUA_BINDIR)/$(LUA_INTERPRETER) 11SHEBANG = \#!$(LUA_BINDIR)/$(LUA_INTERPRETER)
17else 12LUA = $(LUA_BINDIR)/$(LUA_INTERPRETER)
18LUA = $(LUA_INTERPRETER) 13luarocksconfdir = $(sysconfdir)/luarocks
19SHEBANG = \#!/usr/bin/env $(LUA_INTERPRETER) 14luadir = $(datarootdir)/lua/$(LUA_VERSION)
20endif 15builddir = ./build
21LUA_VERSION ?= $(shell $(LUA) -e 'print(_VERSION:match(" (5%.[1234])$$"))') 16buildbinarydir = ./build-binary
22rocks_tree ?= $(prefix)
23luarocksconfdir ?= $(sysconfdir)/luarocks
24luadir ?= $(datarootdir)/lua/$(LUA_VERSION)
25builddir ?= ./build
26buildbinarydir ?= ./build-binary
27 17
28 18
29LUAROCKS_FILES = $(shell find src/luarocks/ -type f -name '*.lua') 19LUAROCKS_FILES = $(shell find src/luarocks/ -type f -name '*.lua')
diff --git a/configure b/configure
index 9e096ae9..14d699dc 100755
--- a/configure
+++ b/configure
@@ -4,7 +4,6 @@
4 4
5prefix="/usr/local" 5prefix="/usr/local"
6sysconfdir="$prefix/etc" 6sysconfdir="$prefix/etc"
7luarocksconfdir="$sysconfdir/luarocks"
8rocks_tree="$prefix" 7rocks_tree="$prefix"
9 8
10# ---------------------------------------------------------------------------- 9# ----------------------------------------------------------------------------
@@ -108,7 +107,6 @@ For better control, use the options below.
108 107
109Fine tuning of the installation directories: 108Fine tuning of the installation directories:
110 --sysconfdir=SYSCONFDIR Directory for single-machine config [PREFIX/etc] 109 --sysconfdir=SYSCONFDIR Directory for single-machine config [PREFIX/etc]
111 --luarocksconfdir=DIR Directory for luarocks config [SYSCONFDIR/luarocks]
112 110
113Where to install files provided by rocks: 111Where to install files provided by rocks:
114 --rocks-tree=DIR Root of the local tree of installed rocks. 112 --rocks-tree=DIR Root of the local tree of installed rocks.
@@ -241,11 +239,6 @@ do
241 sysconfdir="$(canonicalpath "$value")" 239 sysconfdir="$(canonicalpath "$value")"
242 sysconfdir_SET=yes 240 sysconfdir_SET=yes
243 ;; 241 ;;
244 --luarocksconfdir)
245 [ -n "$value" ] || die "Missing value in flag $key."
246 luarocksconfdir="$(canonicalpath "$value")"
247 luarocksconfdir_SET=yes
248 ;;
249 242
250 243
251 # Where to install files provided by rocks: 244 # Where to install files provided by rocks:
@@ -342,11 +335,6 @@ then
342 sysconfdir_SET=yes 335 sysconfdir_SET=yes
343fi 336fi
344 337
345if [ "$sysconfdir_SET" = "yes" ] && [ ! "$luarocksconfdir_SET" = "yes" ]
346then
347 luarocksconfdir=$sysconfdir/luarocks
348fi
349
350if [ "$prefix_SET" = "yes" ] && [ ! "$rocks_tree_SET" = "yes" ] 338if [ "$prefix_SET" = "yes" ] && [ ! "$rocks_tree_SET" = "yes" ]
351then 339then
352 rocks_tree=$prefix 340 rocks_tree=$prefix
@@ -488,7 +476,7 @@ cat <<EOF > config.unix
488# Run "./configure --help" for details. 476# Run "./configure --help" for details.
489 477
490prefix=$prefix 478prefix=$prefix
491luarocksconfdir=$luarocksconfdir 479sysconfdir=$sysconfdir
492rocks_tree=$rocks_tree 480rocks_tree=$rocks_tree
493LUA_VERSION=$LUA_VERSION 481LUA_VERSION=$LUA_VERSION
494LUA_INTERPRETER=$LUA_INTERPRETER 482LUA_INTERPRETER=$LUA_INTERPRETER
@@ -505,7 +493,7 @@ echo
505echo 493echo
506echo "LuaRocks will be installed at......: $(GREEN "$prefix")" 494echo "LuaRocks will be installed at......: $(GREEN "$prefix")"
507echo "LuaRocks will install rocks at.....: $(GREEN "$rocks_tree")" 495echo "LuaRocks will install rocks at.....: $(GREEN "$rocks_tree")"
508echo "LuaRocks configuration directory...: $(GREEN "$luarocksconfdir")" 496echo "LuaRocks configuration directory...: $(GREEN "$sysconfdir/luarocks")"
509echo "Using Lua from.....................: $(GREEN "$LUA_DIR")" 497echo "Using Lua from.....................: $(GREEN "$LUA_DIR")"
510if [ "$LUA_BINDIR_SET" = "yes" ]; then echo "Lua bin directory..................: $(GREEN "$LUA_BINDIR")" ; fi 498if [ "$LUA_BINDIR_SET" = "yes" ]; then echo "Lua bin directory..................: $(GREEN "$LUA_BINDIR")" ; fi
511if [ "$LUA_INCDIR_SET" = "yes" ]; then echo "Lua include directory..............: $(GREEN "$LUA_INCDIR")" ; fi 499if [ "$LUA_INCDIR_SET" = "yes" ]; then echo "Lua include directory..............: $(GREEN "$LUA_INCDIR")" ; fi