[omniORB] -DPYTHON_INCLUDE="<Python.h>"

Luke Deller ldeller@xplantechnology.com
Fri, 3 Aug 2001 16:24:27 +1000


Hi,

I tried to build the latest OmniORB3 snapshot (OmniORB3-20010802) under
win32 with MSVC++6, and it failed as follows:

../../../../bin/x86_win32/clwrapper -gnuwin32 -c -O2 -MD -GX -DIDLMODULE_VER
SION
="\"0x2301\"" -DMSDOS -DOMNIIDL_EXECUTABLE -I"c:/python20"/include -I"c:/pyt
hon2
0"/include/python2.0 -DPYTHON_INCLUDE="<Python.h>" -I.  -I../../../../includ
e -D
__WIN32__ -D__x86__ -D__NT__ -D__OSVERSION__=4 -Foy.tab.o y.tab.cc
cl -c -O2 -MD -GX -DIDLMODULE_VERSION=\"0x2301\" -DMSDOS -DOMNIIDL_EXECUTABL
E -I
c:\python20\include -Ic:\python20\include\python2.0 -DPYTHON_INCLUDE=<Python
.h>
-I. -I..\..\..\..\include -D__WIN32__ -D__x86__ -D__NT__ -D__OSVERSION__=4 -
Foy.
tab.o -Tpy.tab.cc
The system cannot find the file specified.
make[3]: *** [y.tab.o] Error 1
make[3]: Leaving directory `//c/corba/omni/src/tool/omniidl/cxx'
...

The problem seems to be this flag to
clwrapper: -DPYTHON_INCLUDE="<Python.h>"
which produces this flag to cl: -DPYTHON_INCLUDE=<Python.h>
where the < and > characters seem to be interpreted as IO redirection
operators or something.

I tried to play games with quotes and backslashes to fix the problem ( in
src/tool/omniidl/cxx/dir.mk ) but I couldn't get it to work.

In the end, I resorted to using the following modification:

diff -r OmniORB3-20010802/omni/src/tool/omniidl/cxx/dir.mk
./omni/src/tool/omniidl/cxx/dir.mk
65c65
< PYINCFILE := "<python$(PYVERSION)/Python.h>"
---
> PYINCFILE := "python$(PYVERSION)/Python.h"
182c182
<                 -DPYTHON_INCLUDE="<Python.h>"
---
>                 -DPYTHON_INCLUDE=Python.h
diff -r OmniORB3-20010802/omni/src/tool/omniidl/cxx/idlpython.cc
./omni/src/tool/omniidl/cxx/idlpython.cc
150c150,151
< #include PYTHON_INCLUDE
---
> #define PYTHON_INCLUDE_2 < ## PYTHON_INCLUDE ## >
> #include PYTHON_INCLUDE_2


Maybe something like this ought to go into CVS.

Regards,
Luke.