##
## This rule gets called at "make install" time; we use it to create links
## between different programs.
-## On Cygwin, the choice of ln or ln -s must be made at install time,
-## not configure time, because some filesystems (NTFS) support hard
-## links but others (FAT32) don't. The fallback to cp -p might not be
-## needed, but it's here just in case.
##
install-exec-hook:
rm -f $(DESTDIR)$(bindir)/flists$(EXEEXT)
rm -f $(DESTDIR)$(bindir)/unseen$(EXEEXT)
rm -f $(DESTDIR)$(bindir)/prev$(EXEEXT)
rm -f $(DESTDIR)$(bindir)/next$(EXEEXT)
- cd $(DESTDIR)$(bindir) && \
- if ln flist$(EXEEXT) flists$(EXEEXT) 2>/dev/null && \
- ln folder$(EXEEXT) folders$(EXEEXT) && \
- ln new$(EXEEXT) fnext$(EXEEXT) && \
- ln new$(EXEEXT) fprev$(EXEEXT) && \
- ln new$(EXEEXT) unseen$(EXEEXT) && \
- ln show$(EXEEXT) prev$(EXEEXT) && \
- ln show$(EXEEXT) next$(EXEEXT); then :; \
- elif ln -s flist$(EXEEXT) flists$(EXEEXT) 2>/dev/null && \
- ln -s folder$(EXEEXT) folders$(EXEEXT) && \
- ln -s new$(EXEEXT) fnext$(EXEEXT) && \
- ln -s new$(EXEEXT) fprev$(EXEEXT) && \
- ln -s new$(EXEEXT) unseen$(EXEEXT) && \
- ln -s show$(EXEEXT) prev$(EXEEXT) && \
- ln -s show$(EXEEXT) next$(EXEEXT); then :; \
- else cp -p flist$(EXEEXT) flists$(EXEEXT) && \
- cp -p folder$(EXEEXT) folders$(EXEEXT) && \
- cp -p new$(EXEEXT) fnext$(EXEEXT) && \
- cp -p new$(EXEEXT) fprev$(EXEEXT) && \
- cp -p new$(EXEEXT) unseen$(EXEEXT) && \
- cp -p show$(EXEEXT) prev$(EXEEXT) && \
- cp -p show$(EXEEXT) next$(EXEEXT); \
- fi
+ @LINK_FILE@ $(DESTDIR)$(bindir)/flist$(EXEEXT) $(DESTDIR)$(bindir)/flists$(EXEEXT)
+ @LINK_FILE@ $(DESTDIR)$(bindir)/folder$(EXEEXT) $(DESTDIR)$(bindir)/folders$(EXEEXT)
+ @LINK_FILE@ $(DESTDIR)$(bindir)/new$(EXEEXT) $(DESTDIR)$(bindir)/fnext$(EXEEXT)
+ @LINK_FILE@ $(DESTDIR)$(bindir)/new$(EXEEXT) $(DESTDIR)$(bindir)/fprev$(EXEEXT)
+ @LINK_FILE@ $(DESTDIR)$(bindir)/new$(EXEEXT) $(DESTDIR)$(bindir)/unseen$(EXEEXT)
+ @LINK_FILE@ $(DESTDIR)$(bindir)/show$(EXEEXT) $(DESTDIR)$(bindir)/prev$(EXEEXT)
+ @LINK_FILE@ $(DESTDIR)$(bindir)/show$(EXEEXT) $(DESTDIR)$(bindir)/next$(EXEEXT)
if test x$(SETGID_MAIL) != x; then \
chgrp $(MAIL_SPOOL_GRP) $(DESTDIR)$(bindir)/inc$(EXEEXT) && \
chmod 2755 $(DESTDIR)$(bindir)/inc$(EXEEXT); \
AS_IF([test -z "$editorpath"], [editorpath="$vipath"])
AC_SUBST([editorpath])dnl
+dnl Cygwin FAT filesystems do not support hard links. So use cp instead,
+dnl even if running on an NTFS or other filesystem.
+AS_CASE(["$host_os"],
+ [cygwin*],[LINK_FILE=cp],
+ [LINK_FILE=ln])
+AC_SUBST([LINK_FILE])
+
dnl ----------------------------------------------------------
dnl FIND MAIL SPOOL AND SEE IF WE NEED TO MAKE inc SETGID MAIL
dnl ----------------------------------------------------------