From 213639494e897502b73648aebbf274e4ae0cb27e Mon Sep 17 00:00:00 2001 From: Stefano Lattarini Date: Fri, 9 Mar 2012 13:43:55 +0100 Subject: configure: allow user to prevent $PATH "sanitization" on Solaris On a Solaris 10 system with Solaris make installed as '/usr/xpg4/bin/make', GNU make installed as '/usr/local/bin/make', and with '/usr/local/bin' appearing in $PATH *before* '/usr/xpg4/bin', I was seeing errors like this upon invoking "make all": Usage : make [ -f makefile ][ -K statefile ]... make: Fatal error: Unknown option `-C' This happenes because the Git's Makefile, when running on Solaris, automatically "sanitizes" $PATH by prepending '/usr/xpg6/bin' and '/usr/xpg4/bin' to it in order to avoid using non-POSIX /bin/sh from being used. In the setup described above, however, this has an unintended consequence of forcing the use of Solaris make in recursive make invocations -- even if the $(MAKE) macro is being correctly used in them! When building without using the autoconf machinery, this can be solved by overriding $(SANE_TOOL_PATH). Teach the autoconf machinery to also allow users of ./configure to override it from the command line with a new --with-sane-tool-path option. Signed-off-by: Stefano Lattarini Signed-off-by: Junio C Hamano diff --git a/configure.ac b/configure.ac index 8bb0f44..72f7958 100644 --- a/configure.ac +++ b/configure.ac @@ -137,6 +137,23 @@ if test -n "$1"; then fi ]) +# Directories holding "saner" versions of common or POSIX binaries. +AC_ARG_WITH([sane-tool-path], + [AS_HELP_STRING( + [--with-sane-tool-path=DIR-1[[:DIR-2...:DIR-n]]], + [Directories to prepend to PATH in build system and generated scripts])], + [if test "$withval" = "no"; then + withval='' + else + AC_MSG_NOTICE([Setting SANE_TOOL_PATH to '$withval']) + fi + GIT_CONF_APPEND_LINE([SANE_TOOL_PATH=$withval])], + [# If the "--with-sane-tool-path" option was not given, don't touch + # SANE_TOOL_PATH here, but let defaults in Makefile take care of it. + # This should minimize spurious differences in the behaviour of the + # Git build system when configure is used w.r.t. when it is not. + :]) + ## Site configuration related to programs (before tests) ## --with-PACKAGE[=ARG] and --without-PACKAGE # -- cgit v0.10.2-6-g49f6