From b3869ba11a504e603eb585a632e80dbfc1830207 Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Sat, 11 Aug 2018 00:31:53 -0300 Subject: configure, make: reduce moving parts * Do not set again variables that were set in config.unix * Do not re-detect the Lua version after configure already did it * Remove --luarocksconfdir, use --sysconfdir only --- GNUmakefile | 34 ++++++++++++---------------------- 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 @@ -include config.unix -# See https://www.gnu.org/software/make/manual/html_node/Makefile-Conventions.html -prefix ?= /usr/local -datarootdir ?= $(prefix)/share -bindir ?= $(prefix)/bin -sysconfdir ?= $(prefix)/etc -INSTALL ?= install -INSTALL_DATA ?= $(INSTALL) -m 644 -BINARY_PLATFORM ?= unix - -LUA_INTERPRETER ?= lua -ifdef LUA_BINDIR -LUA = $(LUA_BINDIR)/$(LUA_INTERPRETER) +datarootdir = $(prefix)/share +bindir = $(prefix)/bin +sysconfdir = $(prefix)/etc +INSTALL = install +INSTALL_DATA = $(INSTALL) -m 644 +BINARY_PLATFORM = unix + SHEBANG = \#!$(LUA_BINDIR)/$(LUA_INTERPRETER) -else -LUA = $(LUA_INTERPRETER) -SHEBANG = \#!/usr/bin/env $(LUA_INTERPRETER) -endif -LUA_VERSION ?= $(shell $(LUA) -e 'print(_VERSION:match(" (5%.[1234])$$"))') -rocks_tree ?= $(prefix) -luarocksconfdir ?= $(sysconfdir)/luarocks -luadir ?= $(datarootdir)/lua/$(LUA_VERSION) -builddir ?= ./build -buildbinarydir ?= ./build-binary +LUA = $(LUA_BINDIR)/$(LUA_INTERPRETER) +luarocksconfdir = $(sysconfdir)/luarocks +luadir = $(datarootdir)/lua/$(LUA_VERSION) +builddir = ./build +buildbinarydir = ./build-binary LUAROCKS_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 @@ prefix="/usr/local" sysconfdir="$prefix/etc" -luarocksconfdir="$sysconfdir/luarocks" rocks_tree="$prefix" # ---------------------------------------------------------------------------- @@ -108,7 +107,6 @@ For better control, use the options below. Fine tuning of the installation directories: --sysconfdir=SYSCONFDIR Directory for single-machine config [PREFIX/etc] - --luarocksconfdir=DIR Directory for luarocks config [SYSCONFDIR/luarocks] Where to install files provided by rocks: --rocks-tree=DIR Root of the local tree of installed rocks. @@ -241,11 +239,6 @@ do sysconfdir="$(canonicalpath "$value")" sysconfdir_SET=yes ;; - --luarocksconfdir) - [ -n "$value" ] || die "Missing value in flag $key." - luarocksconfdir="$(canonicalpath "$value")" - luarocksconfdir_SET=yes - ;; # Where to install files provided by rocks: @@ -342,11 +335,6 @@ then sysconfdir_SET=yes fi -if [ "$sysconfdir_SET" = "yes" ] && [ ! "$luarocksconfdir_SET" = "yes" ] -then - luarocksconfdir=$sysconfdir/luarocks -fi - if [ "$prefix_SET" = "yes" ] && [ ! "$rocks_tree_SET" = "yes" ] then rocks_tree=$prefix @@ -488,7 +476,7 @@ cat < config.unix # Run "./configure --help" for details. prefix=$prefix -luarocksconfdir=$luarocksconfdir +sysconfdir=$sysconfdir rocks_tree=$rocks_tree LUA_VERSION=$LUA_VERSION LUA_INTERPRETER=$LUA_INTERPRETER @@ -505,7 +493,7 @@ echo echo echo "LuaRocks will be installed at......: $(GREEN "$prefix")" echo "LuaRocks will install rocks at.....: $(GREEN "$rocks_tree")" -echo "LuaRocks configuration directory...: $(GREEN "$luarocksconfdir")" +echo "LuaRocks configuration directory...: $(GREEN "$sysconfdir/luarocks")" echo "Using Lua from.....................: $(GREEN "$LUA_DIR")" if [ "$LUA_BINDIR_SET" = "yes" ]; then echo "Lua bin directory..................: $(GREEN "$LUA_BINDIR")" ; fi if [ "$LUA_INCDIR_SET" = "yes" ]; then echo "Lua include directory..............: $(GREEN "$LUA_INCDIR")" ; fi -- cgit v1.2.3-55-g6feb