Changeset 4e9aaf5 in mainline for tools/config.py


Ignore:
Timestamp:
2010-03-19T18:30:12Z (15 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
8023571, b535aeb, e2b73d4f
Parents:
3c80f2b
Message:

more autotooling: run actually the compiler in autotool.py and detect sizes of integers, generate common.h
more build system cleanup: remove redundancy, remove config.defs, merge kernel makefiles to a single file

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/config.py

    r3c80f2b r4e9aaf5  
    4343MAKEFILE = 'Makefile.config'
    4444MACROS = 'config.h'
    45 DEFS = 'config.defs'
    4645PRECONF = 'defaults'
    4746
     
    225224        return True
    226225
    227 def create_output(mkname, mcname, dfname, defaults, ask_names):
     226def create_output(mkname, mcname, defaults, ask_names):
    228227        "Create output configuration"
    229228       
     
    249248        outmk = file(mkname, 'w')
    250249        outmc = file(mcname, 'w')
    251         outdf = file(dfname, 'w')
    252250       
    253251        outmk.write('#########################################\n')
     
    259257        outmc.write(' ***************************************/\n\n')
    260258       
    261         outdf.write('#########################################\n')
    262         outdf.write('## AUTO-GENERATED FILE, DO NOT EDIT!!! ##\n')
    263         outdf.write('#########################################\n\n')
    264         outdf.write('CONFIG_DEFS =')
     259        defs = 'CONFIG_DEFS ='
    265260       
    266261        for varname, vartype, name, choices, cond in ask_names:
     
    280275                        if (default == "y"):
    281276                                outmc.write('/* %s */\n#define %s\n\n' % (name, varname))
    282                                 outdf.write(' -D%s' % varname)
     277                                defs += ' -D%s' % varname
    283278                else:
    284279                        outmc.write('/* %s */\n#define %s %s\n#define %s_%s\n\n' % (name, varname, default, varname, default))
    285                         outdf.write(' -D%s=%s -D%s_%s' % (varname, default, varname, default))
     280                        defs += ' -D%s=%s -D%s_%s' % (varname, default, varname, default)
    286281       
    287282        if (revision is not None):
    288283                outmk.write('REVISION = %s\n' % revision)
    289284                outmc.write('#define REVISION %s\n' % revision)
    290                 outdf.write(' "-DREVISION=%s"' % revision)
     285                defs += ' "-DREVISION=%s"' % revision
    291286       
    292287        outmk.write('TIMESTAMP = %s\n' % timestamp)
    293288        outmc.write('#define TIMESTAMP %s\n' % timestamp)
    294         outdf.write(' "-DTIMESTAMP=%s"\n' % timestamp)
     289        defs += ' "-DTIMESTAMP=%s"\n' % timestamp
     290       
     291        outmk.write(defs)
    295292       
    296293        outmk.close()
    297294        outmc.close()
    298         outdf.close()
    299295
    300296def sorted_dir(root):
     
    355351        if ((len(sys.argv) >= 3) and (sys.argv[2] == 'default')):
    356352                if (check_choices(defaults, ask_names)):
    357                         create_output(MAKEFILE, MACROS, DEFS, defaults, ask_names)
     353                        create_output(MAKEFILE, MACROS, defaults, ask_names)
    358354                        return 0
    359355       
     
    473469                xtui.screen_done(screen)
    474470       
    475         create_output(MAKEFILE, MACROS, DEFS, defaults, ask_names)
     471        create_output(MAKEFILE, MACROS, defaults, ask_names)
    476472        return 0
    477473
Note: See TracChangeset for help on using the changeset viewer.