Another Windows patch for fixing the "install" target in Makefile.am.

On Windows, syn links usually don't work, so automake uses "cp" instead of
"ln -s", but the ways those commands handle their arguments are not
completely equivalent.

Specifically, commands like...

   $(LN_S) foo $dir/foo

doesn't work with "cp" because it doesn't resolve the first argument
relative to the second. This patch solves the issue replacing those
commands by...

   cd $dir && $(LN_S) foo foo

as recommended in the automake documentation.
From 110406eca65bed2e3f13df89ae6dded14244466f Mon Sep 17 00:00:00 2001
From: Salvador Fandino <[email protected]>
Date: Wed, 4 Oct 2017 15:21:24 +0200
Subject: [PATCH] install: simulate ln -s correctly on Windows

make install was failing on Windows because there cp is
used to replace ln -s commands but cp doesn't resolve its
first argument as relative to the second one.

This patch changes the install-bashcompletion-aliases rules
to chdir to the target dir so that cp works correctly. This
is the solution recomended in the automake documentation.
---
 Makefile.am | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 9a6b42a9..275ceeac 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -68,14 +68,14 @@ bashcompletiondir=@bashcompletiondir@
 dist_bashcompletion_DATA = shell-completion/bash/pulseaudio
 
 install-bashcompletion-aliases:
-	$(LN_S) -f pulseaudio $(DESTDIR)$(bashcompletiondir)/pactl
-	$(LN_S) -f pulseaudio $(DESTDIR)$(bashcompletiondir)/pacmd
-	$(LN_S) -f pulseaudio $(DESTDIR)$(bashcompletiondir)/pasuspender
-	$(LN_S) -f pulseaudio $(DESTDIR)$(bashcompletiondir)/padsp
-	$(LN_S) -f pulseaudio $(DESTDIR)$(bashcompletiondir)/pacat
-	$(LN_S) -f pulseaudio $(DESTDIR)$(bashcompletiondir)/paplay
-	$(LN_S) -f pulseaudio $(DESTDIR)$(bashcompletiondir)/parec
-	$(LN_S) -f pulseaudio $(DESTDIR)$(bashcompletiondir)/parecord
+	cd $(DESTDIR)$(bashcompletiondir) && $(LN_S) -f pulseaudio pactl
+	cd $(DESTDIR)$(bashcompletiondir) && $(LN_S) -f pulseaudio pacmd
+	cd $(DESTDIR)$(bashcompletiondir) && $(LN_S) -f pulseaudio pasuspender
+	cd $(DESTDIR)$(bashcompletiondir) && $(LN_S) -f pulseaudio padsp
+	cd $(DESTDIR)$(bashcompletiondir) && $(LN_S) -f pulseaudio pacat
+	cd $(DESTDIR)$(bashcompletiondir) && $(LN_S) -f pulseaudio paplay
+	cd $(DESTDIR)$(bashcompletiondir) && $(LN_S) -f pulseaudio parec
+	cd $(DESTDIR)$(bashcompletiondir) && $(LN_S) -f pulseaudio parecord
 
 install-data-hook: install-bashcompletion-aliases
 
-- 
2.14.1

_______________________________________________
pulseaudio-discuss mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss

Reply via email to