]> git.lyx.org Git - features.git/commitdiff
Scons: test for the availability of debug version of qt libraries before linking...
authorBo Peng <bpeng@lyx.org>
Sat, 16 Dec 2006 20:16:34 +0000 (20:16 +0000)
committerBo Peng <bpeng@lyx.org>
Sat, 16 Dec 2006 20:16:34 +0000 (20:16 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16304 a592a061-630c-0410-9148-cb99ea01b6c8

development/scons/SConstruct

index 4a72e08be8d5868b02bbc7f6c2962211220b1dbf..b3d1bc387d820643ddc3c089c7b3e13674ce3a2f 100644 (file)
@@ -682,23 +682,31 @@ if frontend == 'qt4':
     if not succ:
         # Under linux, I can test the following perfectly
         # Under windows, lib names need to passed as libXXX4.a ...
-        succ = conf.CheckLibWithHeader('QtCore', 'QtGui/QApplication', 'c++', 'QApplication qapp();') or \
-            conf.CheckLibWithHeader('QtCore4', 'QtGui/QApplication', 'c++', 'QApplication qapp();')
-    # third: try to look up the path
-    if not succ:
-        succ = True
-        for lib in ['QtCore', 'QtGui']:
-            # windows version has something like QtGui4 ...
-            if not (os.path.isfile(os.path.join(qt_lib_path, 'lib%s.a' % lib)) or \
-                os.path.isfile(os.path.join(qt_lib_path, 'lib%s4.a' % lib))):
-                succ = False
-                break
+        if platform_name == 'win32' and use_vc:
+            succ = conf.CheckLibWithHeader('QtCore4', 'QtGui/QApplication', 'c++', 'QApplication qapp();')
+        else:
+            succ = conf.CheckLibWithHeader('QtCore', 'QtGui/QApplication', 'c++', 'QApplication qapp();')
     # still can not find it
-    if succ:
-        print "Qt4 libraries are found."
-    else:
+    if not succ:
         print 'Did not find qt libraries, exiting!'
         Exit(1)
+    #
+    # Now, determine the correct suffix:
+    qt_libs = ['QtCore', 'QtGui']
+    if platform_name == 'win32':
+        if mode == 'debug' and use_vc and \
+            conf.CheckLibWithHeader('QtCored4', 'QtGui/QApplication', 'c++', 'QApplication qapp();'):
+            qt_lib_suffix = 'd4'
+        else:
+            qt_lib_suffix = '4'
+    else:
+        if mode == 'debug' and conf.CheckLibWithHeader('QtCore_debug', 'QtGui/QApplication', 'c++', 'QApplication qapp();'):
+            qt_lib_suffix = '_debug'
+        else:
+            qt_lib_suffix = ''
+    frontend_libs = [x + qt_lib_suffix for x in qt_libs]
+    qtcore_lib = ['QtCore' + qt_lib_suffix]
+    
 
 # now, if msvc2005 is used, we will need that QT_LIB_PATH/QT_LIB.manifest file
 if use_vc:
@@ -1278,26 +1286,6 @@ env = conf.Finish()
 # Now set up our build process accordingly
 #----------------------------------------------------------
 
-#
-# QT_LIB
-#
-# NOTE: Tool('qt') or Tool('qt4') will be loaded later
-# in their respective directory and specialized env.
-if frontend == 'qt4':
-    qt_libs = ['QtCore', 'QtGui']
-    # set the right lib names
-    if platform_name == 'win32':
-        if mode == 'debug' and use_vc:
-            qt_lib_suffix = 'd4'
-        else:
-            qt_lib_suffix = '4'
-    else:
-        if mode == 'debug':
-            qt_lib_suffix = '_debug'
-        else:
-            qt_lib_suffix = ''
-    frontend_libs = [x + qt_lib_suffix for x in qt_libs]
-    qtcore_lib = ['QtCore' + qt_lib_suffix]
 
 
 if env['ICONV_LIB'] is None: