Skip to contentSkip to conversation

Guard a few Makefile variables against user environments

PATCH New Johannes Schindelin 1 participant 1 message Jun 15, 2016 1 message not in the archive Kbuild

lore
Share & tools
lore
#1 lore raw

PATCH 1/1 Guard a few Makefile variables against user environments

In reply to a message not in the archive

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.

---
 Makefile |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
Makefile +12 -0
index 43a8364..d77fd71 100644
@@ -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
Signature · 1 line
1.6.2.1.493.g67cf3