Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!uunet!taumet!steve From: steve@taumet.com (Stephen Clamage) Newsgroups: comp.lang.c++ Subject: Re: Making all compilers happy with include files Message-ID: <590@taumet.com> Date: 6 Feb 91 16:55:51 GMT References: <73975@bu.edu.bu.edu> Organization: Taumetric Corporation, San Diego Lines: 29 eap@bu-pub.bu.edu (Eric A Pearce) writes: >How have people been getting all these compilers to co-exist on the same >system? ... [several C and C++ compilers listed] >This is what I've done in /usr/include/sys/stdtypes.h [ uses #ifdef's to get the typedefs needed for the various compilers ] >Is there a cleaner way to do this? Apart from being ugly, it makes adding a new compiler or updating an existing one very difficult. We solve the problem by using a different include file directory tree for each compiler. The standard system includes would usually be in /usr/include, for example. When you add the XYZ compiler, put its supplied include files in /usr/local/XYZ/include. When you use the XYZ compiler, configure it to search /usr/local/XYZ/include first, then /usr/include. This causes problems when you need a standard system include which conflicts with the XYZ compiler's include files. You then add a customized version of the system include file to the XYZ include directory tree. In your example, you would have a version of stdtypes.h in /usr/local/XYZ/include/sys customized for the XYZ compiler. -- Steve Clamage, TauMetric Corp, steve@taumet.com