aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2016-01-16 00:04:57 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2016-01-16 00:04:57 +0200
commit4c31e7774d09fe1a59b6cfd692de4f4cade1899c (patch)
tree9bbe3c9d0e1f7da9409345ff05da30df331d26ca
parent66c01401deb186e6daa20cf4bf6a098076dda236 (diff)
downloadmeson-4c31e7774d09fe1a59b6cfd692de4f4cade1899c.zip
meson-4c31e7774d09fe1a59b6cfd692de4f4cade1899c.tar.gz
meson-4c31e7774d09fe1a59b6cfd692de4f4cade1899c.tar.bz2
Finalize moduleification so that full test suite runs.
-rw-r--r--meson/interpreter.py12
-rw-r--r--meson/mesonmain.py7
-rw-r--r--meson/ninjabackend.py13
-rw-r--r--meson/scripts/meson_install.py2
-rwxr-xr-xrun_cross_test.py4
-rwxr-xr-xrun_tests.py8
6 files changed, 31 insertions, 15 deletions
diff --git a/meson/interpreter.py b/meson/interpreter.py
index 5ce2f8d..1a28f3f 100644
--- a/meson/interpreter.py
+++ b/meson/interpreter.py
@@ -1610,9 +1610,17 @@ class Interpreter():
regex_selector = vcs['rev_regex']
else:
vcs_cmd = [' '] # executing this cmd will fail in vcstagger.py and force to use the fallback string
- scriptfile = os.path.join(self.environment.get_script_dir(), 'vcstagger.py')
# vcstagger.py parameters: infile, outfile, fallback, source_dir, replace_string, regex_selector, command...
- kwargs['command'] = [sys.executable, scriptfile, '@INPUT0@', '@OUTPUT0@', fallback, source_dir, replace_string, regex_selector] + vcs_cmd
+ kwargs['command'] = [sys.executable,
+ self.environment.get_build_command(),
+ '--internal',
+ 'vcstagger',
+ '@INPUT0@',
+ '@OUTPUT0@',
+ fallback,
+ source_dir,
+ replace_string,
+ regex_selector] + vcs_cmd
kwargs.setdefault('build_always', True)
return self.func_custom_target(node, [kwargs['output']], kwargs)
diff --git a/meson/mesonmain.py b/meson/mesonmain.py
index 58ba06b..7b4f2c2 100644
--- a/meson/mesonmain.py
+++ b/meson/mesonmain.py
@@ -172,12 +172,18 @@ def run_script_command(args):
elif cmdname == 'benchmark':
import meson.scripts.meson_benchmark as abc
cmdfunc = abc.run
+ elif cmdname == 'install':
+ import meson.scripts.meson_install as abc
+ cmdfunc = abc.run
elif cmdname == 'commandrunner':
import meson.scripts.commandrunner as abc
cmdfunc = abc.run
elif cmdname == 'delsuffix':
import meson.scripts.delwithsuffix as abc
cmdfunc = abc.run
+ elif cmdname == 'depfixer':
+ import meson.scripts.depfixer as abc
+ cmdfunc = abc.run
elif cmdname == 'dirchanger':
import meson.scripts.dirchanger as abc
cmdfunc = abc.run
@@ -210,7 +216,6 @@ def run(mainfile, args):
handshake = True
else:
handshake = False
- print(args)
args = mesonlib.expand_arguments(args)
if not args:
return 1
diff --git a/meson/ninjabackend.py b/meson/ninjabackend.py
index 80c94f9..36c5ce9 100644
--- a/meson/ninjabackend.py
+++ b/meson/ninjabackend.py
@@ -457,14 +457,14 @@ int dummy;
script_root = self.environment.get_script_dir()
install_script = os.path.join(script_root, 'meson_install.py')
install_data_file = os.path.join(self.environment.get_scratch_dir(), 'install.dat')
- depfixer = os.path.join(script_root, 'depfixer.py')
+ depfixer = [sys.executable, self.environment.get_build_command(), '--internal', 'depfixer']
d = InstallData(self.environment.get_source_dir(),
self.environment.get_build_dir(),
self.environment.get_prefix(), depfixer)
elem = NinjaBuildElement('install', 'CUSTOM_COMMAND', 'PHONY')
elem.add_dep('all')
elem.add_item('DESC', 'Installing files.')
- elem.add_item('COMMAND', [sys.executable, install_script, install_data_file])
+ elem.add_item('COMMAND', [sys.executable, self.environment.get_build_command(), '--internal', 'install', install_data_file])
elem.add_item('pool', 'console')
self.generate_depmf_install(d)
self.generate_target_install(d)
@@ -1094,9 +1094,12 @@ int dummy;
scriptdir = self.environment.get_script_dir()
outfile.write('\n')
symrule = 'rule SHSYM\n'
- symcmd = ' command = "%s" "%s" %s %s $CROSS\n' % (ninja_quote(sys.executable),
- ninja_quote(os.path.join(scriptdir, 'symbolextractor.py')),
- '$in', '$out')
+ symcmd = ' command = "%s" "%s" %s %s %s %s $CROSS\n' % (ninja_quote(sys.executable),
+ self.environment.get_build_command(),
+ '--internal',
+ 'symbolextractor',
+ '$in',
+ '$out')
synstat = ' restat = 1\n'
syndesc = ' description = Generating symbol file $out.\n'
outfile.write(symrule)
diff --git a/meson/scripts/meson_install.py b/meson/scripts/meson_install.py
index a286864..1ede757 100644
--- a/meson/scripts/meson_install.py
+++ b/meson/scripts/meson_install.py
@@ -193,7 +193,7 @@ def install_targets(d):
print("Symlink creation does not work on this platform.")
printed_symlink_error = True
if is_elf_platform():
- p = subprocess.Popen([d.depfixer, outname, install_rpath],
+ p = subprocess.Popen(d.depfixer + [outname, install_rpath],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
(stdo, stde) = p.communicate()
diff --git a/run_cross_test.py b/run_cross_test.py
index 7355c28..3545cfd 100755
--- a/run_cross_test.py
+++ b/run_cross_test.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
-# Copyright 2013-2014 The Meson development team
+# Copyright 2013-2016 The Meson development team
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -23,7 +23,7 @@ Not part of the main test suite because of two reasons:
Eventually migrate to something fancier.'''
import os, subprocess, shutil, sys
-import environment
+import meson.environment as environment
from run_tests import gather_tests
diff --git a/run_tests.py b/run_tests.py
index e24c906..bf56ea8 100755
--- a/run_tests.py
+++ b/run_tests.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
-# Copyright 2012-2015 The Meson development team
+# Copyright 2012-2016 The Meson development team
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -22,7 +22,7 @@ from meson import environment
from meson import mesonlib
from meson import mlog
from meson import mesonmain
-from scripts import meson_test, meson_benchmark
+from meson.scripts import meson_test, meson_benchmark
import argparse
import xml.etree.ElementTree as ET
import time
@@ -45,7 +45,7 @@ print_debug = 'MESON_PRINT_TEST_OUTPUT' in os.environ
test_build_dir = 'work area'
install_dir = os.path.join(os.path.split(os.path.abspath(__file__))[0], 'install dir')
-meson_command = './meson.py'
+meson_command = os.path.join(os.getcwd(), 'meson.py')
class StopException(Exception):
def __init__(self):
@@ -155,7 +155,7 @@ def run_configure_inprocess(commandlist):
old_stderr = sys.stderr
sys.stderr = mystderr = StringIO()
try:
- returncode = mesonmain.run(commandlist)
+ returncode = mesonmain.run(commandlist[0], commandlist[1:])
finally:
sys.stdout = old_stdout
sys.stderr = old_stderr