Add Python version checks to the Makefile to automatically set WITH_OWN_SUBPROCESS_PY
Also rearrange some path settings in the Makefile in the process. Signed-off-by: Ryan Anderson <ryan@michonline.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
Ryan Anderson committed
Nov 21, 2005 at 00:11 UTC
3d32051f4fd657747de00cb9d516dc3512bb377d
1 file changed
+15
-10
Makefile
+15
-10
@@ -133,11 +133,26 @@ PROGRAMS += git-ssh-pull$X git-ssh-push$X
133
134
GIT_LIST_TWEAK =
135
136
+# Set paths to tools early so that they can be used for version tests.
137
+ifndef SHELL_PATH
138
+ SHELL_PATH = /bin/sh
139
+endif
140
+ifndef PERL_PATH
141
+ PERL_PATH = /usr/bin/perl
142
+endif
143
+ifndef PYTHON_PATH
144
+ PYTHON_PATH = /usr/bin/python
145
+endif
146
+
147
PYMODULES = \
148
gitMergeCommon.py
149
150
ifdef WITH_OWN_SUBPROCESS_PY
151
PYMODULES += compat/subprocess.py
152
+else
153
+ ifneq ($(shell $(PYTHON_PATH) -c 'import subprocess;print"OK"' 2>/dev/null),OK)
154
+ PYMODULES += compat/subprocess.py
155
+ endif
156
endif
157
158
ifdef WITH_SEND_EMAIL
@@ -252,16 +267,6 @@ ifndef NO_CURL
267
endif
268
endif
269
255
-ifndef SHELL_PATH
256
- SHELL_PATH = /bin/sh
257
-endif
258
-ifndef PERL_PATH
259
- PERL_PATH = /usr/bin/perl
260
-endif
261
-ifndef PYTHON_PATH
262
- PYTHON_PATH = /usr/bin/python
263
-endif
264
-
270
ifndef NO_OPENSSL
271
LIB_OBJS += epoch.o
272
OPENSSL_LIBSSL = -lssl