[omniORB] omniidl handling of include file paths

Duncan Grisby dgrisby@uk.research.att.com
Thu, 13 Jul 2000 16:08:01 +0100


On Thursday 13 July, Duncan Grisby wrote:

> This is all in the hands of the GNU C pre-processor, so omniidl can't
> do anything to change it. omniidl never gets to see the #include
> statement -- it just sees the output from cccp.

One other thought. If really want to strip absolute paths based on the
-I flags, you can hack the C++ back-end to look at the flags passed to
the pre-processor and try to match absolute paths.

Look at the monolithic() function in

  src/lib/omniORB2/omniidl_be/cxx/header/__init__.py

which decides what path name to use for #includes. You can get the
pre-processor arguments from omniidl.main.preprocessor_args.

I don't want to make this change in the distribution, since it will
sometimes do the wrong thing. If I have a file like

  // a.idl
  #include </foo/bar/c.idl>

and compile it with

  omniidl -I/foo/bar a.idl

then there's no way of telling that the /foo/bar prefix shouldn't be
stripped off.

Cheers,

Duncan.

-- 
 -- Duncan Grisby  \  Research Engineer  --
  -- AT&T Laboratories Cambridge          --
   -- http://www.uk.research.att.com/~dpg1 --