home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / fnb101.zip / Lib / site-packages / Fnorb / script / cpp.py next >
Text File  |  1999-06-28  |  3KB  |  74 lines

  1. #!/usr/bin/env python
  2. #############################################################################
  3. # Copyright (C) DSTC Pty Ltd (ACN 052 372 577) 1997, 1998, 1999
  4. # All Rights Reserved.
  5. #
  6. # The software contained on this media is the property of the DSTC Pty
  7. # Ltd.  Use of this software is strictly in accordance with the
  8. # license agreement in the accompanying LICENSE.HTML file.  If your
  9. # distribution of this software does not contain a LICENSE.HTML file
  10. # then you have no rights to use this software in any manner and
  11. # should contact DSTC at the address below to determine an appropriate
  12. # licensing arrangement.
  13. #      DSTC Pty Ltd
  14. #      Level 7, GP South
  15. #      Staff House Road
  16. #      University of Queensland
  17. #      St Lucia, 4072
  18. #      Australia
  19. #      Tel: +61 7 3365 4310
  20. #      Fax: +61 7 3365 4311
  21. #      Email: enquiries@dstc.edu.au
  22. # This software is being provided "AS IS" without warranty of any
  23. # kind.  In no event shall DSTC Pty Ltd be liable for damage of any
  24. # kind arising out of or in connection with the use or performance of
  25. # this software.
  26. #
  27. # Project:      Fnorb
  28. # File:         $Source: /units/arch/src/Fnorb/script/RCS/cpp.py,v $
  29. # Version:      @(#)$RCSfile: cpp.py,v $ $Revision: 1.2 $
  30. #
  31. #############################################################################
  32. """ Module to determine the command to run the C/C++ pre-processor. """
  33.  
  34.  
  35. # Standard/built-in modules.
  36. import commands, sys
  37.  
  38.  
  39. # Commands to run the C/C++ pre-processor on Unixen and Windows 95/NT.
  40. if sys.platform == 'win32':
  41.     # By default, we use the pre-processor that comes with MS Visual C/C++.
  42.     COMMAND = 'cl /nologo /E %s %s'
  43.     
  44.     # If you use 'gcc' then uncomment this instead!
  45. ##    COMMAND = 'gcc -x c -E %s %s'
  46.  
  47. # OS/2
  48. elif sys.platform == 'os2':
  49.     # By default, we use the pre-processor that comes with IBM VisualAge C/C++.
  50.     COMMAND = 'icc /Q /W0 /Pc+ /Pd+ /Pe+ %s %s'
  51.     
  52.     # If you use 'gcc' then uncomment this instead!
  53. ##    COMMAND = 'gcc -x c -E %s %s'
  54.  
  55. # Unixen.
  56. else:
  57.     # Look for the forces of goodness and light first ;^)
  58.     (result, output) = commands.getstatusoutput('which gcc')
  59.     if result == 0:
  60.     COMMAND = 'gcc -x c -E %s %s'
  61.  
  62.     # And then the other stuff!
  63.     else:
  64.     (result, output) = commands.getstatusoutput('which cpp')
  65.     if result == 0:
  66.         COMMAND = 'cpp %s %s'
  67.  
  68.     else:
  69.         raise "No C/C++ pre-processor on your $PATH!"
  70.  
  71. #############################################################################
  72.