Ticket #16: soclib_soft.patch

File soclib_soft.patch, 1.6 KB (added by ludovic.lhours@…, 15 years ago)
  • utils/bin/soclib-soft

     
     1#!/usr/bin/env python
     2
     3import sys
     4import os
     5import getopt
     6
     7sys.path.append(os.path.join(os.getenv('SOCLIB'), 'utils/lib/python'))
     8
     9from soclib_cc.config import config
     10from soclib_desc import components
     11from soclib_desc import module
     12
     13components.getDescs(config.desc_paths)
     14registry = module.Module.allRegistered()
     15
     16def doCFlags(args):
     17        paths = set([])
     18        for moduleName in args:
     19                module = registry[moduleName]
     20                basedir = os.path.dirname(module.filename)
     21                for path in module['interface_files']:
     22                        paths.add(os.path.realpath(
     23                                os.path.join(basedir, os.path.dirname(path))))
     24       
     25        print ' '.join(map(lambda x: '-I'+x, paths))
     26
     27opts, args = getopt.getopt(sys.argv[1:], "", ["cflags"])
     28didOne = False
     29for o, a in opts:
     30        if o == '--cflags':
     31                doCFlags(args)
     32                didOne = True
     33
     34if not didOne:
     35        print "usage: " + sys.argv[0] + " --cflags <modules>"
     36
     37
  • utils/lib/python/soclib_desc/module.py

    Property changes on: utils/bin/soclib-soft
    ___________________________________________________________________
    Added: svn:executable
       + *
    
     
    7277                'global_header_files' : [],
    7378                'implementation_files' : [],
    7479                'object_files' : [],
     80                'interface_files' : [],
    7581                'uses' : [],
    7682                'defines' : {},
    7783                'ports' : [],