diff options
-rw-r--r-- | GNUmakefile | 34 | ||||
-rwxr-xr-x | configure | 16 |
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 | 4 | datarootdir = $(prefix)/share |
5 | prefix ?= /usr/local | 5 | bindir = $(prefix)/bin |
6 | datarootdir ?= $(prefix)/share | 6 | sysconfdir = $(prefix)/etc |
7 | bindir ?= $(prefix)/bin | 7 | INSTALL = install |
8 | sysconfdir ?= $(prefix)/etc | 8 | INSTALL_DATA = $(INSTALL) -m 644 |
9 | INSTALL ?= install | 9 | BINARY_PLATFORM = unix |
10 | INSTALL_DATA ?= $(INSTALL) -m 644 | 10 | |
11 | BINARY_PLATFORM ?= unix | ||
12 | |||
13 | LUA_INTERPRETER ?= lua | ||
14 | ifdef LUA_BINDIR | ||
15 | LUA = $(LUA_BINDIR)/$(LUA_INTERPRETER) | ||
16 | SHEBANG = \#!$(LUA_BINDIR)/$(LUA_INTERPRETER) | 11 | SHEBANG = \#!$(LUA_BINDIR)/$(LUA_INTERPRETER) |
17 | else | 12 | LUA = $(LUA_BINDIR)/$(LUA_INTERPRETER) |
18 | LUA = $(LUA_INTERPRETER) | 13 | luarocksconfdir = $(sysconfdir)/luarocks |
19 | SHEBANG = \#!/usr/bin/env $(LUA_INTERPRETER) | 14 | luadir = $(datarootdir)/lua/$(LUA_VERSION) |
20 | endif | 15 | builddir = ./build |
21 | LUA_VERSION ?= $(shell $(LUA) -e 'print(_VERSION:match(" (5%.[1234])$$"))') | 16 | buildbinarydir = ./build-binary |
22 | rocks_tree ?= $(prefix) | ||
23 | luarocksconfdir ?= $(sysconfdir)/luarocks | ||
24 | luadir ?= $(datarootdir)/lua/$(LUA_VERSION) | ||
25 | builddir ?= ./build | ||
26 | buildbinarydir ?= ./build-binary | ||
27 | 17 | ||
28 | 18 | ||
29 | LUAROCKS_FILES = $(shell find src/luarocks/ -type f -name '*.lua') | 19 | LUAROCKS_FILES = $(shell find src/luarocks/ -type f -name '*.lua') |
@@ -4,7 +4,6 @@ | |||
4 | 4 | ||
5 | prefix="/usr/local" | 5 | prefix="/usr/local" |
6 | sysconfdir="$prefix/etc" | 6 | sysconfdir="$prefix/etc" |
7 | luarocksconfdir="$sysconfdir/luarocks" | ||
8 | rocks_tree="$prefix" | 7 | rocks_tree="$prefix" |
9 | 8 | ||
10 | # ---------------------------------------------------------------------------- | 9 | # ---------------------------------------------------------------------------- |
@@ -108,7 +107,6 @@ For better control, use the options below. | |||
108 | 107 | ||
109 | Fine tuning of the installation directories: | 108 | Fine 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 | ||
113 | Where to install files provided by rocks: | 111 | Where 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 |
343 | fi | 336 | fi |
344 | 337 | ||
345 | if [ "$sysconfdir_SET" = "yes" ] && [ ! "$luarocksconfdir_SET" = "yes" ] | ||
346 | then | ||
347 | luarocksconfdir=$sysconfdir/luarocks | ||
348 | fi | ||
349 | |||
350 | if [ "$prefix_SET" = "yes" ] && [ ! "$rocks_tree_SET" = "yes" ] | 338 | if [ "$prefix_SET" = "yes" ] && [ ! "$rocks_tree_SET" = "yes" ] |
351 | then | 339 | then |
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 | ||
490 | prefix=$prefix | 478 | prefix=$prefix |
491 | luarocksconfdir=$luarocksconfdir | 479 | sysconfdir=$sysconfdir |
492 | rocks_tree=$rocks_tree | 480 | rocks_tree=$rocks_tree |
493 | LUA_VERSION=$LUA_VERSION | 481 | LUA_VERSION=$LUA_VERSION |
494 | LUA_INTERPRETER=$LUA_INTERPRETER | 482 | LUA_INTERPRETER=$LUA_INTERPRETER |
@@ -505,7 +493,7 @@ echo | |||
505 | echo | 493 | echo |
506 | echo "LuaRocks will be installed at......: $(GREEN "$prefix")" | 494 | echo "LuaRocks will be installed at......: $(GREEN "$prefix")" |
507 | echo "LuaRocks will install rocks at.....: $(GREEN "$rocks_tree")" | 495 | echo "LuaRocks will install rocks at.....: $(GREEN "$rocks_tree")" |
508 | echo "LuaRocks configuration directory...: $(GREEN "$luarocksconfdir")" | 496 | echo "LuaRocks configuration directory...: $(GREEN "$sysconfdir/luarocks")" |
509 | echo "Using Lua from.....................: $(GREEN "$LUA_DIR")" | 497 | echo "Using Lua from.....................: $(GREEN "$LUA_DIR")" |
510 | if [ "$LUA_BINDIR_SET" = "yes" ]; then echo "Lua bin directory..................: $(GREEN "$LUA_BINDIR")" ; fi | 498 | if [ "$LUA_BINDIR_SET" = "yes" ]; then echo "Lua bin directory..................: $(GREEN "$LUA_BINDIR")" ; fi |
511 | if [ "$LUA_INCDIR_SET" = "yes" ]; then echo "Lua include directory..............: $(GREEN "$LUA_INCDIR")" ; fi | 499 | if [ "$LUA_INCDIR_SET" = "yes" ]; then echo "Lua include directory..............: $(GREEN "$LUA_INCDIR")" ; fi |