Пример #1
0
def translation_options():
    return OptionDescription(
        "rsqueak", "RSqueak Options", [
            StrOption(
                "optional_plugins",
                "Which optional plugins should be enabled (a comma-separated "\
                "list, e.g. 'RubyPlugin,DatabasePlugin,JitHooks')",
                default="", cmdline="--plugins"
            ),
            StrOption(
                "disabled_plugins",
                "Which default plugins should be disabled (a comma-separated "\
                "list, e.g. 'LargeIntegers,SocketPlugin,SqueakSSL')",
                default="", cmdline="--disabled_plugins"
            ),
            BoolOption(
                "without_plugins",
                "Disable all plugins",
                default=False, cmdline="--without_plugins"
            ),
        ]
    )
Пример #2
0
                     " of traces. Use big if you want to go bigger than "
                     "the default", ["big", "normal"],
                     default="normal"),
        BoolOption(
            "check_str_without_nul",
            "Forbid NUL chars in strings in some external function calls",
            default=False,
            cmdline=None),

        # misc
        BoolOption("verbose",
                   "Print extra information",
                   default=False,
                   cmdline="--verbose"),
        StrOption("cc",
                  "Specify compiler to use for compiling generated C",
                  cmdline="--cc"),
        StrOption("profopt",
                  "Specify profile based optimization script",
                  cmdline="--profopt"),
        BoolOption("noprofopt",
                   "Don't use profile based optimization",
                   default=False,
                   cmdline="--no-profopt",
                   negation=False),
        BoolOption("instrument",
                   "internal: turn instrumentation on",
                   default=False,
                   cmdline=None),
        BoolOption("countmallocs",
                   "Count mallocs and frees",
Пример #3
0
        BoolOption("no_site_import",
                   "do not 'import site' on initialization",
                   default=False,
                   cmdline="-S"),
        BoolOption(
            "runmodule",
            "library module to be run as a script (terminates option list)",
            default=False,
            cmdline="-m"),
        BoolOption("runcommand",
                   "program passed in as CMD (terminates option list)",
                   default=False,
                   cmdline="-c"),
        StrOption(
            "warn",
            "warning control (arg is action:message:category:module:lineno)",
            default=None,
            cmdline="-W"),
    ])

pypy_init = gateway.applevel('''
def pypy_init(import_site):
    if import_site:
        import os, sys
        _MACOSX = sys.platform == 'darwin'
        if _MACOSX:
            # __PYVENV_LAUNCHER__, used by CPython on macOS, should be ignored
            # since it (possibly) results in a wrong sys.prefix and
            # sys.exec_prefix (and consequently sys.path).
            old_pyvenv_launcher = os.environ.pop('__PYVENV_LAUNCHER__', None)
        try:
Пример #4
0
         )  #validator=get_module_validator(modname))
         for modname in all_modules
     ]),
 BoolOption(
     "allworkingmodules",
     "use as many working modules as possible",
     # NB. defaults to True, but in py.py this is overridden by
     # a False suggestion because it takes a while to start up.
     # Actual module enabling only occurs if
     # enable_allworkingmodules() is called, and it depends
     # on the selected backend.
     default=True,
     cmdline="--allworkingmodules",
     negation=True),
 StrOption("extmodules",
           "Comma-separated list of third-party builtin modules",
           cmdline="--ext",
           default=None),
 BoolOption(
     "translationmodules",
     "use only those modules that are needed to run translate.py on pypy",
     default=False,
     cmdline="--translationmodules",
     suggests=[("objspace.allworkingmodules", False)]),
 BoolOption("usepycfiles",
            "Write and read pyc files when importing",
            default=True),
 BoolOption("lonepycfiles",
            "Import pyc files with no matching py file",
            default=False,
            requires=[("objspace.usepycfiles", True)]),
 StrOption(
Пример #5
0
                       negation=False))
        if not optional:
            result.append(
                BoolOption("no_%s" % name,
                           "Don't " + doc,
                           default=False,
                           cmdline="--no-" + name,
                           negation=False))
    return result


translate_optiondescr = OptionDescription(
    "translate",
    "XXX",
    [
        StrOption(
            "targetspec", "XXX", default='targetpypystandalone', cmdline=None),
        ChoiceOption("opt",
                     "optimization level",
                     OPT_LEVELS,
                     default=DEFAULT_OPT_LEVEL,
                     cmdline="--opt -O"),
        BoolOption("profile",
                   "cProfile (to debug the speed of the translation process)",
                   default=False,
                   cmdline="--profile"),
        BoolOption("pdb",
                   "Always run pdb even if the translation succeeds",
                   default=False,
                   cmdline="--pdb"),
        BoolOption("batch",
                   "Don't run interactive helpers",