From 221be761f467da76875247bc02d7a1716682075d Mon Sep 17 00:00:00 2001 From: Lasse Collin Date: Fri, 11 Sep 2009 10:24:09 +0300 Subject: Use $(LN_EXEEXT) in symlinks to executables. This fixes "make install" on operating systems using a suffix for executables. Cygwin is treated specially. The symlink names won't have .exe suffix even though the executables themselves have. Thanks to Charles Wilson. --- configure.ac | 9 +++++++++ src/xz/Makefile.am | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index d125a693..555f5f7c 100644 --- a/configure.ac +++ b/configure.ac @@ -44,6 +44,15 @@ case $host_os in esac AM_CONDITIONAL([COND_W32], [test "$is_w32" = yes]) +# We need to use $EXEEXT with $(LN_S) when creating symlinks to +# executables. Cygwin is an exception to this, since it is recommended +# that symlinks don't have the .exe suffix. To make this work, we +# define LN_EXEEXT. +case $host_os in + cygwin) LN_EXEEXT= ;; + *) LN_EXEEXT='$(EXEEXT)' ;; +esac +AC_SUBST([LN_EXEEXT]) echo echo "Configure options:" diff --git a/src/xz/Makefile.am b/src/xz/Makefile.am index ccdc66ca..9f4b4668 100644 --- a/src/xz/Makefile.am +++ b/src/xz/Makefile.am @@ -69,7 +69,7 @@ install-exec-hook: cd $(DESTDIR)$(bindir) && \ target=`echo xz | sed '$(transform)'`$(EXEEXT) && \ for name in $(xzlinks); do \ - link=`echo $$name | sed '$(transform)'` && \ + link=`echo $$name | sed '$(transform)'`$(LN_EXEEXT) && \ rm -f $$link && \ $(LN_S) $$target $$link; \ done @@ -86,7 +86,7 @@ install-data-hook: uninstall-hook: cd $(DESTDIR)$(bindir) && \ for name in $(xzlinks); do \ - link=`echo $$name | sed '$(transform)'` && \ + link=`echo $$name | sed '$(transform)'`$(LN_EXEEXT) && \ rm -f $$link; \ done cd $(DESTDIR)$(mandir)/man1 && \ -- cgit v1.2.3