Fix build on systems where "python" is python 3.
authorKenneth Graunke <kenneth@whitecape.org>
Mon, 25 Oct 2010 20:52:58 +0000 (13:52 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Wed, 27 Oct 2010 19:49:53 +0000 (12:49 -0700)
First, it changes autoconf to use a "python2" binary when available,
rather than plain "python" (which is ambiguous).  Secondly, it changes
the Makefiles to use $(PYTHON) $(PYTHON_FLAGS) rather than calling
python directly.

Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
Signed-off-by: Matthew William Cox <matt@mattcox.ca>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
configs/autoconf.in
configure.ac
src/gallium/auxiliary/Makefile
src/gallium/drivers/llvmpipe/Makefile
src/glsl/Makefile
src/mesa/drivers/dri/common/xmlpool/Makefile

index 9bdbefebddd9edffaeb82196a99bb631e5330f08..e2d70c63a12084deafd3843e4caaa643b7eb18a8 100644 (file)
@@ -53,7 +53,7 @@ MKDEP_OPTIONS = @MKDEP_OPTIONS@
 INSTALL = @INSTALL@
 
 # Python and flags (generally only needed by the developers)
-PYTHON2 = python
+PYTHON2 = @PYTHON2@
 PYTHON_FLAGS = -t -O -O
 
 # Library names (base name)
index 364ee0394703c38d5ef951f1915449a250a0340f..d6f15b5c346d43ee7d5b15fffafb16cc0f92cb28 100644 (file)
@@ -30,6 +30,7 @@ AC_PROG_CPP
 AC_PROG_CC
 AC_PROG_CXX
 AC_CHECK_PROGS([MAKE], [gmake make])
+AC_CHECK_PROGS([PYTHON2], [python2 python])
 AC_PATH_PROG([MKDEP], [makedepend])
 AC_PATH_PROG([SED], [sed])
 
@@ -1691,6 +1692,8 @@ echo ""
 echo "        CFLAGS:          $cflags"
 echo "        CXXFLAGS:        $cxxflags"
 echo "        Macros:          $defines"
+echo ""
+echo "        PYTHON2:         $PYTHON2"
 
 echo ""
 echo "        Run '${MAKE-make}' to build Mesa"
index abd33f6eef11c4462de01f5bfee1a48a482854e2..f37d59e9a3a38cd43677e6e83ef897cbdb1a898e 100644 (file)
@@ -211,16 +211,16 @@ include ../Makefile.template
 
 
 indices/u_indices_gen.c: indices/u_indices_gen.py
-       python $< > $@
+       $(PYTHON2) $< > $@
 
 indices/u_unfilled_gen.c: indices/u_unfilled_gen.py
-       python $< > $@
+       $(PYTHON2) $< > $@
 
 util/u_format_srgb.c: util/u_format_srgb.py
-       python $< > $@
+       $(PYTHON2) $< > $@
 
 util/u_format_table.c: util/u_format_table.py util/u_format_pack.py util/u_format_parse.py util/u_format.csv
-       python util/u_format_table.py util/u_format.csv > $@
+       $(PYTHON2) util/u_format_table.py util/u_format.csv > $@
 
 util/u_half.c: util/u_half.py
-       python util/u_half.py > $@
+       $(PYTHON2) util/u_half.py > $@
index 08da2286b05cf8f0beffbc26cae1d3fc52411165..669e42e3003cfabb6bf07d29f24330a619acac56 100644 (file)
@@ -69,7 +69,7 @@ lp_test_sincos.o : sse_mathfun.h
 PROGS_DEPS := ../../auxiliary/libgallium.a
 
 lp_tile_soa.c: lp_tile_soa.py ../../auxiliary/util/u_format_parse.py ../../auxiliary/util/u_format_pack.py ../../auxiliary/util/u_format.csv
-       python lp_tile_soa.py ../../auxiliary/util/u_format.csv > $@
+       $(PYTHON2) $(PYTHON_FLAGS) lp_tile_soa.py ../../auxiliary/util/u_format.csv > $@
 
 LDFLAGS += $(LLVM_LDFLAGS)
 LIBS += -L../../auxiliary/ -lgallium libllvmpipe.a $(LLVM_LIBS) $(GL_LIB_DEPS)
index 83869b1d846704cf34a10a130d1e3ab7ed5651b5..4cfecb130f2c3e62ebf7796fdeb60bb31a92924c 100644 (file)
@@ -178,7 +178,7 @@ builtins: builtin_function.cpp builtins/profiles/* builtins/ir/* builtins/tools/
        cp builtins/tools/builtin_function.cpp .
        make glsl_compiler
        @echo Regenerating builtin_function.cpp...
-       ./builtins/tools/generate_builtins.py > builtin_function.cpp
+       $(PYTHON2) $(PYTHON_FLAGS) builtins/tools/generate_builtins.py > builtin_function.cpp
        @echo Rebuilding the real compiler...
        make glsl_compiler
 
index 62ec919ea68c3e7113c327f208fa4032e7d6b80b..b71629e9f166a8cc97f2575cf5ec94d870e0bd3a 100644 (file)
@@ -62,7 +62,7 @@ clean:
 
 # Default target options.h
 options.h: t_options.h mo
-       python gen_xmlpool.py $(LANGS) > options.h
+       $(PYTHON2) $(PYTHON_FLAGS) gen_xmlpool.py $(LANGS) > options.h
 
 # Update .mo files from the corresponding .po files.
 mo: