Skip to content

Commit 3426e34

Browse files
dschogitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent a95148d commit 3426e34

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,9 @@ all::
159159
# Define NO_EXTERNAL_GREP if you don't want "git grep" to ever call
160160
# your external grep (e.g., if your system lacks grep, if its grep is
161161
# broken, or spawning external process is slower than built-in grep git has).
162+
#
163+
# Define NO_CROSS_DIRECTORY_HARDLINKS if you plan to distribute the installed
164+
# programs as a tar, where bin/ and libexec/ might be on different file systems.
162165

163166
GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE
164167
@$(SHELL_PATH) ./GIT-VERSION-GEN
@@ -1468,6 +1471,7 @@ endif
14681471
bindir=$$(cd '$(DESTDIR_SQ)$(bindir_SQ)' && pwd) && \
14691472
execdir=$$(cd '$(DESTDIR_SQ)$(gitexec_instdir_SQ)' && pwd) && \
14701473
{ $(RM) "$$execdir/git-add$X" && \
1474+
test -z "$(NO_CROSS_DIRECTORY_HARDLINKS)" && \
14711475
ln "$$bindir/git$X" "$$execdir/git-add$X" 2>/dev/null || \
14721476
cp "$$bindir/git$X" "$$execdir/git-add$X"; } && \
14731477
{ for p in $(filter-out git-add$X,$(BUILT_INS)); do \

0 commit comments

Comments
 (0)