git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: A Large Angry SCM <gitzilla@gmail.com>
To: Steffen Prohaska <prohaska@zib.de>
Cc: git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>
Subject: 026fa0d5ad Breaks installs with absolue $(gitexecdir) and $(template_dir) variables using older GNU makes
Date: Sun, 01 Feb 2009 13:24:33 -0500	[thread overview]
Message-ID: <4985E8E1.90303@gmail.com> (raw)

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

             reply	other threads:[~2009-02-01 18:30 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-01 18:24 A Large Angry SCM [this message]
2009-02-05  7:04 ` 026fa0d5ad Breaks installs with absolue $(gitexecdir) and $(template_dir) variables using older GNU makes 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4985E8E1.90303@gmail.com \
    --to=gitzilla@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=prohaska@zib.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).