Path: utzoo!attcan!uunet!decwrl!shelby!neon!pescadero.Stanford.EDU!philip From: philip@pescadero.Stanford.EDU (Philip Machanick) Newsgroups: comp.lang.c++ Subject: Re: porting C++ to tranputers Keywords: ports, transputers Message-ID: <1990Oct8.165450.1764@Neon.Stanford.EDU> Date: 8 Oct 90 16:54:50 GMT References: <1011@oscsunb.osc.edu> <59874@bbn.BBN.COM> Sender: news@Neon.Stanford.EDU (USENET News System) Reply-To: philip@pescadero.stanford.edu Organization: Computer Science Department, Stanford University Lines: 38 In article <59874@bbn.BBN.COM>, saustin@bbn.com (Steve Austin) writes: [...] |> I haven't ported AT&T's translator to RUN on a transputer, but it is |> trivially easy to get C++ code compiled FOR a transputer - or anything |> else really - if you have a C compiler for the target machine. |> |> The program 'CC' is just a shell script which takes the C++ program, |> runs it through the pre-processor, runs the output of this through |> cfront and then compiles the resulting C code with the standard compiler. |> |> It is easy to divert the last step (compiling with the default cc) and |> then compile with the cross-compiler. If you don't want to mess around with |> the shell script environment variables, you can yse the -Fc switch to get |> C code produced from the standard output of CC, redirect this to a temporary |> file and compile this. [...] |> There are some minor difficulies to be overcome. [...} |> 4. Watch out for problems with include files. The only problem I had |> was that SUN's ctype.h seems to be different from anybody else's. |> This is a difference between the character table being defined |> as _ctype_ in on and __ctype in another (or something like that). |> However, your mileage may vary. When I ported cfront to a new machine, I found the easiest way to handle header file problems was to use the C header files from the target machine. The same would probably be true when cross-compiling. Since cfront runs after the pre-processor, all the includes are expanded by the time your mangled c code is produced. (The C++ headers use the standard C headers extensively.) I would imagine you would also want to build the C++ library for the target machine. A problem I have had here is the function memcpy is used in the iostream classes. This is a Unix, rather than C, function as far as I can work out, and is not even supported on all versions of Unix. Fortunately, it's very simple to write your own. -- Philip Machanick philip@pescadero.stanford.edu