Scons: load qt4 module with debug=False when the debug library is not available; modify boost/check warning message

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16323 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Bo Peng 2006-12-18 15:30:50 +00:00
parent e5b8f69561
commit cd43719f96
2 changed files with 12 additions and 3 deletions

View File

@ -697,13 +697,17 @@ if frontend == 'qt4':
if mode == 'debug' and use_vc and \ if mode == 'debug' and use_vc and \
conf.CheckLibWithHeader('QtCored4', 'QtGui/QApplication', 'c++', 'QApplication qapp();'): conf.CheckLibWithHeader('QtCored4', 'QtGui/QApplication', 'c++', 'QApplication qapp();'):
qt_lib_suffix = 'd4' qt_lib_suffix = 'd4'
use_qt_debug_libs = True
else: else:
qt_lib_suffix = '4' qt_lib_suffix = '4'
use_qt_debug_libs = False
else: else:
if mode == 'debug' and conf.CheckLibWithHeader('QtCore_debug', 'QtGui/QApplication', 'c++', 'QApplication qapp();'): if mode == 'debug' and conf.CheckLibWithHeader('QtCore_debug', 'QtGui/QApplication', 'c++', 'QApplication qapp();'):
qt_lib_suffix = '_debug' qt_lib_suffix = '_debug'
use_qt_debug_libs = True
else: else:
qt_lib_suffix = '' qt_lib_suffix = ''
use_qt_debug_libs = False
frontend_libs = [x + qt_lib_suffix for x in qt_libs] frontend_libs = [x + qt_lib_suffix for x in qt_libs]
qtcore_lib = ['QtCore' + qt_lib_suffix] qtcore_lib = ['QtCore' + qt_lib_suffix]
@ -1699,7 +1703,7 @@ if build_qt4:
# process .C file!!! (add to cxx_suffixes ) # process .C file!!! (add to cxx_suffixes )
# #
qt4env.Tool('qt4', [scons_dir]) qt4env.Tool('qt4', [scons_dir])
qt4env.EnableQt4Modules(qt_libs, debug = (mode == 'debug')) qt4env.EnableQt4Modules(qt_libs, debug = (mode == 'debug' and use_qt_debug_libs))
qt4env['QT4_AUTOSCAN'] = 0 qt4env['QT4_AUTOSCAN'] = 0
qt4env['QT4_UICDECLFLAGS'] = '-tr lyx::qt_' qt4env['QT4_UICDECLFLAGS'] = '-tr lyx::qt_'

View File

@ -196,8 +196,11 @@ def checkBoostLibraries(conf, libs, lib_paths, inc_paths, versions, isDebug):
for ver in versions: for ver in versions:
lib_files += filter(lambda x: re.search('libboost_%s-\w+-mt-([^dgy]+-)*%s.a' % (lib, ver), x), files) lib_files += filter(lambda x: re.search('libboost_%s-\w+-mt-([^dgy]+-)*%s.a' % (lib, ver), x), files)
if len(lib_files) == 0: if len(lib_files) == 0:
print 'Warning: Can not find an appropriate boost library in %s.' % path if isDebug:
print 'Allowed versions are ', ', '.join(versions) print 'Failed to find the debug version of boost', ' or '.join(versions)
else:
print 'Failed to find the release version of boost', ' or '.join(versions)
# use alternative libraries
for ver in versions: for ver in versions:
lib_files += filter(lambda x: re.search('libboost_%s-[\w-]+%s.a' % (lib, ver), x), files) lib_files += filter(lambda x: re.search('libboost_%s-[\w-]+%s.a' % (lib, ver), x), files)
if len(lib_files) > 0: if len(lib_files) > 0:
@ -205,6 +208,8 @@ def checkBoostLibraries(conf, libs, lib_paths, inc_paths, versions, isDebug):
if len(lib_files) > 0: if len(lib_files) > 0:
# get xxx-gcc-1_33_1 from /usr/local/lib/libboost_xxx-gcc-1_33_1.a # get xxx-gcc-1_33_1 from /usr/local/lib/libboost_xxx-gcc-1_33_1.a
lib_names.append(lib_files[0].split(os.sep)[-1][3:-2]) lib_names.append(lib_files[0].split(os.sep)[-1][3:-2])
else:
break
if len(lib_names) == len(libs): if len(lib_names) == len(libs):
found_lib = True found_lib = True
lib_path = path lib_path = path