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

[PATCH] Guard a few Makefile variables against user environments

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Mar 25, 2009, 16:27 UTC
Message-ID
<1d60c2034e0b5058cb691f572eb57f0aefb9fdc7.1237998428u.git.johannes.schindelin@gmx.de>
In-Reply-To
<cover.1237998428u.git.johannes.schindelin@gmx.de>

Some variables are not initialized in the Makefile, but appended to. If the user has those variables in her environment, it will break the build.

The variable names were found using these commands:
	$ s='[ \t]';
	$ S='[^ \t]';
	$ comm -23 \
		<(sed -n "s/^$s*\($S*\)$s$s*+=.*/\1/p" < Makefile |
		  sort | uniq) \
		<(sed -n "s/^$s*\($S*\)$s$s*=.*/\1/p" < Makefile |
		  sort | uniq)
This fixes msysGit issue 216.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 Makefile |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/Makefile b/Makefile
index 43a8364..d77fd71 100644
--- a/Makefile
+++ b/Makefile
@@ -263,6 +263,18 @@ SPARSE_FLAGS = -D__BIG_ENDIAN__ -D__powerpc__
 BASIC_CFLAGS =
 BASIC_LDFLAGS =
 
+# Guard against environment variables
+BUILTIN_OBJS =
+BUILT_INS =
+COMPAT_CFLAGS =
+COMPAT_OBJS =
+LIB_H =
+LIB_OBJS =
+PROGRAMS =
+SCRIPT_PERL =
+SCRIPT_SH =
+TEST_PROGRAMS =
+
 SCRIPT_SH += git-am.sh
 SCRIPT_SH += git-bisect.sh
 SCRIPT_SH += git-difftool-helper.sh
-- 
1.6.2.1.493.g67cf3
Message 1 of 1 in “Guard a few Makefile variables against user environments”
  1. Guard a few Makefile variables against user environmentsJohannes Schindelin, Mar 25, 2009

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.