]> git.lyx.org Git - features.git/commitdiff
Scons: support boost 1.34
authorBo Peng <bpeng@lyx.org>
Sat, 16 Dec 2006 23:31:15 +0000 (23:31 +0000)
committerBo Peng <bpeng@lyx.org>
Sat, 16 Dec 2006 23:31:15 +0000 (23:31 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16305 a592a061-630c-0410-9148-cb99ea01b6c8

development/scons/SConstruct
development/scons/scons_utils.py

index b3d1bc387d820643ddc3c089c7b3e13674ce3a2f..cd8d509ed9dabae6911e8200b0cc0c137cccb561 100644 (file)
@@ -54,7 +54,7 @@ top_src_dir = os.path.split(os.path.split(default_fs.SConstruct_dir.abspath)[0])
 # not have to change SConstruct during lyx release
 package_version = utils.getVerFromConfigure(top_src_dir)
 package_cygwin_version = '%s-1' % package_version
-boost_version = '1_33_1'
+boost_version = ['1_33_1', '1_34']
 
 if 'svn' in package_version:
     devel_version = True
index 203a39a513a5a27a84bf51cbe4744215d4f193c7..1e9cde59fb19c9cc81f25d98325b1f4f6aceea0d 100644 (file)
@@ -158,12 +158,12 @@ int main()
     return ('int', 'int *', 'struct timeval *')
 
 
-def checkBoostLibraries(conf, libs, lib_paths, inc_paths, version, isDebug):
+def checkBoostLibraries(conf, libs, lib_paths, inc_paths, versions, isDebug):
     ''' look for boost libraries
       libs: library names
       lib_paths: try these paths for boost libraries
       inc_paths: try these paths for boost headers
-      version:   required boost version
+      versions:   supported boost versions
       isDebug:   if true, use debug libraries
     '''
     conf.Message('Checking for boost library %s... ' % ', '.join(libs))
@@ -188,13 +188,18 @@ def checkBoostLibraries(conf, libs, lib_paths, inc_paths, version, isDebug):
             if len(files) > 0:
                 # runtime code includes s,g,y,d,p,n, where we should look for
                 # d,g,y for debug, s,p,n for release
+                lib_files = []
                 if isDebug:
-                    lib_files = filter(lambda x: re.search('libboost_%s-\w+-mt-[^spn]+-%s.a' % (lib, version), x), files)
+                    for ver in versions:
+                        lib_files += filter(lambda x: re.search('libboost_%s-\w+-mt-[^spn]+-%s.a' % (lib, ver), x), files)
                 else:
-                    lib_files = filter(lambda x: re.search('libboost_%s-\w+-mt-([^dgy]+-)*%s.a' % (lib, version), x), files)
+                    for ver in versions:
+                        lib_files += filter(lambda x: re.search('libboost_%s-\w+-mt-([^dgy]+-)*%s.a' % (lib, ver), x), files)
                 if len(lib_files) == 0:
                     print 'Warning: Can not find an appropriate boost library in %s.' % path
-                    lib_files = filter(lambda x: re.search('libboost_%s-[\w-]+%s.a' % (lib, version), x), files)
+                    print 'Allowed versions are ', ', '.join(versions)
+                    for ver in versions:
+                        lib_files += filter(lambda x: re.search('libboost_%s-[\w-]+%s.a' % (lib, ver), x), files)
                     if len(lib_files) > 0:
                         print 'Use library %s' % lib_files[0]
                 if len(lib_files) > 0:
@@ -209,9 +214,12 @@ def checkBoostLibraries(conf, libs, lib_paths, inc_paths, version, isDebug):
         return (None, None, None)
     # check version number in boost/version.hpp
     def isValidBoostDir(dir):
-        file = os.path.join(dir, 'boost', 'version.hpp')
-        version_string = '#define BOOST_LIB_VERSION "%s"' % version
-        return os.path.isfile(file) and version_string in open(file).read()
+        version_file = os.path.join(dir, 'boost', 'version.hpp')
+        if not os.path.isfile(version_file):
+            return False
+        version_file_content = open(version_file).read()
+        version_strings = ['#define BOOST_LIB_VERSION "%s"' % ver for ver in versions]
+        return True in [x in version_file_content for x in version_strings]
     # check for boost header file
     for path in inc_paths:
         if isValidBoostDir(path):
@@ -225,6 +233,7 @@ def checkBoostLibraries(conf, libs, lib_paths, inc_paths, version, isDebug):
     # return result
     if found_inc:
         conf.Result('yes')
+        print 'Using boost libraries', ', '.join(lib_names)
         return (lib_names, lib_path, inc_path)
     else:
         conf.Result('no')