summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorElliott Hird <penguinofthegods@gmail.com>2011-12-14 20:43:19 (GMT)
committerElliott Hird <penguinofthegods@gmail.com>2011-12-14 20:46:55 (GMT)
commit121f36d59f293263b9a27d01a8112de17978c5d1 (patch)
tree85e4e34d377bfc2e3580c1743784ce78dd462c22
parent283282d6123a49c50efc6382e8082ced6bf6d268 (diff)
downloadNinja-121f36d59f293263b9a27d01a8112de17978c5d1.zip
Ninja-121f36d59f293263b9a27d01a8112de17978c5d1.tar.gz
Ninja-121f36d59f293263b9a27d01a8112de17978c5d1.tar.bz2
Support non-standard Python executable names
Closes #154.
-rwxr-xr-xconfigure.py8
-rw-r--r--src/browse.cc2
2 files changed, 7 insertions, 3 deletions
diff --git a/configure.py b/configure.py
index 0267290..4c49f40 100755
--- a/configure.py
+++ b/configure.py
@@ -39,6 +39,9 @@ parser.add_option('--profile', metavar='TYPE',
help='enable profiling (' + '/'.join(profilers) + ')',)
parser.add_option('--with-gtest', metavar='PATH',
help='use gtest built in directory PATH')
+parser.add_option('--with-python', metavar='EXE',
+ help='use EXE as the Python interpreter',
+ default=os.path.basename(sys.executable))
(options, args) = parser.parse_args()
platform = options.platform
@@ -79,7 +82,8 @@ cflags = ['-g', '-Wall', '-Wextra',
'-Wno-deprecated',
'-Wno-unused-parameter',
'-fno-exceptions',
- '-fvisibility=hidden', '-pipe']
+ '-fvisibility=hidden', '-pipe',
+ "'-DNINJA_PYTHON=\"%s\"'" % (options.with_python,)]
if not options.debug:
cflags += ['-O2', '-DNDEBUG']
ldflags = ['-L$builddir']
@@ -250,7 +254,7 @@ n.newline()
if platform != 'mingw':
n.comment('Regenerate build files if build script changes.')
n.rule('configure',
- command='./configure.py $configure_args',
+ command=options.with_python + ' configure.py $configure_args',
generator=True)
n.build('build.ninja', 'configure',
implicit=['configure.py', 'misc/ninja_syntax.py'])
diff --git a/src/browse.cc b/src/browse.cc
index bab3f36..83bfe43 100644
--- a/src/browse.cc
+++ b/src/browse.cc
@@ -46,7 +46,7 @@ void RunBrowsePython(State* state, const char* ninja_command,
// exec Python, telling it to run the program from stdin.
const char* command[] = {
- "python", "-", ninja_command, initial_target, NULL
+ NINJA_PYTHON, "-", ninja_command, initial_target, NULL
};
execvp(command[0], (char**)command);
perror("ninja: execvp");