Merge branch 'jk/no-perl'

* jk/no-perl:
  tests: skip perl tests if NO_PERL is defined
  Makefile: allow building without perl
This commit is contained in:
Junio C Hamano 2009-04-12 16:46:42 -07:00
commit 6f523f6d38
13 changed files with 77 additions and 4 deletions

View file

@ -145,6 +145,8 @@ all::
# Define NO_PERL_MAKEMAKER if you cannot use Makefiles generated by perl's
# MakeMaker (e.g. using ActiveState under Cygwin).
#
# Define NO_PERL if you do not want Perl scripts or libraries at all.
#
# Define NO_TCLTK if you do not want Tcl/Tk GUI.
#
# The TCL_PATH variable governs the location of the Tcl interpreter
@ -353,7 +355,10 @@ BUILT_INS += git-whatchanged$X
ALL_PROGRAMS = $(PROGRAMS) $(SCRIPTS)
# what 'all' will build but not install in gitexecdir
OTHER_PROGRAMS = git$X gitweb/gitweb.cgi
OTHER_PROGRAMS = git$X
ifndef NO_PERL
OTHER_PROGRAMS += gitweb/gitweb.cgi
endif
# Set paths to tools early so that they can be used for version tests.
ifndef SHELL_PATH
@ -1106,6 +1111,10 @@ ifeq ($(TCLTK_PATH),)
NO_TCLTK=NoThanks
endif
ifeq ($(PERL_PATH),)
NO_PERL=NoThanks
endif
QUIET_SUBDIR0 = +$(MAKE) -C # space to separate -C and subdir
QUIET_SUBDIR1 =
@ -1180,7 +1189,9 @@ ifndef NO_TCLTK
$(QUIET_SUBDIR0)git-gui $(QUIET_SUBDIR1) gitexecdir='$(gitexec_instdir_SQ)' all
$(QUIET_SUBDIR0)gitk-git $(QUIET_SUBDIR1) all
endif
ifndef NO_PERL
$(QUIET_SUBDIR0)perl $(QUIET_SUBDIR1) PERL_PATH='$(PERL_PATH_SQ)' prefix='$(prefix_SQ)' all
endif
$(QUIET_SUBDIR0)templates $(QUIET_SUBDIR1)
please_set_SHELL_PATH_to_a_more_modern_shell:
@ -1228,6 +1239,7 @@ $(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.sh
chmod +x $@+ && \
mv $@+ $@
ifndef NO_PERL
$(patsubst %.perl,%,$(SCRIPT_PERL)): perl/perl.mak
perl/perl.mak: GIT-CFLAGS perl/Makefile perl/Makefile.PL
@ -1287,6 +1299,15 @@ git-instaweb: git-instaweb.sh gitweb/gitweb.cgi gitweb/gitweb.css
$@.sh > $@+ && \
chmod +x $@+ && \
mv $@+ $@
else # NO_PERL
$(patsubst %.perl,%,$(SCRIPT_PERL)) git-instaweb: % : unimplemented.sh
$(QUIET_GEN)$(RM) $@ $@+ && \
sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
-e 's|@@REASON@@|NO_PERL=$(NO_PERL)|g' \
unimplemented.sh >$@+ && \
chmod +x $@+ && \
mv $@+ $@
endif # NO_PERL
configure: configure.ac
$(QUIET_GEN)$(RM) $@ $<+ && \
@ -1403,6 +1424,7 @@ GIT-BUILD-OPTIONS: .FORCE-GIT-BUILD-OPTIONS
@echo SHELL_PATH=\''$(subst ','\'',$(SHELL_PATH_SQ))'\' >$@
@echo TAR=\''$(subst ','\'',$(subst ','\'',$(TAR)))'\' >>$@
@echo NO_CURL=\''$(subst ','\'',$(subst ','\'',$(NO_CURL)))'\' >>$@
@echo NO_PERL=\''$(subst ','\'',$(subst ','\'',$(NO_PERL)))'\' >>$@
### Detect Tck/Tk interpreter path changes
ifndef NO_TCLTK
@ -1605,9 +1627,11 @@ clean:
$(RM) -r $(GIT_TARNAME) .doc-tmp-dir
$(RM) $(GIT_TARNAME).tar.gz git-core_$(GIT_VERSION)-*.tar.gz
$(RM) $(htmldocs).tar.gz $(manpages).tar.gz
$(RM) gitweb/gitweb.cgi
$(MAKE) -C Documentation/ clean
ifndef NO_PERL
$(RM) gitweb/gitweb.cgi
$(MAKE) -C perl clean
endif
$(MAKE) -C templates/ clean
$(MAKE) -C t/ clean
ifndef NO_TCLTK

View file

@ -8,6 +8,10 @@ then
say 'skipping git svn tests, NO_SVN_TESTS defined'
test_done
fi
if ! test_have_prereq PERL; then
say 'skipping git svn tests, perl not available'
test_done
fi
GIT_DIR=$PWD/.git
GIT_SVN_DIR=$GIT_DIR/svn/git-svn

View file

@ -3,6 +3,11 @@
test_description='add -i basic tests'
. ./test-lib.sh
if ! test_have_prereq PERL; then
say 'skipping git add -i tests, perl not available'
test_done
fi
test_expect_success 'setup (initial)' '
echo content >file &&
git add file &&

View file

@ -38,7 +38,7 @@ test_expect_success \
"echo King of the bongo >file &&
test_must_fail git commit -m foo -a file"
test_expect_success \
test_expect_success PERL \
"using paths with --interactive" \
"echo bong-o-bong >file &&
! (echo 7 | git commit -m foo --interactive file)"
@ -119,7 +119,7 @@ test_expect_success \
"echo 'gak' >file && \
git commit -m 'author' --author 'Rubber Duck <rduck@convoy.org>' -a"
test_expect_success \
test_expect_success PERL \
"interactive add" \
"echo 7 | git commit --interactive | grep 'What now'"

View file

@ -3,6 +3,11 @@
test_description='git send-email'
. ./test-lib.sh
if ! test_have_prereq PERL; then
say 'skipping git send-email tests, perl not available'
test_done
fi
PROG='git send-email'
test_expect_success \
'prepare reference tree' \

View file

@ -6,6 +6,11 @@ test_description='Test export of commits to CVS'
. ./test-lib.sh
if ! test_have_prereq PERL; then
say 'skipping git cvsexportcommit tests, perl not available'
test_done
fi
cvs >/dev/null 2>&1
if test $? -ne 1
then

View file

@ -10,6 +10,10 @@ cvs CLI client via git-cvsserver server'
. ./test-lib.sh
if ! test_have_prereq PERL; then
say 'skipping git cvsserver tests, perl not available'
test_done
fi
cvs >/dev/null 2>&1
if test $? -ne 1
then

View file

@ -52,6 +52,11 @@ then
say 'skipping git-cvsserver tests, cvs not found'
test_done
fi
if ! test_have_prereq PERL
then
say 'skipping git-cvsserver tests, perl not available'
test_done
fi
perl -e 'use DBI; use DBD::SQLite' >/dev/null 2>&1 || {
say 'skipping git-cvsserver tests, Perl SQLite interface unavailable'
test_done

View file

@ -65,6 +65,11 @@ gitweb_run () {
. ./test-lib.sh
if ! test_have_prereq PERL; then
say 'skipping gitweb tests, perl not available'
test_done
fi
perl -MEncode -e 'decode_utf8("", Encode::FB_CROAK)' >/dev/null 2>&1 || {
say 'skipping gitweb tests, perl version is too old'
test_done

View file

@ -3,6 +3,11 @@
test_description='git cvsimport basic tests'
. ./test-lib.sh
if ! test_have_prereq PERL; then
say 'skipping git cvsimport tests, perl not available'
test_done
fi
CVSROOT=$(pwd)/cvsroot
export CVSROOT
unset CVS_SERVER

View file

@ -6,6 +6,11 @@
test_description='perl interface (Git.pm)'
. ./test-lib.sh
if ! test_have_prereq PERL; then
say 'skipping perl interface tests, perl not available'
test_done
fi
perl -MTest::More -e 0 2>/dev/null || {
say "Perl Test::More unavailable, skipping test"
test_done

View file

@ -698,6 +698,8 @@ case $(uname -s) in
;;
esac
test -z "$NO_PERL" && test_set_prereq PERL
# test whether the filesystem supports symbolic links
ln -s x y 2>/dev/null && test -h y 2>/dev/null && test_set_prereq SYMLINKS
rm -f y

4
unimplemented.sh Normal file
View file

@ -0,0 +1,4 @@
#!/bin/sh
echo >&2 "fatal: git was built without support for `basename $0` (@@REASON@@)."
exit 128