From efad388f756014a7df5ed6f8e4ce417d24e9aba9 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Fri, 2 Oct 2015 10:42:31 +0200 Subject: Clean up Make SHELL handling * In configure.ac, honour a preset SHELL_BASH when determining SHELL_BASH (so it can be passed in via autogen.input). * For both toplevel "make" and per-module "cd $module && make", consistenly use the SHELL_BASH determined in configure.ac as the Make SHELL. (By moving the setting to a new, common soleng/gbuild/shell.mk. This also exports SHELL as an environment variable to sub-processes now; this exporting can probably be reverted if it is not what is actually wanted---but note that this exporting of an environment variable to sub-processes is unrelated to how nested invocations of $(MAKE) obtain their Make SHELL setting, see below.) * Remove the gb_SHELL override feature from solenv/gbuild/gbuild.mk; for one, it is unclear how it was intended to interact with setting SHELL=@SHELL_BASH@ in the toplevel Makefile; for another, overriding SHELL can be done globally via setting SHELL_BASH in autogen.input now. * Make treats SHELL specially, in that it never uses the SHELL environment variable to determine the Make SHELL variable. Instead, if this Make invocation, or any outer Make invocation it is nested in via calls of $(MAKE), was called with a SHELL=... command line argument, then that value is used (and otherwise the default is hardwired as /bin/sh). So, when calling nested invocations of $(MAKE) from the toplevel Makefile, pass down the current SHELL value via a SHELL=... command line argument via GMAKE_OPTIONS. (And further nested invocations of $(MAKE) will then automatically inherit the SHELL value given on the outer invocation's command line.) Change-Id: I67fa1b88e4e90d09456c1fcad2d082fdce3c019b --- solenv/gbuild/gbuild.mk | 19 ------------------- solenv/gbuild/partial_build.mk | 2 ++ solenv/gbuild/shell.mk.in | 12 ++++++++++++ 3 files changed, 14 insertions(+), 19 deletions(-) create mode 100644 solenv/gbuild/shell.mk.in (limited to 'solenv') diff --git a/solenv/gbuild/gbuild.mk b/solenv/gbuild/gbuild.mk index 31420624759f..04056cd136c8 100644 --- a/solenv/gbuild/gbuild.mk +++ b/solenv/gbuild/gbuild.mk @@ -44,25 +44,6 @@ GBUILDDIR:=$(SRCDIR)/solenv/gbuild MAKEFLAGS += r .SUFFIXES: -# by default gbuild use /bin/sh -# if you want to use a particular shell -# you can export gb_SHELL= -# - -ifdef gb_SHELL -SHELL := $(gb_SHELL) -else -ifeq ($(OS_FOR_BUILD),WNT) -ifeq ($(GNUMAKE_WIN_NATIVE),TRUE) -SHELL := $(shell cygpath -m /bin/sh) -else -SHELL := /bin/sh -endif -else -SHELL := /bin/sh -endif -endif - true := T false := define NEWLINE diff --git a/solenv/gbuild/partial_build.mk b/solenv/gbuild/partial_build.mk index 3b4478f23154..e8413246bd1a 100644 --- a/solenv/gbuild/partial_build.mk +++ b/solenv/gbuild/partial_build.mk @@ -32,6 +32,8 @@ ifeq ($(BUILD_TYPE),) include $(BUILDDIR)/config_$(gb_Side).mk endif +include $(SRCDIR)/solenv/gbuild/shell.mk + gb_PARTIAL_BUILD := T include $(SRCDIR)/solenv/gbuild/gbuild.mk diff --git a/solenv/gbuild/shell.mk.in b/solenv/gbuild/shell.mk.in new file mode 100644 index 000000000000..d5a92528e522 --- /dev/null +++ b/solenv/gbuild/shell.mk.in @@ -0,0 +1,12 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +export SHELL := @SHELL_BASH@ + +# vim: set noet sw=4 ts=4: -- cgit