Please note:The SCons wiki is in read-only mode due to ongoing spam/DoS issues. Also, new account creation is currently disabled. We are looking into alternative wiki hosts.

This is a bit rough but this builder is for generating Corba client and server stubs using the Orbix 6.0 idl compiler from iona.

Note originally we had one builder that generated all 4 output files in one hit, and we directly used that in the SConscripts. We realised tihs is a hard way to do it as after using the builder we then would filter out the header files and pass the C++ files to a Object builder.

The untested shown approach below is to use a wrapper builder that around the real builder, the wrapper does the filtering for us. It is important that the real builder still outputs all the files including the headers so that scons can match the headers against dependencies from #include statements.

This approach could actaully be taken even further, and one CorbaIdl() builder could generate all the suported language mappings, ie c++, java, c, python etc. The user would simply use the appropriate wrapper depending on the files they needed.

Apologies in advanve for any typos, this is manual reentry of relevant bits from a big printout, and I do not have the tool here to test. Used with scons 0.95

   1 import SCons.Scanner.IDL
   2 
   3 idlCmd = '/blah/bin/idl $_CPPINCFLAGS -base:-Oh${TARGET.dir}:-Oc${TARGET.dir} -poa:-i:-Oh${TARGET.dir}:-Oc${TARGET.dir} $SOURCES'
   4 
   5 def idl_emitter(target, source, env):
   6   "Produce list of files created by idl compiler"
   7   base,ext = SCons.Util.splitext(str(source[0]))
   8   hh = base + '.hh'
   9   Shh = base + 'S.hh'
  10   Ccxx = base + 'C.cxx'
  11   Scxx = base + 'S.cxx'
  12   t = [hh, Shh, Ccxx, Scxx]
  13   return (t, source)
  14 
  15 bld = Builder(
  16   action=idlCmd,
  17   src_suffix = '.idl',
  18   emitter = idl_emitter,
  19   source_scanner = SCons.Scanner.IDL.IDLScan(),
  20   suffix = '.hh')
  21 
  22 def CorbaCpp(env, sources):
  23   'Trigger idl Builder, but only return the Cpp source files'
  24   out = env.CorbaIdl(sources)
  25   cpp=[]
  26   for i in out :
  27     if str(i)[-4:] == '.cxx' :
  28       cpp.append(i)
  29 
  30   Object(cpp)
  31   return cpp
  32 
  33 env.Append(BUILDERS={'CorbaIdl':bld})
  34 env.Append(BUILDERS={'CorbaCpp':CorbaCpp})
  35 
  36 # setup orbix environmet for idl command
  37 # it seems to expect some things I didn't!
  38 env.AppendENVPath('LD_LIBRARY_PATH', 'blah')
  39 env.Append(LIBPATH='blah')
  40 env['ENV']['IT_LICENSE_FILE'] = 'blah'
  41 env['ENV']['IT_CONFIG_DOMAINS_DIR'] = 'blah'
  42 env['ENV']['IT_DOMAIN_NAME'] = 'blah'
  43 env['ENV']['IT_PRODUCT_SHLIB_DIR'] = 'blah'
  44 env['ENV']['IT_PRODUCT_DIR'] = 'blah'
  45 env['ENV']['IT_PRODUCT_VER'] = 'blah'
  46 
  47 # setup to find libraries
  48 env.Append(LIBPATH='blah')
  49 
  50 # link programs with these libraries for orbix
  51 corbaLibs=Split('it_poa it_art it_ifc it_naming')
  52 
  53 # we do NOT use CCPATH for orbix headers as they are full of warnings.
  54 # This also avoids scons checksumming the headers anyway, which is faster.
  55 env.Append(CCFLAGS='-isystemblah')
  56 
  57 
  58 
  59 # use like so
  60 tmp = env.CorbaCpp('thingy.idl')
  61 Library('thingy', tmp)

CorbaBuilder (last edited 2008-11-08 13:43:37 by ChrisHodges)