Initial import
[external/libunwind.git] / packaging / fix_symlink.patch
1 From 612e1056f69fb95409586ff715f614c0bbc013d8 Mon Sep 17 00:00:00 2001
2 From: Matt Fischer <matt.fischer@garmin.com>
3 Date: Fri, 19 Apr 2013 15:18:27 -0500
4 Subject: [PATCH] Fix symlink install hook
5
6 During the install, symlinks are added from libunwind-<arch> to
7 libunwind-generic.  However, on platforms that don't support
8 symlinking (such as Windows), the $(LN_S) macro is defined
9 as 'cp -p' instead.  This works fine, except that since the
10 target of the symlink is a relative path, the copy will only
11 succeed if the current directory is the directory that contains
12 the file.
13
14 The solution to this problem suggested in the Autotools manual
15 (see http://www.gnu.org/software/automake/manual/automake.html#Extending)
16 is to simply cd into the correct directory first.  This patch
17 makes that change for the symlinks that are being made during install.
18
19 [ edit: use relative path for the link name as well ]
20 ---
21  src/Makefile.am |    6 +++---
22  1 files changed, 3 insertions(+), 3 deletions(-)
23
24 diff --git a/src/Makefile.am b/src/Makefile.am
25 index 30cb396..3daa246 100644
26 --- a/src/Makefile.am
27 +++ b/src/Makefile.am
28 @@ -394,10 +394,10 @@ else
29  # to be there if the user configured with --disable-shared.
30  #
31  install-exec-hook:
32 -       $(LN_S) -f libunwind-$(arch).a  $(DESTDIR)$(libdir)/libunwind-generic.a
33 +       cd $(DESTDIR)$(libdir) && $(LN_S) -f libunwind-$(arch).a libunwind-generic.a
34         if test -f $(DESTDIR)$(libdir)/libunwind-$(arch).so; then \
35 -           $(LN_S) -f libunwind-$(arch).so \
36 -               $(DESTDIR)$(libdir)/libunwind-generic.so; \
37 +               cd $(DESTDIR)$(libdir) && $(LN_S) -f libunwind-$(arch).so \
38 +               libunwind-generic.so; \
39         fi
40  endif
41  
42 -- 
43 1.7.2.5
44