You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

64 lines
2.2 KiB

6 years ago
  1. """SCons.Tool.gfortran
  2. Tool-specific initialization for gfortran, the GNU Fortran 95/Fortran
  3. 2003 compiler.
  4. There normally shouldn't be any need to import this module directly.
  5. It will usually be imported through the generic SCons.Tool.Tool()
  6. selection method.
  7. """
  8. #
  9. # Copyright (c) 2001 - 2017 The SCons Foundation
  10. #
  11. # Permission is hereby granted, free of charge, to any person obtaining
  12. # a copy of this software and associated documentation files (the
  13. # "Software"), to deal in the Software without restriction, including
  14. # without limitation the rights to use, copy, modify, merge, publish,
  15. # distribute, sublicense, and/or sell copies of the Software, and to
  16. # permit persons to whom the Software is furnished to do so, subject to
  17. # the following conditions:
  18. #
  19. # The above copyright notice and this permission notice shall be included
  20. # in all copies or substantial portions of the Software.
  21. #
  22. # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
  23. # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  24. # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  25. # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
  26. # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  27. # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  28. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  29. #
  30. __revision__ = "src/engine/SCons/Tool/gfortran.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
  31. import SCons.Util
  32. from . import fortran
  33. def generate(env):
  34. """Add Builders and construction variables for gfortran to an
  35. Environment."""
  36. fortran.generate(env)
  37. for dialect in ['F77', 'F90', 'FORTRAN', 'F95', 'F03', 'F08']:
  38. env['%s' % dialect] = 'gfortran'
  39. env['SH%s' % dialect] = '$%s' % dialect
  40. if env['PLATFORM'] in ['cygwin', 'win32']:
  41. env['SH%sFLAGS' % dialect] = SCons.Util.CLVar('$%sFLAGS' % dialect)
  42. else:
  43. env['SH%sFLAGS' % dialect] = SCons.Util.CLVar('$%sFLAGS -fPIC' % dialect)
  44. env['INC%sPREFIX' % dialect] = "-I"
  45. env['INC%sSUFFIX' % dialect] = ""
  46. def exists(env):
  47. return env.Detect('gfortran')
  48. # Local Variables:
  49. # tab-width:4
  50. # indent-tabs-mode:nil
  51. # End:
  52. # vim: set expandtab tabstop=4 shiftwidth=4: