From: Junio C Hamano Date: Thu, 05 Feb 2009 07:44:31 GMT Subject: Re: 026fa0d5ad Breaks installs with absolue $(gitexecdir) and $(template_dir) variables using older GNU makes Message-ID: <7vzlh1gwf4.fsf@gitster.siamese.dyndns.org> In-Reply-To: <7v63jpibe8.fsf@gitster.siamese.dyndns.org> Junio C Hamano writes: > A Large Angry SCM writes: > >> The new test is also wrong; (for *nix systems) in that it really wants >> to test if the first character is a '/' but GNU make doesn't have a >> way to do that directly. > > Hmph. Isn't it just the matter of doing something silly like this? > > ifeq ($(filter /%,$(template_dir)),) > ... it does not start with a slash > else > ... it does > endif That is, something like this. The patch also protects the $(filter) check from sick users that use template_dir = My Files /the-leading-dir-ends-with-a-space by using $(firstword) No, I didn't test it. Makefile | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git c/Makefile w/Makefile index a82f173..605b147 100644 --- c/Makefile +++ w/Makefile @@ -1434,14 +1434,14 @@ remove-dashes: ### Installation rules -ifeq ($(abspath $(template_dir)),$(template_dir)) +ifneq ($(filter /%,$(firstword $(template_dir))),) template_instdir = $(template_dir) else template_instdir = $(prefix)/$(template_dir) endif export template_instdir -ifeq ($(abspath $(gitexecdir)),$(gitexecdir)) +ifneq ($(filter /%,$(firstword $(gitexecdir))),) gitexec_instdir = $(gitexecdir) else gitexec_instdir = $(prefix)/$(gitexecdir)