Index: trunk/qmake/generators/makefile.cpp
===================================================================
--- trunk/qmake/generators/makefile.cpp	(revision 356)
+++ trunk/qmake/generators/makefile.cpp	(revision 362)
@@ -125,5 +125,5 @@
     }
     bool ret = true;
-#if defined(Q_OS_WIN) || defined(Q_OS_OS2)
+#if defined(Q_OS_WIN)
     bool driveExists = true;
     if(!QDir::isRelativePath(path)) {
@@ -138,4 +138,11 @@
     }
     if(driveExists)
+#elif defined(Q_OS_OS2)
+    path = QFileInfo(path).absoluteFilePath();
+    QString drv = path.left(3);
+    if (!QFile::exists(drv))
+        warn_msg(WarnLogic, "Cannot access drive '%s' (%s)",
+                 drv.toLocal8Bit().data(), path.toLocal8Bit().data());
+    else
 #endif
     {
@@ -341,12 +348,8 @@
                         vpath += Option::output_dir;
                 }
-                for(QStringList::Iterator vpath_it = vpath.begin();
-                    vpath_it != vpath.end(); ++vpath_it) {
-                    QString real_dir = Option::fixPathToLocalOS((*vpath_it));
-                    if(exists(real_dir + QDir::separator() + val)) {
-                        QString dir = (*vpath_it);
-                        if(dir.right(Option::dir_sep.length()) != Option::dir_sep)
-                            dir += Option::dir_sep;
-                        val = dir + val;
+                foreach(const QString &vp, vpath) {
+                    QString real_val = QDir(vp).absoluteFilePath(val);
+                    if (exists(real_val)) {
+                        val = real_val;
                         if(!(flags & VPATH_NoFixify))
                             val = fileFixify(val);
@@ -850,5 +853,5 @@
                     file = libinfo.first("QMAKE_PRL_TARGET");
                     if(QDir::isRelativePath(file))
-                        file.prepend(dir);
+                        file = QDir(dir).absoluteFilePath(file);
                 }
             }
@@ -2782,5 +2785,5 @@
     if(fix == FileFixifyAbsolute || (fix == FileFixifyDefault && project->isActiveConfig("no_fixpath"))) {
         if(fix == FileFixifyAbsolute && QDir::isRelativePath(ret)) //already absolute
-            ret.prepend(pwd);
+            ret = QDir(pwd).absoluteFilePath(ret);
         ret = Option::fixPathToTargetOS(ret, false, canon);
     } else { //fix it..
@@ -2800,5 +2803,5 @@
         if(out_dir != in_dir || !qfileinfo.isRelative()) {
             if(qfileinfo.isRelative()) {
-                ret = in_dir + "/" + qfile;
+                ret = QDir(in_dir).absoluteFilePath(qfile);
                 qfileinfo.setFile(ret);
             }
@@ -3022,5 +3025,5 @@
         if(!file.fileName().isEmpty()) {
             if(QDir::isRelativePath(file.fileName()))
-                file.setFileName(Option::output_dir + "/" + file.fileName()); //pwd when qmake was run
+                file.setFileName(QDir(Option::output_dir).absoluteFilePath(file.fileName())); //pwd when qmake was run
             QFileInfo fi(fileInfo(file.fileName()));
             if(fi.isDir())
@@ -3035,9 +3038,5 @@
     }
     if(QDir::isRelativePath(file.fileName())) {
-        QString fname = Option::output_dir;  //pwd when qmake was run
-        if(!fname.endsWith("/"))
-            fname += "/";
-        fname += file.fileName();
-        file.setFileName(fname);
+        file.setFileName(QDir(Option::output_dir).absoluteFilePath(file.fileName())); //pwd when qmake was run
     }
     if(!build.isEmpty())
@@ -3057,5 +3056,5 @@
         od = Option::fixPathToTargetOS(od);
         if(QDir::isRelativePath(od))
-            od.prepend(Option::output_dir);
+            od = QDir(Option::output_dir).absoluteFilePath(od);
         Option::output_dir = od;
         return true;
Index: trunk/qmake/generators/makefiledeps.cpp
===================================================================
--- trunk/qmake/generators/makefiledeps.cpp	(revision 356)
+++ trunk/qmake/generators/makefiledeps.cpp	(revision 362)
@@ -625,9 +625,5 @@
                     if(try_local) {
                         QString dir = findFileInfo(file->file).path();
-                        if(QDir::isRelativePath(dir))
-                            dir.prepend(qmake_getpwd() + "/");
-                        if(!dir.endsWith("/"))
-                            dir += "/";
-                        QMakeLocalFileName f(dir + lfn.local());
+                        QMakeLocalFileName f(QDir(dir).absoluteFilePath(lfn.local()));
                         if(findFileInfo(f).exists()) {
                             lfn = fixPathForFile(f);
@@ -636,6 +632,6 @@
                     }
                     if(!exists) { //path lookup
-                        for(QList<QMakeLocalFileName>::Iterator it = depdirs.begin(); it != depdirs.end(); ++it) {
-                            QMakeLocalFileName f((*it).real() + Option::dir_sep + lfn.real());
+                        foreach(const QMakeLocalFileName &dd, depdirs) {
+                            QMakeLocalFileName f(QDir(dd.real()).absoluteFilePath(lfn.real()));
                             QFileInfo fi(findFileInfo(f));
                             if(fi.exists() && !fi.isDir()) {
Index: trunk/qmake/generators/metamakefile.cpp
===================================================================
--- trunk/qmake/generators/metamakefile.cpp	(revision 356)
+++ trunk/qmake/generators/metamakefile.cpp	(revision 362)
@@ -325,5 +325,5 @@
             sub->input_dir = subdir.absolutePath();
             if(subdir.isRelative() && old_output_dir != oldpwd) {
-                sub->output_dir = old_output_dir + "/" + subdir.path();
+                sub->output_dir = QDir(old_output_dir).absoluteFilePath(subdir.path());
                 printf("Reading %s [%s]\n", subdir.absoluteFilePath().toLatin1().constData(), sub->output_dir.toLatin1().constData());
             } else { //what about shadow builds?
Index: trunk/qmake/generators/win32/winmakefile.cpp
===================================================================
--- trunk/qmake/generators/win32/winmakefile.cpp	(revision 356)
+++ trunk/qmake/generators/win32/winmakefile.cpp	(revision 362)
@@ -246,5 +246,5 @@
                         tmp = opt;
                     for(QList<QMakeLocalFileName>::Iterator it = libdirs.begin(); it != libdirs.end(); ++it) {
-                        QString prl = (*it).local() + Option::dir_sep + tmp;
+                        QString prl = QDir((*it).local()).absoluteFilePath(tmp);
                         // the original is used as the key
                         QString orgprl = prl;
