threads / patch / 5120

patchadd NO_PERL_XS for environments which are not able to support perl extensions

Subject: [PATCH] add NO_PERL_XS for environments which are not able to support perl extensions

## tl;dr

4 messages between Aug 4, 2006 and Aug 8, 2006. Diffs are folded; open one to read it.

replies: 3people: 2as markdown or json

Alex Riesen· Aug 4, 2006, 13:40 UTC · lore

At the moment, the only known example of such environment is Cygwin with ActiveState Perl: Makefile, generated by the MakeMaker from ActiveState perl distribution is not usable by cygwin's gmake.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
---
 Makefile |   39 +++++++++++++++++++++++++++++++++------
 1 files changed, 33 insertions(+), 6 deletions(-)
From 259d3ab5925bdf42a2014a7dbf177de7b3ba9dc9 Mon Sep 17 00:00:00 2001
From: Alex Riesen <raa.lkml@gmail.com>
Date: Fri, 4 Aug 2006 15:31:58 +0200
Subject: [PATCH] add NO_PERL_XS for environments which are not able to support perl extensions

At the moment, the only known example of such environment is Cygwin with ActiveState Perl: Makefile, generated by the MakeMaker from ActiveState perl distribution is not usable by cygwin's gmake.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
---
 Makefile |   39 +++++++++++++++++++++++++++++++++------
 1 files changed, 33 insertions(+), 6 deletions(-)
Show changes to Makefile +33 −6
diff --git a/Makefile b/Makefile
index d662bd6..9cfd677 100644
--- a/Makefile
+++ b/Makefile
@@ -173,16 +173,19 @@ SCRIPT_SH = \
 
 SCRIPT_PERL = \
 	git-archimport.perl git-cvsimport.perl git-relink.perl \
-	git-shortlog.perl git-rerere.perl \
-	git-annotate.perl git-cvsserver.perl \
-	git-svnimport.perl git-cvsexportcommit.perl \
-	git-send-email.perl git-svn.perl
+	git-shortlog.perl git-rerere.perl git-cvsserver.perl \
+	git-svnimport.perl git-cvsexportcommit.perl git-svn.perl
+
+SCRIPT_XS_PERL = \
+	git-annotate.perl \
+	git-send-email.perl
 
 SCRIPT_PYTHON = \
 	git-merge-recursive.py
 
 SCRIPTS = $(patsubst %.sh,%,$(SCRIPT_SH)) \
 	  $(patsubst %.perl,%,$(SCRIPT_PERL)) \
+	  $(patsubst %.perl,%,$(SCRIPT_XS_PERL)) \
 	  $(patsubst %.py,%,$(SCRIPT_PYTHON)) \
 	  git-cherry-pick git-status git-instaweb
 
@@ -550,6 +553,9 @@ endif
 ifdef NO_ACCURATE_DIFF
 	BASIC_CFLAGS += -DNO_ACCURATE_DIFF
 endif
+ifdef NO_PERL_XS
+	SCRIPT_XS_PERL =
+endif
 
 # Shell quote (do not use $(call) to accommodate ancient setups);
 
@@ -581,9 +587,13 @@ ### Build rules
 
 all: $(ALL_PROGRAMS) $(BUILT_INS) git$X gitk gitweb/gitweb.cgi
 
+all:
+	$(MAKE) -C templates
+
+ifndef NO_PERL_XS
 all: perl/Makefile
 	$(MAKE) -C perl
-	$(MAKE) -C templates
+endif
 
 strip: $(PROGRAMS) git$X
 	$(STRIP) $(STRIP_OPTS) $(PROGRAMS) git$X
@@ -613,9 +623,18 @@ common-cmds.h: Documentation/git-*.txt
 	chmod +x $@+
 	mv $@+ $@
 
-$(patsubst %.perl,%,$(SCRIPT_PERL)): perl/Makefile
 $(patsubst %.perl,%,$(SCRIPT_PERL)): % : %.perl
 	rm -f $@ $@+
+	sed -e '1s|#!.*perl|#!$(PERL_PATH_SQ)|' \
+	    -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
+	    $@.perl >$@+
+	chmod +x $@+
+	mv $@+ $@
+
+ifndef NO_PERL_XS
+$(patsubst %.perl,%,$(SCRIPT_XS_PERL)): perl/Makefile
+$(patsubst %.perl,%,$(SCRIPT_XS_PERL)): % : %.perl
+	rm -f $@ $@+
 	INSTLIBDIR=`$(MAKE) -C perl -s --no-print-directory instlibdir` && \
 	sed -e '1{' \
 	    -e '	s|#!.*perl|#!$(PERL_PATH_SQ)|' \
@@ -629,6 +648,7 @@ common-cmds.h: Documentation/git-*.txt
 	    $@.perl >$@+
 	chmod +x $@+
 	mv $@+ $@
+endif
 
 $(patsubst %.py,%,$(SCRIPT_PYTHON)) : % : %.py GIT-CFLAGS
 	rm -f $@ $@+
@@ -681,6 +701,7 @@ # These can record GIT_VERSION
 git$X git.spec \
 	$(patsubst %.sh,%,$(SCRIPT_SH)) \
 	$(patsubst %.perl,%,$(SCRIPT_PERL)) \
+	$(patsubst %.perl,%,$(SCRIPT_XS_PERL)) \
 	$(patsubst %.py,%,$(SCRIPT_PYTHON)) \
 	: GIT-VERSION-FILE
 
@@ -747,6 +768,7 @@ XDIFF_OBJS=xdiff/xdiffi.o xdiff/xprepare
 	rm -f $@ && $(AR) rcs $@ $(XDIFF_OBJS)
 
 
+ifndef NO_PERL_XS
 PERL_DEFINE = $(BASIC_CFLAGS) -DGIT_VERSION='"$(GIT_VERSION)"'
 PERL_DEFINE_SQ = $(subst ','\'',$(PERL_DEFINE))
 PERL_LIBS = $(BASIC_LDFLAGS) $(EXTLIBS)
@@ -756,6 +778,7 @@ perl/Makefile: perl/Git.pm perl/Makefile
 		PREFIX='$(prefix_SQ)' \
 		DEFINE='$(PERL_DEFINE_SQ)' \
 		LIBS='$(PERL_LIBS_SQ)')
+endif
 
 doc:
 	$(MAKE) -C Documentation all
@@ -819,7 +842,9 @@ install: all
 	$(INSTALL) $(ALL_PROGRAMS) '$(DESTDIR_SQ)$(gitexecdir_SQ)'
 	$(INSTALL) git$X gitk '$(DESTDIR_SQ)$(bindir_SQ)'
 	$(MAKE) -C templates DESTDIR='$(DESTDIR_SQ)' install
+ifndef NO_PERL_XS
 	$(MAKE) -C perl install
+endif
 	$(INSTALL) -d -m755 '$(DESTDIR_SQ)$(GIT_PYTHON_DIR_SQ)'
 	$(INSTALL) $(PYMODULES) '$(DESTDIR_SQ)$(GIT_PYTHON_DIR_SQ)'
 	if test 'z$(bindir_SQ)' != 'z$(gitexecdir_SQ)'; \
@@ -890,8 +915,10 @@ clean:
 	rm -f $(htmldocs).tar.gz $(manpages).tar.gz
 	rm -f gitweb/gitweb.cgi
 	$(MAKE) -C Documentation/ clean
+ifndef NO_PERL_XS
 	[ ! -f perl/Makefile ] || $(MAKE) -C perl/ clean || $(MAKE) -C perl/ clean
 	rm -f perl/ppport.h perl/Makefile.old
+endif
 	$(MAKE) -C templates/ clean
 	$(MAKE) -C t/ clean
 	rm -f GIT-VERSION-FILE GIT-CFLAGS
-- 
1.4.2.rc2.g6534
Alex Riesen· Aug 4, 2006, 14:02 UTC · re: Alex Riesen · lore

Re: [PATCH] add NO_PERL_XS for environments which are not able to support perl extensions

On 8/4/06, Alex Riesen <raa.lkml@gmail.com> wrote:
> At the moment, the only known example of such environment is Cygwin with
> ActiveState Perl: Makefile, generated by the MakeMaker from ActiveState perl
> distribution is not usable by cygwin's gmake.
>

Damn. Please add attached patch on top of the previous one. I broke the normal, xs-supported, platforms.

Show changes to Makefile +6 −2
diff --git a/Makefile b/Makefile
index 9cfd677..5d58eca 100644
--- a/Makefile
+++ b/Makefile
@@ -591,7 +591,9 @@ all:
 	$(MAKE) -C templates

 ifndef NO_PERL_XS
-all: perl/Makefile
+.PHONY: perl-dir
+all: perl-dir
+perl-dir: perl/Makefile
 	$(MAKE) -C perl
 endif


From ff9c9341341d88b1d3ef55141cab14db45d55cf7 Mon Sep 17 00:00:00 2001
From: Alex Riesen <raa.lkml@gmail.com>
Date: Fri, 4 Aug 2006 15:59:11 +0200
Subject: [PATCH] fix dependencies for xs-supported platforms

Signed-off-by: Alex Riesen <ariesen@harmanbecker.com>
---
 Makefile |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/Makefile b/Makefile
index 9cfd677..5d58eca 100644
--- a/Makefile
+++ b/Makefile
@@ -591,7 +591,9 @@ all:
 	$(MAKE) -C templates
 
 ifndef NO_PERL_XS
-all: perl/Makefile
+.PHONY: perl-dir
+all: perl-dir
+perl-dir: perl/Makefile
 	$(MAKE) -C perl
 endif
 
-- 
1.4.2.rc2.g6534
Junio C Hamano· Aug 4, 2006, 17:56 UTC · re: Alex Riesen · lore

Re: [PATCH] add NO_PERL_XS for environments which are not able to support perl extensions

"Alex Riesen" <raa.lkml@gmail.com> writes:
> On 8/4/06, Alex Riesen <raa.lkml@gmail.com> wrote:
>> At the moment, the only known example of such environment is Cygwin with
>> ActiveState Perl: Makefile, generated by the MakeMaker from ActiveState perl
>> distribution is not usable by cygwin's gmake.

I'd rather see Git.pm to have an option to emulate what it does using Git.xs layer without it, to keep the upper layer of programs still usable.

Alex Riesen· Aug 8, 2006, 12:03 UTC · re: Junio C Hamano · lore

Re: [PATCH] add NO_PERL_XS for environments which are not able to support perl extensions

On 8/4/06, Junio C Hamano <junkio@cox.net> wrote:
Show 8 quoted lines
> >> At the moment, the only known example of such environment is Cygwin with
> >> ActiveState Perl: Makefile, generated by the MakeMaker from ActiveState perl
> >> distribution is not usable by cygwin's gmake.
>
> I'd rather see Git.pm to have an option to emulate what it does
> using Git.xs layer without it, to keep the upper layer of
> programs still usable.
>
Wont work until MakeMaker is used.

← back to recent threads