Changeset 32b4302 in mainline for tools/config.py


Ignore:
Timestamp:
2019-08-18T19:06:02Z (6 years ago)
Author:
GitHub <noreply@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
1c39d33b
Parents:
fa70134 (diff), 6c2fac18 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2019-08-18 19:06:02)
git-committer:
GitHub <noreply@…> (2019-08-18 19:06:02)
Message:

Merge pull request #174 from le-jzr/meson3

Convert HelenOS build system to Meson

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/config.py

    rfa70134 r32b4302  
    4343
    4444ARGPOS_RULES = 1
    45 ARGPOS_CHOICE = 2
    46 ARGPOS_PRESET = 3
     45ARGPOS_PRESETS_DIR = 2
     46ARGPOS_CHOICE = 3
     47ARGPOS_PRESET = 4
     48ARGPOS_MASK_PLATFORM = 3
    4749
    4850RULES_FILE = sys.argv[ARGPOS_RULES]
    4951MAKEFILE = 'Makefile.config'
    5052MACROS = 'config.h'
    51 PRESETS_DIR = 'defaults'
     53PRESETS_DIR = sys.argv[ARGPOS_PRESETS_DIR]
    5254
    5355class BinaryOp:
     
    536538
    537539        try:
    538                 version = subprocess.Popen(['git', 'log', '-1', '--pretty=%h'], stdout = subprocess.PIPE).communicate()[0].decode().strip()
     540                version = subprocess.Popen(['git', '-C', os.path.dirname(RULES_FILE), 'log', '-1', '--pretty=%h'], stdout = subprocess.PIPE).communicate()[0].decode().strip()
    539541                sys.stderr.write("ok\n")
    540542        except:
     
    689691        else:
    690692                preset = None
     693
     694        mask_platform = (len(sys.argv) > ARGPOS_MASK_PLATFORM and sys.argv[ARGPOS_MASK_PLATFORM] == "--mask-platform")
    691695
    692696        # Input configuration file can be specified on command line
     
    755759                        options = []
    756760                        opt2row = {}
    757                         cnt = 1
    758 
    759                         options.append("  --- Load preconfigured defaults ... ")
     761                        cnt = 0
     762
     763                        if not mask_platform:
     764                                cnt += 1
     765                                options.append("  --- Load preconfigured defaults ... ")
    760766
    761767                        for rule in rules:
     
    764770                                if cond and not cond.evaluate(config):
    765771                                        continue
     772
     773                                if mask_platform and (varname == "PLATFORM" or varname == "MACHINE" or varname == "COMPILER"):
     774                                        rule = varname, vartype, "(locked) " + name, choices, cond
    766775
    767776                                if varname == selname:
     
    811820                                        continue
    812821
    813                         if value == 0:
     822                        if value == 0 and not mask_platform:
    814823                                profile = choose_profile(PRESETS_DIR, MAKEFILE, screen, config)
    815824                                if profile != None:
     
    828837                        else:
    829838                                value = config[selname]
     839
     840                        if mask_platform and (selname == "PLATFORM" or selname == "MACHINE" or selname == "COMPILER"):
     841                                        continue
    830842
    831843                        if seltype == 'choice':
Note: See TracChangeset for help on using the changeset viewer.