Basic build infrastructure for Python scripts
This patch adds basic boilerplate support (based on corresponding Perl sections) for enabling the building and installation Python scripts. There are currently no Python scripts being built, and when Python scripts are added in future patches, their building and installation can be disabled by defining NO_PYTHON. Signed-off-by: Johan Herland <johan@herland.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Johan Herland committed
Nov 18, 2009 at 02:42 UTC
d4e1b47a922576e6af98cd84913471a6d3096ac0
3 files changed
+17
Makefile
+13
@@ -164,6 +164,8 @@ all::
164
#
165
# Define NO_PERL if you do not want Perl scripts or libraries at all.
166
#
167
+# Define NO_PYTHON if you do not want Python scripts or libraries at all.
168
+#
169
# Define NO_TCLTK if you do not want Tcl/Tk GUI.
170
#
171
# The TCL_PATH variable governs the location of the Tcl interpreter
@@ -308,6 +310,7 @@ LIB_H =
310
LIB_OBJS =
311
PROGRAMS =
312
SCRIPT_PERL =
313
+SCRIPT_PYTHON =
314
SCRIPT_SH =
315
TEST_PROGRAMS =
316
@@ -345,6 +348,7 @@ SCRIPT_PERL += git-svn.perl
348
349
SCRIPTS = $(patsubst %.sh,%,$(SCRIPT_SH)) \
350
$(patsubst %.perl,%,$(SCRIPT_PERL)) \
351
+ $(patsubst %.py,%,$(SCRIPT_PYTHON)) \
352
git-instaweb
353
354
# Empty...
@@ -398,8 +402,12 @@ endif
402
ifndef PERL_PATH
403
PERL_PATH = /usr/bin/perl
404
endif
405
+ifndef PYTHON_PATH
406
+ PYTHON_PATH = /usr/bin/python
407
+endif
408
409
export PERL_PATH
410
+export PYTHON_PATH
411
412
LIB_FILE=libgit.a
413
XDIFF_LIB=xdiff/lib.a
@@ -1308,6 +1316,10 @@ ifeq ($(PERL_PATH),)
1316
NO_PERL=NoThanks
1317
endif
1318
1319
+ifeq ($(PYTHON_PATH),)
1320
+NO_PYTHON=NoThanks
1321
+endif
1322
+
1323
QUIET_SUBDIR0 = +$(MAKE) -C # space to separate -C and subdir
1324
QUIET_SUBDIR1 =
1325
@@ -1355,6 +1367,7 @@ prefix_SQ = $(subst ','\'',$(prefix))
1367
1368
SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH))
1369
PERL_PATH_SQ = $(subst ','\'',$(PERL_PATH))
1370
+PYTHON_PATH_SQ = $(subst ','\'',$(PYTHON_PATH))
1371
TCLTK_PATH_SQ = $(subst ','\'',$(TCLTK_PATH))
1372
1373
LIBS = $(GITLIBS) $(EXTLIBS)
configure.ac
+3
@@ -233,6 +233,9 @@ GIT_ARG_SET_PATH(shell)
233
# Define PERL_PATH to provide path to Perl.
234
GIT_ARG_SET_PATH(perl)
235
#
236
+# Define PYTHON_PATH to provide path to Python.
237
+GIT_ARG_SET_PATH(python)
238
+#
239
# Define ZLIB_PATH to provide path to zlib.
240
GIT_ARG_SET_PATH(zlib)
241
#
t/test-lib.sh
+1
@@ -729,6 +729,7 @@ case $(uname -s) in
729
esac
730
731
test -z "$NO_PERL" && test_set_prereq PERL
732
+test -z "$NO_PYTHON" && test_set_prereq PYTHON
733
734
# test whether the filesystem supports symbolic links
735
ln -s x y 2>/dev/null && test -h y 2>/dev/null && test_set_prereq SYMLINKS