Skip to content

Commit 128c5d0

Browse files
committed
Merge branch 'jn/perl-lib-extra'
Allow customizing the paths to Perl modules with the new PERLLIB_EXTRA makefile variable. * jn/perl-lib-extra: Makefile: add PERLLIB_EXTRA variable that adds to default perl path Makefile: rebuild perl scripts when perl paths change
2 parents b00d244 + 0386dd3 commit 128c5d0

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
/GIT-CFLAGS
33
/GIT-LDFLAGS
44
/GIT-PREFIX
5+
/GIT-PERL-DEFINES
56
/GIT-PYTHON-VARS
67
/GIT-SCRIPT-DEFINES
78
/GIT-USER-AGENT

Makefile

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1588,6 +1588,7 @@ PERL_PATH_SQ = $(subst ','\'',$(PERL_PATH))
15881588
PYTHON_PATH_SQ = $(subst ','\'',$(PYTHON_PATH))
15891589
TCLTK_PATH_SQ = $(subst ','\'',$(TCLTK_PATH))
15901590
DIFF_SQ = $(subst ','\'',$(DIFF))
1591+
PERLLIB_EXTRA_SQ = $(subst ','\'',$(PERLLIB_EXTRA))
15911592

15921593
LIBS = $(GITLIBS) $(EXTLIBS)
15931594

@@ -1792,9 +1793,12 @@ perl/PM.stamp: FORCE
17921793
perl/perl.mak: GIT-CFLAGS GIT-PREFIX perl/Makefile perl/Makefile.PL
17931794
$(QUIET_SUBDIR0)perl $(QUIET_SUBDIR1) PERL_PATH='$(PERL_PATH_SQ)' prefix='$(prefix_SQ)' $(@F)
17941795

1795-
$(patsubst %.perl,%,$(SCRIPT_PERL)): % : %.perl GIT-VERSION-FILE
1796+
PERL_DEFINES = $(PERL_PATH_SQ):$(PERLLIB_EXTRA_SQ)
1797+
$(patsubst %.perl,%,$(SCRIPT_PERL)): % : %.perl perl/perl.mak GIT-PERL-DEFINES GIT-VERSION-FILE
17961798
$(QUIET_GEN)$(RM) $@ $@+ && \
17971799
INSTLIBDIR=`MAKEFLAGS= $(MAKE) -C perl -s --no-print-directory instlibdir` && \
1800+
INSTLIBDIR_EXTRA='$(PERLLIB_EXTRA_SQ)' && \
1801+
INSTLIBDIR="$$INSTLIBDIR$${INSTLIBDIR_EXTRA:+:$$INSTLIBDIR_EXTRA}" && \
17981802
sed -e '1{' \
17991803
-e ' s|#!.*perl|#!$(PERL_PATH_SQ)|' \
18001804
-e ' h' \
@@ -1807,6 +1811,13 @@ $(patsubst %.perl,%,$(SCRIPT_PERL)): % : %.perl GIT-VERSION-FILE
18071811
chmod +x $@+ && \
18081812
mv $@+ $@
18091813

1814+
GIT-PERL-DEFINES: FORCE
1815+
@FLAGS='$(PERL_DEFINES)'; \
1816+
if test x"$$FLAGS" != x"`cat $@ 2>/dev/null`" ; then \
1817+
echo >&2 " * new perl-specific parameters"; \
1818+
echo "$$FLAGS" >$@; \
1819+
fi
1820+
18101821

18111822
.PHONY: gitweb
18121823
gitweb:
@@ -2494,7 +2505,8 @@ ifndef NO_TCLTK
24942505
$(MAKE) -C git-gui clean
24952506
endif
24962507
$(RM) GIT-VERSION-FILE GIT-CFLAGS GIT-LDFLAGS GIT-BUILD-OPTIONS
2497-
$(RM) GIT-USER-AGENT GIT-PREFIX GIT-SCRIPT-DEFINES GIT-PYTHON-VARS
2508+
$(RM) GIT-USER-AGENT GIT-PREFIX
2509+
$(RM) GIT-SCRIPT-DEFINES GIT-PERL-DEFINES GIT-PYTHON-VARS
24982510

24992511
.PHONY: all install profile-clean clean strip
25002512
.PHONY: shell_compatibility_test please_set_SHELL_PATH_to_a_more_modern_shell

0 commit comments

Comments
 (0)