Changeset bfc576f in examples-v2


Ignore:
Timestamp:
Nov 25, 2013, 2:53:31 AM (5 years ago)
Author:
Chris Johns <chrisj@…>
Branches:
4.11, 286403d7a3d0e521179e677c0d2fd7549c9ceab4
Children:
acbe98f
Parents:
e38d748
git-author:
Chris Johns <chrisj@…> (11/25/13 02:53:31)
git-committer:
Gedare Bloom <gedare@…> (12/12/13 19:55:54)
Message:

Fix rtems.py's filtering of BSPs.

Update the BSP filtering in the RTEMS waf support.
Break the flags down even more to allow users to manage what they use in
applications.
Add rtems-bin2c to the list of checked tools.

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • filesystem/fat_ramdisk/wscript

    re38d748 rbfc576f  
    1 # Copyright 2013 Gedare Bloom (gedare@rtems.org) 
    2 # 
     1# Copyright 2013 Gedare Bloom (gedare@rtems.org)
     2#
    33# This file's license is 2-clause BSD as in this distribution's LICENSE.2 file.
    44#
     
    1313from waflib.TaskGen import extension
    1414class bin2c(Task):
    15   run_str = 'rtems-bin2c ${SRC} ${TGT[0].abspath()} && ' + \
     15  run_str = '${RTEMS_BIN2C} ${SRC} ${TGT[0].abspath()} && ' + \
    1616            'touch ${TGT[1].abspath()}'
    1717  ext_out = ['.h']
     
    4747        cflags = cflags,
    4848        source = 'init.c FilesystemImage')
    49 
  • rtems_waf/rtems.py

    re38d748 rbfc576f  
    1 # Copyright 2012 Chris Johns (chrisj@rtems.org)
    21#
    3 # This file's license is 2-clause BSD as in this distribution's LICENSE.2 file.
     2# Copyright 2012, 2013 Chris Johns (chrisj@rtems.org)
    43#
     4# Redistribution and use in source and binary forms, with or without
     5# modification, are permitted provided that the following conditions are met:
     6
     7# 1. Redistributions of source code must retain the above copyright notice, this
     8# list of conditions and the following disclaimer.
     9
     10# 2. Redistributions in binary form must reproduce the above copyright notice,
     11# this list of conditions and the following disclaimer in the documentation
     12# and/or other materials provided with the distribution.
     13
     14# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
     15# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     16# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
     17# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
     18# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     19# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
     20# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
     21# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
     22# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
     23# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    524
    625#
    726# RTEMS support for applications.
    827#
     28
     29import copy
    930import os
    1031import os.path
     
    6889        # Check the tools, architectures and bsps.
    6990        #
    70         rtems_tools, archs, arch_bsps = check_options(ctx,
    71                                                       env.options['rtems_tools'],
    72                                                       env.options['rtems_path'],
    73                                                       env.options['rtems_version'],
    74                                                       env.options['rtems_archs'],
    75                                                       env.options['rtems_bsps'])
     91        rtems_path, rtems_tools, archs, arch_bsps = check_options(ctx,
     92                                                                  env.options['rtems_tools'],
     93                                                                  env.options['rtems_path'],
     94                                                                  env.options['rtems_version'],
     95                                                                  env.options['rtems_archs'],
     96                                                                  env.options['rtems_bsps'])
    7697
    7798        #
     
    107128        show_commands = 'no'
    108129
    109     rtems_tools, archs, arch_bsps = check_options(conf,
    110                                                   conf.options.rtems_tools,
    111                                                   conf.options.rtems_path,
    112                                                   conf.options.rtems_version,
    113                                                   conf.options.rtems_archs,
    114                                                   conf.options.rtems_bsps)
     130    rtems_path, rtems_tools, archs, arch_bsps = check_options(conf,
     131                                                              conf.options.rtems_tools,
     132                                                              conf.options.rtems_path,
     133                                                              conf.options.rtems_version,
     134                                                              conf.options.rtems_archs,
     135                                                              conf.options.rtems_bsps)
    115136
    116137    _log_header(conf)
     
    135156        conf.env.RTEMS_BSP = _bsp_from_arch_bsp(ab)
    136157
    137         tools = _find_tools(conf, arch, rtems_tools, tools)
     158        tools = _find_tools(conf, arch, [rtems_path] + rtems_tools, tools)
    138159        for t in tools[arch]:
    139160            conf.env[t] = tools[arch][t]
     
    208229    else:
    209230        ctx.fatal('RTEMS path is not valid. No lib/pkgconfig or rtems-config found.')
     231    if os.path.exists(os.path.join(rtems_path, 'bin')):
     232        rtems_bin = os.path.join(rtems_path, 'bin')
     233    else:
     234        ctx.fatal('RTEMS path is not valid. No bin directory found.')
    210235
    211236    #
     
    267292    arch_bsps = filter(ctx, 'bsps', arch_bsps)
    268293
    269     return tools, archs, arch_bsps
     294    return rtems_bin, tools, archs, arch_bsps
    270295
    271296def arch(arch_bsp):
     
    293318    items_in = []
    294319    items_out = []
     320    if 'in' in rtems_filters[filter]:
     321        items_in = copy.copy(rtems_filters[filter]['in'])
     322    if 'out' in rtems_filters[filter]:
     323        items_out = copy.copy(rtems_filters[filter]['out'])
    295324    filtered_items = []
    296     if 'in' in rtems_filters[filter]:
    297         items_in = rtems_filters[filter]['in']
    298     if 'out' in rtems_filters[filter]:
    299         items_out = rtems_filters[filter]['out']
    300325    for i in items:
    301         ab = '%s/%s' % (arch(i), bsp(i))
    302         if ab in items_out:
    303             i = None
    304         elif ab in items_in:
    305             items_in.remove(ab)
    306         if i is not None:
    307             filtered_items += [i]
    308         if len(items_in) != 0:
    309             ctx.fatal('Following %s not found: %s' % (filter, ', '.join(items_in)))
    310     filtered_items.sort()
    311     return filtered_items
     326        item = i
     327        ab = '%s/%s' % (arch(item), bsp(item))
     328        for inre in items_in:
     329            if re.compile(inre).match(ab):
     330                items_in.remove(inre)
     331                filtered_items += [item]
     332                item = None
     333                break
     334        if item is not None:
     335            for outre in items_out:
     336                if re.compile(outre).match(ab):
     337                    item = None
     338                    break
     339        if item is not None:
     340            filtered_items += [item]
     341    if len(items_in) != 0:
     342        ctx.fatal('Following %s not found: %s' % (filter, ', '.join(items_in)))
     343    return sorted(filtered_items)
    312344
    313345def arch_rtems_version(arch):
     
    388420    if arch not in tools:
    389421        arch_tools = {}
    390         arch_tools['CC']       = conf.find_program([arch + '-gcc'], path_list = paths)
    391         arch_tools['CXX']      = conf.find_program([arch + '-g++'], path_list = paths)
    392         arch_tools['AS']       = conf.find_program([arch + '-gcc'], path_list = paths)
    393         arch_tools['LD']       = conf.find_program([arch + '-ld'],  path_list = paths)
    394         arch_tools['AR']       = conf.find_program([arch + '-ar'],  path_list = paths)
    395         arch_tools['LINK_CC']  = arch_tools['CC']
    396         arch_tools['LINK_CXX'] = arch_tools['CXX']
    397         arch_tools['AR']       = conf.find_program([arch + '-ar'], path_list = paths)
    398         arch_tools['LD']       = conf.find_program([arch + '-ld'], path_list = paths)
    399         arch_tools['NM']       = conf.find_program([arch + '-nm'], path_list = paths)
    400         arch_tools['OBJDUMP']  = conf.find_program([arch + '-objdump'], path_list = paths)
    401         arch_tools['OBJCOPY']  = conf.find_program([arch + '-objcopy'], path_list = paths)
    402         arch_tools['READELF']  = conf.find_program([arch + '-readelf'], path_list = paths)
    403         arch_tools['STRIP']    = conf.find_program([arch + '-strip'], path_list = paths)
    404         arch_tools['RTEMS_LD'] = conf.find_program(['rtems-ld'], path_list = paths, mandatory = False)
     422        arch_tools['CC']          = conf.find_program([arch + '-gcc'], path_list = paths)
     423        arch_tools['CXX']         = conf.find_program([arch + '-g++'], path_list = paths)
     424        arch_tools['AS']          = conf.find_program([arch + '-gcc'], path_list = paths)
     425        arch_tools['LD']          = conf.find_program([arch + '-ld'],  path_list = paths)
     426        arch_tools['AR']          = conf.find_program([arch + '-ar'],  path_list = paths)
     427        arch_tools['LINK_CC']     = arch_tools['CC']
     428        arch_tools['LINK_CXX']    = arch_tools['CXX']
     429        arch_tools['AR']          = conf.find_program([arch + '-ar'], path_list = paths)
     430        arch_tools['LD']          = conf.find_program([arch + '-ld'], path_list = paths)
     431        arch_tools['NM']          = conf.find_program([arch + '-nm'], path_list = paths)
     432        arch_tools['OBJDUMP']     = conf.find_program([arch + '-objdump'], path_list = paths)
     433        arch_tools['OBJCOPY']     = conf.find_program([arch + '-objcopy'], path_list = paths)
     434        arch_tools['READELF']     = conf.find_program([arch + '-readelf'], path_list = paths)
     435        arch_tools['STRIP']       = conf.find_program([arch + '-strip'], path_list = paths)
     436        arch_tools['RTEMS_LD']    = conf.find_program(['rtems-ld'], path_list = paths, mandatory = False)
     437        arch_tools['RTEMS_BIN2C'] = conf.find_program(['rtems-bin2c'], path_list = paths, mandatory = False)
     438        arch_tools['TAR']         = conf.find_program(['tar'], mandatory = False)
    405439        tools[arch] = arch_tools
    406440    return tools
     
    589623@TaskGen.extension('.c')
    590624class rap(link_task):
    591         "Link object files into a RTEMS applicatoin"
     625        "Link object files into a RTEMS application"
    592626        run_str = '${RTEMS_LD} ${RTEMS_LINKFLAGS} --cc ${CC} ${SRC} -o ${TGT[0].abspath()} ${STLIB_MARKER} ${STLIBPATH_ST:STLIBPATH} ${STLIB_ST:STLIB} ${LIBPATH_ST:LIBPATH} ${LIB_ST:LIB}'
    593627        ext_out = ['.rap']
Note: See TracChangeset for help on using the changeset viewer.