Kaydet (Commit) efad388f authored tarafından Stephan Bergmann's avatar Stephan Bergmann

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
üst 2957be02
......@@ -53,6 +53,7 @@
/config_build_lang.mk
/configure
/lo.xcent
/solenv/gbuild/shell.mk
/Makefile
/NEWS
/TODO
......
......@@ -17,11 +17,12 @@ build_goal:=$(if $(filter build check,$(MAKECMDGOALS)),all)\
$(if $(filter check,$(MAKECMDGOALS)),subsequentcheck)\
$(filter all build-l10n-only build-non-l10n-only debugrun help showmodules translations $(gb_Top_MODULE_CHECK_TARGETS) check packageinfo,$(MAKECMDGOALS))
SHELL := @SHELL_BASH@
SRCDIR := @SRC_ROOT@
BUILDDIR := @BUILDDIR@
GIT_BUILD := $(if $(wildcard $(SRCDIR)/.git),T)
include $(SRCDIR)/solenv/gbuild/shell.mk
# Run autogen.sh if needed and force make to restart itself.
# ... but there are several cases where we do not want to run
# autogen.sh:
......@@ -44,6 +45,7 @@ $(BUILDDIR)/config_host.mk : $(wildcard \
$(SRCDIR)/configure.ac \
$(SRCDIR)/config_host/*.h.in \
$(SRCDIR)/android/source/AndroidManifest.xml.in \
$(SRCDIR)/solenv/gbuild/shell.mk.in \
$(BUILDDIR)/autogen.input \
$(BUILDDIR)/autogen.lastrun \
$(BUILDDIR)/autogen.sh \
......@@ -58,7 +60,7 @@ gb_Side ?= host
include $(BUILDDIR)/config_$(gb_Side).mk
export GMAKE_OPTIONS?=-r$(if $(verbose),,s)$(value $(MAKEFLAGS))
export GMAKE_OPTIONS?=-r$(if $(verbose),,s)$(value $(MAKEFLAGS)) SHELL=$(SHELL)
PARALLELISM_OPTION := $(if $(filter-out 0,$(PARALLELISM)),-j $(PARALLELISM),)
......
......@@ -4519,6 +4519,7 @@ if test "$cross_compiling" = "yes"; then
lo.xcent.in \
instsetoo_native/util/openoffice.lst.in \
config_host/*.in \
solenv/gbuild/shell.mk.in \
sysui/desktop/macosx/Info.plist.in \
ios/lo.xcconfig.in) \
| (cd CONF-FOR-BUILD && tar xf -)
......@@ -4956,10 +4957,12 @@ if test "$_make_ver_check" = ""; then
STALE_MAKE=TRUE
fi
if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
SHELL_BASH=$(cygpath -m $(which bash))
else
SHELL_BASH=`which bash`
if test -z "$SHELL_BASH"; then
if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
SHELL_BASH=$(cygpath -m $(which bash))
else
SHELL_BASH=`which bash`
fi
fi
AC_SUBST(SHELL_BASH)
......@@ -12995,6 +12998,7 @@ AC_CONFIG_FILES([config_host.mk
Makefile
lo.xcent
instsetoo_native/util/openoffice.lst
solenv/gbuild/shell.mk
sysui/desktop/macosx/Info.plist
ios/lo.xcconfig])
AC_CONFIG_HEADERS([config_host/config_buildid.h])
......
......@@ -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=<path_to_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
......
......@@ -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
......
# -*- 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:
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment