git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* 026fa0d5ad Breaks installs with absolue $(gitexecdir) and $(template_dir) variables using older GNU makes
@ 2009-02-01 18:24 A Large Angry SCM
  2009-02-05  7:04 ` Junio C Hamano
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: A Large Angry SCM @ 2009-02-01 18:24 UTC (permalink / raw)
  To: Steffen Prohaska; +Cc: git, Junio C Hamano

In 026fa0d5ad9538ca76838070861531c037d7b9ba, "Move computation of 
absolute paths from Makefile to runtime (in preparation for 
RUNTIME_PREFIX)", the following change was made to the Makefile. The 
problem is that $(abspath names...) is a relatively recent addition to 
GNU make and when used in an older GNU make, the test always fails 
resulting incorrect installation dirs for the templates and commands.

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. Instead, it tests if the first character is a / 
_AND_ the path string does not include . or .. components,

The older test has problems itself but at least it allowed you to 
specify absolute paths.

@@ -1407,17 +1417,17 @@ remove-dashes:

  ### Installation rules

-ifeq ($(firstword $(subst /, ,$(template_dir))),..)
-template_instdir = $(bindir)/$(template_dir)
-else
+ifeq ($(abspath $(template_dir)),$(template_dir))
  template_instdir = $(template_dir)
+else
+template_instdir = $(prefix)/$(template_dir)
  endif
  export template_instdir

-ifeq ($(firstword $(subst /, ,$(gitexecdir))),..)
-gitexec_instdir = $(bindir)/$(gitexecdir)
-else
+ifeq ($(abspath $(gitexecdir)),$(gitexecdir))
  gitexec_instdir = $(gitexecdir)
+else
+gitexec_instdir = $(prefix)/$(gitexecdir)
  endif
  gitexec_instdir_SQ = $(subst ','\'',$(gitexec_instdir))
  export gitexec_instdir


I see 3 ways to fix the problem:
	1) go back to using the old test.
	2) keep the new test but add a test that will break the build if
		$(abspath names...) does not work.
	3) something like the following (untested)


  ### Installation rules


  temp = $(subst " ",x,$(template_dir))
  temp = $(subst //,/,$(temp))
  temp = $(addsuffix x,$(temp))
  temp = $(subst /, ,$(temp))
  ifeq ($(strip $(temp)),$(temp))
  template_instdir = $(template_dir)
  else
  template_instdir = $(prefix)/$(template_dir)
  endif
  export template_instdir

  temp = $(subst " ",x,$(gitexecdir))
  temp = $(subst //,/,$(temp))
  temp = $(addsuffix x,$(temp))
  temp = $(subst /, ,$(temp))
  ifeq ($(strip $(temp)),$(temp))
  gitexec_instdir = $(gitexecdir)
  else
  gitexec_instdir = $(prefix)/$(gitexecdir)
  endif
  gitexec_instdir_SQ = $(subst ','\'',$(gitexec_instdir))
  export gitexec_instdir

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2009-02-05 22:17 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-01 18:24 026fa0d5ad Breaks installs with absolue $(gitexecdir) and $(template_dir) variables using older GNU makes A Large Angry SCM
2009-02-05  7:04 ` Junio C Hamano
2009-02-05  7:13   ` Steffen Prohaska
2009-02-05  7:35 ` Junio C Hamano
2009-02-05  7:38   ` Pascal Obry
2009-02-05  7:53     ` Junio C Hamano
2009-02-05  7:57       ` Pascal Obry
2009-02-05  8:01       ` Junio C Hamano
2009-02-05  7:44   ` Junio C Hamano
2009-02-05  8:18 ` [PATCH] Makefile: fix misdetection of relative pathnames Junio C Hamano
2009-02-05 12:27   ` Johannes Sixt
2009-02-05 17:19     ` Junio C Hamano
2009-02-05 22:16   ` A Large Angry SCM

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).