Ticket #82: scons-addons-boost-py.diff
| File scons-addons-boost-py.diff, 4.1 kB (added by jsd, 2 years ago) |
|---|
-
Tools/scons-addons/src/SConsAddons/Options/Boost.py
old new 31 31 # ############################################## 32 32 class Boost(SConsAddons.Options.PackageOption): 33 33 def __init__(self, name, requiredVersion, 34 useDebug=False, useMt=True, libs=[], 34 useDebug=False, useMt=True, libs=[], useSimpleLibnames=False, 35 35 required=True, useCppPath=False, 36 36 toolset="auto", useVersion=False, 37 37 preferDynamic=True, autoLink = False): … … 48 48 autoLink - If true and using msvc, then attempt to use boost's autolinking capabilies. 49 49 """ 50 50 help_text = ["Base directory for Boost. include, and lib should be under this directory.", 51 "Include directory for boost (if not under base)."] 51 "Include directory for boost (if not under base).", 52 "Use simple Boost library names (as installed by fedora core rpms)"] 52 53 self.baseDirKey = "BoostBaseDir" 53 54 self.incDirKey = "BoostIncludeDir" 54 55 self.requiredVersion = requiredVersion 55 56 self.libVersionStr = None 56 57 self.lib_names = libs 58 self.useSimpleLibnames = useSimpleLibnames 59 self.simpleLibnamesKey = "BoostSimpleLibnames" 57 60 self.required = required 58 61 self.useCppPath = useCppPath 59 62 self.toolset = toolset … … 62 65 if sca_util.GetPlatform() != "win32": 63 66 self.autoLink = False 64 67 SConsAddons.Options.PackageOption.__init__(self, name, 65 [self.baseDirKey, self.incDirKey], 68 [self.baseDirKey, self.incDirKey, 69 self.simpleLibnamesKey], 66 70 help_text) 67 71 self.available = False # Track availability 68 72 … … 143 147 debug_ext = "-d" 144 148 if sca_util.GetPlatform() == "win32": 145 149 debug_ext = "-gd" # Hack for now assuming debug code and runtime 146 if sca_util.GetPlatform() != 'darwin' :150 if sca_util.GetPlatform() != 'darwin' and not self.useSimpleLibnames: 147 151 fullname = fullname + "-" + self.toolset 148 152 if self.use_mt: 149 153 fullname += "-mt" … … 158 162 elif useDebug is True: 159 163 fullname += debug_ext 160 164 161 162 165 if self.use_ver and self.libVersionStr is not None: 163 166 fullname += "-" + self.libVersionStr 164 167 165 168 return fullname 166 169 167 170 def startProcess(self): 168 171 """ Called at beginning of processing. Perform any intialization or notification here. """ 169 172 print "Updating ", self.name … … 177 180 if optDict.has_key(self.incDirKey): 178 181 self.incDir = optDict[self.incDirKey] 179 182 print " %s specified or cached. [%s]."% (self.incDirKey, self.incDir) 180 183 if optDict.has_key(self.simpleLibnamesKey): 184 self.useSimpleLibnames = optDict[self.simpleLibnamesKey] 185 print " %s specified or cached. [%s]."% (self.simpleLibnamesKey, self.useSimpleLibnames) 186 181 187 def find(self, env): 182 188 """ If base dir was not specified, attempt to find boost 183 189 using some very basic searches. … … 445 451 env.AppendUnique(CXXFLAGS = ['-fvisibility=hidden', '-fvisibility-inlines-hidden']) 446 452 447 453 def getSettings(self): 448 return [(self.baseDirKey, self.baseDir), (self.incDirKey, self.incDir)] 454 return [(self.baseDirKey, self.baseDir), 455 (self.incDirKey, self.incDir), 456 (self.simpleLibnamesKey, self.useSimpleLibnames)] 449 457 450 458 def dumpSettings(self,env=None): 451 459 "Write out the settings" 452 460 print "BoostBaseDir:", self.baseDir 453 461 print "BoostIncludeDir:", self.incDir 462 print "BoostSimpleLibnames:", self.useSimpleLibnames 454 463 print "CPPPATH (as flags):", self.found_incs_as_flags 455 464 print "CPPDEFINES:", self.found_defines 456 465 print "LIBS:", self.lib_names
