git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] configure: allow user to prevent $PATH "sanitization" on Solaris

From
Stefano Lattarini <stefano.lattarini@gmail.com>
Date
Mar 9, 2012, 12:43 UTC
Message-ID
<a706eaa1e1cd5e13a8cd98362fe09bba628789d1.1331296220.git.stefano.lattarini@gmail.com>
In-Reply-To
<7vhay6etqc.fsf@alter.siamese.dyndns.org>

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":

        SUBDIR perl
    make: Warning: Ignoring DistributedMake -o option
    Usage : make [ -f makefile ][ -K statefile ]...
    make: Fatal error: Unknown option `-C'

This happened because the Git's Makefile, when running on Solaris, automatically "sanitizes" $PATH by prepending '/usr/xpg6/bin' and '/usr/xpg4/bin' to it, and in the setup described above such a behaviour has the unintended consequence of forcing the use of Solaris make in recursive make invocations -- even if the $(MAKE) macro is being correctly used in them!

For developers that don't use the autoconf machinery, the best and easier fix in such a situation is to properly override $(SANE_TOOL_PATH) in config.mak. But a developer using the autoconf-generated configure script to set up its Git source tree's configuration wouldn't expect to also have to provide such an override *by hand* after having run configure; he would either expect:

  1) that the issue is automatically detected and transparently worked
     around by configure; or at least
  2) that a configure-time override telling how (and if) PATH is to be
     sanitized is provided.

This change implements the second approach, which is less-ambitious but also much less fragile. Note that, even if we should decide to implement the first approach in the future, the code added by the present change still be useful, allowing the user the possibility to override the configure's choices in case they turn out wrong (in true autotools spirit). ---

 Hi Junio, sorry for the delay.  Here is a simpler approach that worked
 out well enough for me; the commit message should explain the rationales
 and motivations for it in detail.
 Regards,
   Stefano
 configure.ac |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)
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
 #
-- 
1.7.9
Previous: Junio C HamanoNext: Junio C Hamano
Message 8 of 12 in “build: avoid possible confusion between GNU/XPG4 make on Solaris”
  1. build: avoid possible confusion between GNU/XPG4 make on SolarisStefano Lattarini, Mar 2, 2012
  2. Thomas RastMar 2, 2012
  3. Stefano LattariniMar 2, 2012
  4. build: avoid possible confusion between GNU/XPG4 make on SolarisStefano Lattarini, Mar 2, 2012
  5. Junio C HamanoMar 2, 2012
  6. Stefano LattariniMar 2, 2012
  7. Junio C HamanoMar 2, 2012
  8. configure: allow user to prevent $PATH "sanitization" on SolarisStefano Lattarini, Mar 9, 2012
  9. Junio C HamanoMar 9, 2012
  10. Junio C HamanoMar 9, 2012
  11. Stefano LattariniMar 9, 2012
  12. Junio C HamanoMar 9, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.