diff options
author | Steven Knight <knight@baldmt.com> | 2002-04-22 22:34:14 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2002-04-22 22:34:14 (GMT) |
commit | 094f305d5d6e668a8273b1efc67d89e2414314f6 (patch) | |
tree | 1a030795e86f42558436373081ff06a3b1ad6b9f /src | |
parent | 7a20266245e3cccfbec62c01ee62c037ec13d162 (diff) | |
download | SCons-094f305d5d6e668a8273b1efc67d89e2414314f6.zip SCons-094f305d5d6e668a8273b1efc67d89e2414314f6.tar.gz SCons-094f305d5d6e668a8273b1efc67d89e2414314f6.tar.bz2 |
Treat .c (lower case) and .C (upper case) files the same on case-insensitive systems.
Diffstat (limited to 'src')
-rw-r--r-- | src/CHANGES.txt | 3 | ||||
-rw-r--r-- | src/engine/SCons/Defaults.py | 30 |
2 files changed, 27 insertions, 6 deletions
diff --git a/src/CHANGES.txt b/src/CHANGES.txt index b7b07e4..60c4425 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -77,6 +77,9 @@ RELEASE 0.07 - - Fix F77 command-line options on Win32 (use /Fo instead of -o). + - Use the same action to build from .c (lower case) and .C (upper + case) files on case-insensitive systems like Win32. + From Steve Leblanc: - Add the SConscriptChdir() method. diff --git a/src/engine/SCons/Defaults.py b/src/engine/SCons/Defaults.py index 6acf4de..ac04d9a 100644 --- a/src/engine/SCons/Defaults.py +++ b/src/engine/SCons/Defaults.py @@ -101,6 +101,8 @@ CXXFile = SCons.Builder.Builder(name = 'CXXFile', emitter = yaccEmitter, suffix = '$CXXFILESUFFIX') +CAction = SCons.Action.Action("$CCCOM") +ShCAction = SCons.Action.Action("$SHCCCOM") CXXAction = SCons.Action.Action("$CXXCOM") ShCXXAction = SCons.Action.Action("$SHCXXCOM") F77Action = SCons.Action.Action("$F77COM") @@ -108,30 +110,46 @@ ShF77Action = SCons.Action.Action("$SHF77COM") F77PPAction = SCons.Action.Action("$F77PPCOM") ShF77PPAction = SCons.Action.Action("$SHF77PPCOM") -shared_obj = SCons.Builder.DictCmdGenerator({ ".C" : ShCXXAction, +if os.path.normcase('.c') == os.path.normcase('.C'): + # We're on a case-insensitive system, so .[CF] (upper case) + # files should be treated like .[cf] (lower case) files. + C_static = CAction + C_shared = ShCAction + F_static = F77Action + F_shared = ShF77Action +else: + # We're on a case-sensitive system, so .C (upper case) files + # are C++, and .F (upper case) files get run through the C + # preprocessor. + C_static = CXXAction + C_shared = ShCXXAction + F_static = F77PPAction + F_shared = ShF77PPAction + +shared_obj = SCons.Builder.DictCmdGenerator({ ".C" : C_shared, ".cc" : ShCXXAction, ".cpp" : ShCXXAction, ".cxx" : ShCXXAction, ".c++" : ShCXXAction, ".C++" : ShCXXAction, - ".c" : "$SHCCCOM", + ".c" : ShCAction, ".f" : ShF77Action, ".for" : ShF77Action, ".FOR" : ShF77Action, - ".F" : ShF77PPAction, + ".F" : F_shared, ".fpp" : ShF77PPAction, ".FPP" : ShF77PPAction }) -static_obj = SCons.Builder.DictCmdGenerator({ ".C" : CXXAction, +static_obj = SCons.Builder.DictCmdGenerator({ ".C" : C_static, ".cc" : CXXAction, ".cpp" : CXXAction, ".cxx" : CXXAction, ".c++" : CXXAction, ".C++" : CXXAction, - ".c" : "$CCCOM", + ".c" : CAction, ".f" : F77Action, ".for" : F77Action, - ".F" : F77PPAction, + ".F" : F_static, ".FOR" : F77Action, ".fpp" : F77PPAction, ".FPP" : F77PPAction }) |