Hi All,
I have a small patch for scons-addons (attached) that falls back to the
non-toolset, non-mt versions if it can't find the fully qualified ones. There is
a potential problem with multi-threaded programs doing that, but we haven't seen
any actual problems, just as a warning. I sent the patch to the scons-addons
maintainers, but they're a little busy right now, so if somebody wants to try
it, please let me know how it works for you. It seems to work ok on my FC5 box.
Yours
Dirk
Index: src/SConsAddons/Options/Boost.py
===================================================================
--- src/SConsAddons/Options/Boost.py (revision 245)
+++ src/SConsAddons/Options/Boost.py (working copy)
@@ -71,6 +71,8 @@
self.found_lib_paths = []
self.found_defines = []
+ self.found_libs = {} # Names of actual libraries found (with or without toolset etc.)
+
# configurable options
self.baseDir = None
self.incDir = None
@@ -198,8 +200,12 @@
print " Searching CPLUS_INCLUDE_PATH..."
ver_header = SCons.Script.SConscript.FindFile(pj('boost', 'version.hpp'),
string.split(env['ENV']['CPLUS_INCLUDE_PATH'], os.pathsep))
-
+
if None == ver_header:
+ print " Searching /usr/include..."
+ ver_header = env.FindFile(pj('boost','version.hpp'), '/usr/include')
+
+ if None == ver_header:
self.checkRequired(" could not find boost/version.hpp.")
else:
ver_header = str(ver_header)
@@ -330,10 +336,10 @@
######## BUILD CHECKS ###########
# --- Check building against libraries --- #
- # For each library, find cononical lib name and associated header to check
+ # For each library, find canonical lib name and associated header to check
# default to checking lib with config.hpp
- for libname in self.lib_names:
- full_libname = self.buildFullLibName(libname,env)
+
+ def check_lib(libname,lib_filename,env):
header_to_check = 'boost/config.hpp'
if self.headerMap.has_key(libname):
header_to_check = self.headerMap[libname]
@@ -341,28 +347,45 @@
# Create config environment
# - Need to extend the environment
conf_env = env.Copy()
+
conf_env.Append(CPPPATH= self.found_incs,
LIBPATH = self.found_lib_paths,
CPPDEFINES = self.found_defines)
if "python" == libname:
conf_env.Append(CPPPATH = self.python_inc_dir,
LIBPATH = self.python_lib_path,
- #LIBS = [full_libname,] + self.python_extra_libs
+ #LIBS = [lib_filename,] + self.python_extra_libs
LIBS = self.python_extra_libs
)
# Thread library needs some additional libraries on Linux... (yuck)
if "thread" == libname:
- conf_env.Append(LIBS = [full_libname,] + self.thread_extra_libs)
+ conf_env.Append(LIBS = [lib_filename,] + self.thread_extra_libs)
conf_ctxt = Configure(conf_env)
- result = conf_ctxt.CheckLibWithHeader(full_libname, header_to_check, "c++")
-
+ result = conf_ctxt.CheckLibWithHeader(lib_filename, header_to_check, "c++")
+ conf_ctxt.Finish()
+
+ return result, header_to_check
+
+ for libname in self.lib_names:
+ full_libname = self.buildFullLibName(libname,env)
+
+ result, header_to_check = check_lib(libname, full_libname, env)
+
if not result:
+ print " Full version (%s) not found trying without toolset and mt..." % full_libname
+ result, header_to_check = check_lib(libname, "boost_" + libname, env)
+ if result:
+ self.found_libs[libname] = "boost_" + libname
+ print "Found %s without toolset and mt\n***WARNING: This could be a lib without multi-threading support. Use with care in a multi-threaded program!" % libname
+ else:
+ self.found_libs[libname] = full_libname
+
+ if not result:
passed = False
self.checkRequired("Can't compile test program: lib: %s full_lib: %s header:%s"%(libname,full_libname,header_to_check))
- conf_ctxt.Finish()
# --- Handle final settings ---- #
if not passed:
@@ -393,7 +416,7 @@
env.AppendUnique(CPPDEFINES = self.found_defines,
LIBPATH = self.found_lib_paths)
if not self.autoLink:
- full_libs = [self.buildFullLibName(l,env, useDebug) for l in self.lib_names if 'python' != l]
+ full_libs = [self.found_libs[l] for l in self.lib_names if 'python' != l]
env.AppendUnique(LIBS = full_libs)
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users