From 612e1056f69fb95409586ff715f614c0bbc013d8 Mon Sep 17 00:00:00 2001 From: Matt Fischer Date: Fri, 19 Apr 2013 15:18:27 -0500 Subject: [PATCH] Fix symlink install hook During the install, symlinks are added from libunwind- to libunwind-generic. However, on platforms that don't support symlinking (such as Windows), the $(LN_S) macro is defined as 'cp -p' instead. This works fine, except that since the target of the symlink is a relative path, the copy will only succeed if the current directory is the directory that contains the file. The solution to this problem suggested in the Autotools manual (see http://www.gnu.org/software/automake/manual/automake.html#Extending) is to simply cd into the correct directory first. This patch makes that change for the symlinks that are being made during install. [ edit: use relative path for the link name as well ] --- src/Makefile.am | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 30cb3967..3daa2464 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -394,10 +394,10 @@ else # to be there if the user configured with --disable-shared. # install-exec-hook: - $(LN_S) -f libunwind-$(arch).a $(DESTDIR)$(libdir)/libunwind-generic.a + cd $(DESTDIR)$(libdir) && $(LN_S) -f libunwind-$(arch).a libunwind-generic.a if test -f $(DESTDIR)$(libdir)/libunwind-$(arch).so; then \ - $(LN_S) -f libunwind-$(arch).so \ - $(DESTDIR)$(libdir)/libunwind-generic.so; \ + cd $(DESTDIR)$(libdir) && $(LN_S) -f libunwind-$(arch).so \ + libunwind-generic.so; \ fi endif