configure: Pick up environment paths again on MinGW
authorKai Koehne <kai.koehne@digia.com>
Wed, 7 Nov 2012 11:14:33 +0000 (12:14 +0100)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Wed, 7 Nov 2012 13:19:00 +0000 (14:19 +0100)
Make sure that INCLUDE, LIB paths are again considered in configure
checks on MinGW. While gcc itself doesn't care about the variables,
qmake automatically adds them via -I, -L...

This broke with 9c2ec72b95c13991f3.

Change-Id: Ic6214eeea9eb7c92961c37c3aa76c4fcaddb22b6
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
tools/configure/environment.cpp

index 2d44bdb..8317043 100644 (file)
@@ -599,9 +599,10 @@ QStringList Environment::headerPaths(Compiler compiler)
             foreach (const QFileInfo &version, mingwLibDir.entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot))
                 headerPaths += version.absoluteFilePath() + QLatin1String("/include");
         }
-    } else {
-        headerPaths = splitPathList(QString::fromLocal8Bit(getenv("INCLUDE")));
     }
+    // MinGW: Although gcc doesn't care about INCLUDE, qmake automatically adds it via -I
+    headerPaths += splitPathList(QString::fromLocal8Bit(getenv("INCLUDE")));
+
     // Add Direct X SDK for ANGLE
     const QString directXSdk = detectDirectXSdk();
     if (!directXSdk.isEmpty()) // Add Direct X SDK for ANGLE
@@ -614,9 +615,10 @@ QStringList Environment::libraryPaths(Compiler compiler)
     QStringList libraryPaths;
     if (compiler == CC_MINGW) {
         libraryPaths = mingwPaths(detectMinGW(), "lib");
-    } else {
-        libraryPaths = splitPathList(QString::fromLocal8Bit(qgetenv("LIB")));
     }
+    // MinGW: Although gcc doesn't care about LIB, qmake automatically adds it via -L
+    libraryPaths += splitPathList(QString::fromLocal8Bit(qgetenv("LIB")));
+
     // Add Direct X SDK for ANGLE
     const QString directXSdk = detectDirectXSdk();
     if (!directXSdk.isEmpty()) {