Try to make sure the config test script is installed.
authorMichael Goddard <michael.goddard@nokia.com>
Mon, 25 Jul 2011 12:07:54 +0000 (22:07 +1000)
committerQt by Nokia <qt-info@nokia.com>
Tue, 26 Jul 2011 11:40:07 +0000 (13:40 +0200)
And try to fail a bit more gracefully if it isn't.

Change-Id: I62e01c0536aa0a032940d6a9a5ccf5edcfeef221
Reviewed-on: http://codereview.qt.nokia.com/2109
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Reviewed-by: Michael Goddard <michael.goddard@nokia.com>
bin/syncqt
configure
qtbase.pro
tools/configure/configureapp.cpp

index 0c22cf8..0dcbc4d 100755 (executable)
@@ -1320,10 +1320,18 @@ if($check_includes) {
 
 # Do configure tests now (pass some things along)
 # fatal tests have a non zero return
-unless ($showonly) {
+# If the generator is not set (e.g. someone invoking syncqt as part of configure etc, then don't run tests either)
+unless ($showonly || $makefile_generator eq '') {
     my $configtests = dirname($0)."/qtmodule-configtests";
-    if (system($EXECUTABLE_NAME, $configtests, $basedir, $out_basedir, $qtbasedir, $makefile_generator)) {
-          die "$configtests exited with status $?";
+    if (! -f $configtests) {
+        $configtests = $qtbasedir."/bin/qtmodule-configtests";
+    }
+    if (! -f $configtests) {
+        warn "Unable to locate qtmodule-configtests script - config tests disabled.\n";
+    } else {
+        if (system($EXECUTABLE_NAME, $configtests, $basedir, $out_basedir, $qtbasedir, $makefile_generator)) {
+            die "$configtests exited with status $?";
+        }
     }
 }
 
index 35aea29..2bd5c06 100755 (executable)
--- a/configure
+++ b/configure
@@ -2577,7 +2577,7 @@ if [ "$OPT_SHADOW" = "yes" ]; then
         chmod 755 "$outpath/bin/syncqt"
     fi
 
-    for i in elf2e32_qtwrapper createpackage patch_capabilities; do
+    for i in elf2e32_qtwrapper createpackage patch_capabilities qtmodule-configtests; do
         rm -f "$outpath/bin/$i"
         if [ -x "$relpath/bin/$i" ]; then
             mkdir -p "$outpath/bin"
index ecbb183..c28bc93 100644 (file)
@@ -135,6 +135,11 @@ syncqt.files=$$QT_BUILD_TREE/bin/syncqt
 win32:syncqt.files=$$QT_BUILD_TREE/bin/syncqt.bat
 INSTALLS += syncqt
 
+#qtmodule-configtests
+configtests.path=$$[QT_INSTALL_BINS]
+configtests.files=$$QT_BUILD_TREE/bin/qtmodule-configtests
+INSTALLS += configtests
+
 #mkspecs
 mkspecs.path=$$[QT_INSTALL_DATA]/mkspecs
 mkspecs.files=$$QT_BUILD_TREE/mkspecs/qconfig.pri $$files($$QT_SOURCE_TREE/mkspecs/*)
index 698b6a3..f76b993 100644 (file)
@@ -221,6 +221,12 @@ Configure::Configure(int& argc, char** argv)
             createpackage_bat.close();
         }
 
+        QFile configtests(buildPath + "/bin/qtmodule-configtests");
+        if (configtests.open(QFile::WriteOnly)) {
+            QTextStream stream(&configtests);
+            stream << "#!/usr/bin/perl -w" << endl
+                   << "require \"" << sourcePath + "/bin/qtmodule-configtests\";" << endl;
+        }
         // For Windows CE and shadow builds we need to copy these to the
         // build directory.
         QFile::copy(sourcePath + "/bin/setcepaths.bat" , buildPath + "/bin/setcepaths.bat");