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

026fa0d5ad Breaks installs with absolue $(gitexecdir) and $(template_dir) variables using older GNU makes

From
A Large Angry SCM <gitzilla@gmail.com>
Date
Feb 1, 2009, 18:24 UTC
Message-ID
<4985E8E1.90303@gmail.com>

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
Next: Junio C Hamano
Message 1 of 13 in “026fa0d5ad Breaks installs with absolue $(gitexecdir) and $(template_dir) variables using older GNU makes”
  1. A Large Angry SCMFeb 1, 2009
  2. Junio C HamanoFeb 5, 2009
  3. Steffen ProhaskaFeb 5, 2009
  4. Junio C HamanoFeb 5, 2009
  5. Pascal ObryFeb 5, 2009
  6. Junio C HamanoFeb 5, 2009
  7. Pascal ObryFeb 5, 2009
  8. Junio C HamanoFeb 5, 2009
  9. Junio C HamanoFeb 5, 2009
  10. Makefile: fix misdetection of relative pathnamesJunio C Hamano, Feb 5, 2009
  11. Johannes SixtFeb 5, 2009
  12. Junio C HamanoFeb 5, 2009
  13. A Large Angry SCMFeb 5, 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.