From mboxrd@z Thu Jan 1 00:00:00 1970 From: Roger Pau Monne Subject: Re: [PATCH 2/9] tools/build: fix pygrub linking Date: Thu, 19 Jul 2012 16:00:21 +0100 Message-ID: <50082105.1020801@citrix.com> References: <1342002232-75531-1-git-send-email-roger.pau@citrix.com> <1342002232-75531-3-git-send-email-roger.pau@citrix.com> <4FFD5CDB.8090409@amd.com> <4FFEFB8B.3040000@citrix.com> <20485.37211.873318.627523@mariner.uk.xensource.com> <50059421.406@citrix.com> <20485.44103.120825.660007@mariner.uk.xensource.com> <5006732B.20804@citrix.com> <20486.38043.582649.853670@mariner.uk.xensource.com> <5006C057.9050006@citrix.com> <20488.7740.264821.563339@mariner.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20488.7740.264821.563339@mariner.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Jackson Cc: Christoph Egger , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org Ian Jackson wrote: > Roger Pau Monne writes ("Re: [PATCH 2/9] tools/build: fix pygrub linking"): >> Ian Jackson wrote: >>> Roger Pau Monne writes ("Re: [PATCH 2/9] tools/build: fix pygrub linking"): >>>> Ian Jackson wrote: >>>>> If DESTDIR is not "" then $(PRIVATE_BINDIR)/pygrub is not the same >>>>> directory as $(DESTDIR)/$(BINDIR). >>>> Ok, both conditions have to be meet, that DESTDIR == "" and >>>> PRIVATE_BINDIR == BINDIR (so $(DESTDIR)/$(BINDIR) == $(PRIVATE_BINDIR)). >>> Right. OK. I see now why my test -e is wrong. >>> >>> But I still think this should be done with an if in the rule's >>> command, rather than a makefile conditional. >> What do you think about: >> >> set -e; if [ `readlink -f $(DESTDIR)/$(BINDIR)` != \ >> `readlink -f $(PRIVATE_BINDIR)` ]; then \ >> ln -sf $(PRIVATE_BINDIR)/pygrub $(DESTDIR)/$(BINDIR); \ >> fi > > That looks plausible. > > Can we assume that we are using bash as our shell for these commands ? > If so we can use `test A -ef B'. I wouldn't make such an assumption, I've build Xen on systems without bash (Alpine Linux and NetBSD).