Merge branch 'jk/no-perl'
authorJunio C Hamano <gitster@pobox.com>
Sun, 12 Apr 2009 23:46:42 +0000 (16:46 -0700)
committerJunio C Hamano <gitster@pobox.com>
Sun, 12 Apr 2009 23:46:42 +0000 (16:46 -0700)
* jk/no-perl:
tests: skip perl tests if NO_PERL is defined
Makefile: allow building without perl

1  2 
Makefile
diff --combined Makefile
index d8cd0111465ba371e990777f38959a9ec2913f27,a865a460538f8e3c758766a947b9e8d1b1628f64..7c8763710c12350589e9a39815c8ad34a5054c37
+++ b/Makefile
@@@ -145,6 -145,8 +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 +355,10 @@@ BUILT_INS += git-whatchanged$
  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
@@@ -432,7 -437,6 +437,7 @@@ LIB_OBJS += archive-tar.
  LIB_OBJS += archive-zip.o
  LIB_OBJS += attr.o
  LIB_OBJS += base85.o
 +LIB_OBJS += bisect.o
  LIB_OBJS += blob.o
  LIB_OBJS += branch.o
  LIB_OBJS += bundle.o
@@@ -533,7 -537,6 +538,7 @@@ BUILTIN_OBJS += builtin-add.
  BUILTIN_OBJS += builtin-annotate.o
  BUILTIN_OBJS += builtin-apply.o
  BUILTIN_OBJS += builtin-archive.o
 +BUILTIN_OBJS += builtin-bisect--helper.o
  BUILTIN_OBJS += builtin-blame.o
  BUILTIN_OBJS += builtin-branch.o
  BUILTIN_OBJS += builtin-bundle.o
@@@ -1106,6 -1109,10 +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 -1187,9 +1189,9 @@@ ifndef NO_TCLT
        $(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 -1237,7 +1239,7 @@@ $(patsubst %.sh,%,$(SCRIPT_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 -1297,15 +1299,15 @@@ git-instaweb: git-instaweb.sh gitweb/gi
            $@.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 -1422,7 +1424,7 @@@ GIT-BUILD-OPTIONS: .FORCE-GIT-BUILD-OPT
        @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 -1625,11 +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