summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Johannes Schindelin <Johannes.Schindelin@gmx.de>2009-05-11 13:02:18 +0200
committerLibravatar Junio C Hamano <gitster@pobox.com>2009-05-13 20:35:36 -0700
commit3426e34feddf97085615e619d39f8173ff3f9fb4 (patch)
tree112294704f66e5a3d0930bd3434fc80931b5bf80
parentGIT 1.6.2 (diff)
downloadtgif-3426e34feddf97085615e619d39f8173ff3f9fb4.tar.xz
Add NO_CROSS_DIRECTORY_HARDLINKS support to the Makefile
When the installed programs are tar'ed up and installed on a system where bin/ and libexec/git-core/ live on different file systems, we do not want libexec/git-core/git-* to be hardlinks to bin/git. Noticed by Cedric Staniewski. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--Makefile4
1 files changed, 4 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 0675c43e73..2b8ce48c0c 100644
--- a/Makefile
+++ b/Makefile
@@ -159,6 +159,9 @@ all::
# Define NO_EXTERNAL_GREP if you don't want "git grep" to ever call
# your external grep (e.g., if your system lacks grep, if its grep is
# broken, or spawning external process is slower than built-in grep git has).
+#
+# Define NO_CROSS_DIRECTORY_HARDLINKS if you plan to distribute the installed
+# programs as a tar, where bin/ and libexec/ might be on different file systems.
GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE
@$(SHELL_PATH) ./GIT-VERSION-GEN
@@ -1468,6 +1471,7 @@ endif
bindir=$$(cd '$(DESTDIR_SQ)$(bindir_SQ)' && pwd) && \
execdir=$$(cd '$(DESTDIR_SQ)$(gitexec_instdir_SQ)' && pwd) && \
{ $(RM) "$$execdir/git-add$X" && \
+ test -z "$(NO_CROSS_DIRECTORY_HARDLINKS)" && \
ln "$$bindir/git$X" "$$execdir/git-add$X" 2>/dev/null || \
cp "$$bindir/git$X" "$$execdir/git-add$X"; } && \
{ for p in $(filter-out git-add$X,$(BUILT_INS)); do \