From b4790f30d62b00bd1a91ca9de78b3c5738de5fd1 Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Mon, 16 Nov 2009 11:48:32 +0100 Subject: Make SSE/SSE2 and 3dnow autodetectable with mingw by configure.exe Mingw-g++ 4.4 supports those SIMD instructions --- tools/configure/configureapp.cpp | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index 735e030..7e3182e 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -1853,8 +1853,16 @@ bool Configure::findFile( const QString &fileName ) QString paths; if (file.endsWith(".h")) { - if (!mingwPath.isNull() && !findFileInPaths(file, mingwPath + QLatin1String("/../include")).isNull()) - return true; + if (!mingwPath.isNull()) { + if (!findFileInPaths(file, mingwPath + QLatin1String("/../include")).isNull()) + return true; + //now let's try the additional compiler path + QDir mingwLibDir = mingwPath + QLatin1String("/../lib/gcc/mingw32"); + foreach(const QFileInfo &version, mingwLibDir.entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot)) { + if (!findFileInPaths(file, version.absoluteFilePath() + QLatin1String("/include")).isNull()) + return true; + } + } paths = QString::fromLocal8Bit(getenv("INCLUDE")); } else if ( file.endsWith( ".lib" ) || file.endsWith( ".a" ) ) { if (!mingwPath.isNull() && !findFileInPaths(file, mingwPath + QLatin1String("/../lib")).isNull()) @@ -1991,11 +1999,11 @@ bool Configure::checkAvailability(const QString &part) else if (part == "DIRECTSHOW") available = (dictionary[ "ARCHITECTURE" ] == "windowsce"); else if (part == "SSE2") - available = (dictionary.value("QMAKESPEC") != "win32-msvc") && (dictionary.value("QMAKESPEC") != "win32-g++"); + available = (dictionary.value("QMAKESPEC") != "win32-msvc"); else if (part == "3DNOW" ) - available = (dictionary.value("QMAKESPEC") != "win32-msvc") && (dictionary.value("QMAKESPEC") != "win32-icc") && findFile("mm3dnow.h") && (dictionary.value("QMAKESPEC") != "win32-g++"); + available = (dictionary.value("QMAKESPEC") != "win32-msvc") && (dictionary.value("QMAKESPEC") != "win32-icc") && findFile("mm3dnow.h"); else if (part == "MMX" || part == "SSE") - available = (dictionary.value("QMAKESPEC") != "win32-msvc") && (dictionary.value("QMAKESPEC") != "win32-g++"); + available = (dictionary.value("QMAKESPEC") != "win32-msvc"); else if (part == "OPENSSL") available = findFile("openssl\\ssl.h"); else if (part == "DBUS") -- cgit v0.12