summaryrefslogtreecommitdiffstats
path: root/src/engine/SCons
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2002-03-28 06:20:14 (GMT)
committerSteven Knight <knight@baldmt.com>2002-03-28 06:20:14 (GMT)
commitf52c6264753cf84c3f650da057f628c4fd6901cd (patch)
treebf163ebe1d8aad82b4dfbec279787e63819f1909 /src/engine/SCons
parent2fc00deefae65e7cd54f96518bedc62b763e0dda (diff)
downloadSCons-f52c6264753cf84c3f650da057f628c4fd6901cd.zip
SCons-f52c6264753cf84c3f650da057f628c4fd6901cd.tar.gz
SCons-f52c6264753cf84c3f650da057f628c4fd6901cd.tar.bz2
Add Fortran support.
Diffstat (limited to 'src/engine/SCons')
-rw-r--r--src/engine/SCons/Defaults.py18
-rw-r--r--src/engine/SCons/Scanner/C.py6
2 files changed, 22 insertions, 2 deletions
diff --git a/src/engine/SCons/Defaults.py b/src/engine/SCons/Defaults.py
index e0763b2..d14bbc7 100644
--- a/src/engine/SCons/Defaults.py
+++ b/src/engine/SCons/Defaults.py
@@ -66,6 +66,10 @@ CXXFile = SCons.Builder.Builder(name = 'CXXFile',
CPlusPlusAction = SCons.Action.Action('$CXXCOM')
+FortranAction = SCons.Action.Action('$F77COM')
+
+FortranPPAction = SCons.Action.Action('$F77PPCOM')
+
Object = SCons.Builder.Builder(name = 'Object',
action = { '.c' : '$CCCOM',
'.C' : CPlusPlusAction,
@@ -74,6 +78,12 @@ Object = SCons.Builder.Builder(name = 'Object',
'.cxx' : CPlusPlusAction,
'.c++' : CPlusPlusAction,
'.C++' : CPlusPlusAction,
+ '.f' : FortranAction,
+ '.for' : FortranAction,
+ '.FOR' : FortranAction,
+ '.F' : FortranPPAction,
+ '.fpp' : FortranPPAction,
+ '.FPP' : FortranPPAction,
},
prefix = '$OBJPREFIX',
suffix = '$OBJSUFFIX',
@@ -239,6 +249,10 @@ def make_win32_env_from_paths(include, lib, path):
'CXXFLAGS' : '$CCFLAGS',
'CXXCOM' : '$CXX $CXXFLAGS $_INCFLAGS /c $SOURCES /Fo$TARGET',
'CXXFILESUFFIX' : '.cc',
+ 'F77' : 'g77',
+ 'F77FLAGS' : '',
+ 'F77COM' : '$F77 $F77FLAGS $_INCFLAGS -c -o $TARGET $SOURCES',
+ 'F77PPCOM' : '$F77 $F77FLAGS $CPPFLAGS $_INCFLAGS -c -o $TARGET $SOURCES',
'LINK' : 'link',
'LINKFLAGS' : '/nologo',
'LINKCOM' : '$LINK $LINKFLAGS /OUT:$TARGET $_LIBDIRFLAGS $_LIBFLAGS $SOURCES',
@@ -317,6 +331,10 @@ if os.name == 'posix':
'CXXFLAGS' : '$CCFLAGS',
'CXXCOM' : '$CXX $CXXFLAGS $_INCFLAGS -c -o $TARGET $SOURCES',
'CXXFILESUFFIX' : '.cc',
+ 'F77' : 'g77',
+ 'F77FLAGS' : '',
+ 'F77COM' : '$F77 $F77FLAGS $_INCFLAGS -c -o $TARGET $SOURCES',
+ 'F77PPCOM' : '$F77 $F77FLAGS $CPPFLAGS $_INCFLAGS -c -o $TARGET $SOURCES',
'LINK' : '$CXX',
'LINKFLAGS' : '',
'LINKCOM' : '$LINK $LINKFLAGS -o $TARGET $SOURCES $_LIBDIRFLAGS $_LIBFLAGS',
diff --git a/src/engine/SCons/Scanner/C.py b/src/engine/SCons/Scanner/C.py
index 8d4497c..0a2654e 100644
--- a/src/engine/SCons/Scanner/C.py
+++ b/src/engine/SCons/Scanner/C.py
@@ -44,10 +44,12 @@ include_re = re.compile('^[ \t]*#[ \t]*include[ \t]+(<|")([\\w./\\\\]+)(>|")', r
include_cache = {}
def CScan(fs = SCons.Node.FS.default_fs):
- "Return a prototype Scanner instance for scanning C/C++ source files"
+ """Return a prototype Scanner instance for scanning source files
+ that use the C pre-processor"""
cs = CScanner(scan, "CScan", [fs, ()],
[".c", ".C", ".cxx", ".cpp", ".c++", ".cc",
- ".h", ".H", ".hxx", ".hpp", ".hh"])
+ ".h", ".H", ".hxx", ".hpp", ".hh",
+ ".F", ".fpp", ".FPP"])
cs.fs = fs
return cs