[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: qt-copy link problems in HEAD
From:       Harri Porten <porten () trolltech ! com>
Date:       2003-05-24 10:54:39
[Download RAW message or body]

On Sat, 24 May 2003, Unai Garro Arrazola wrote:

> I just updated qt-copy from cvs head, but it doesn't seem to link cleanly. It 
> tries to link against libGL.la and I get errors as:

Could you please try the attached patch and tell me whether it helped ? 
Apply with

  patch -p0 < qmake.diff 

from within the $QTDIR/qmake directory.

Harri.

["qmake.diff" (TEXT/PLAIN)]

Index: meta.cpp
===================================================================
RCS file: /home/kde/qt-copy/qmake/meta.cpp,v
retrieving revision 1.1
diff -u -3 -p -r1.1 meta.cpp
--- meta.cpp	16 May 2003 13:02:30 -0000	1.1
+++ meta.cpp	24 May 2003 10:51:58 -0000
@@ -73,7 +73,7 @@ QMakeMetaInfo::readLibtoolFile(const QSt
     QMakeProject proj;
     if(!proj.read(Option::fixPathToLocalOS(f), QDir::currentDirPath(), QMakeProject::ReadProFile))
 	return FALSE;
-    QString dirf = Option::fixPathToTargetOS(f).section(Option::dir_sep, 0, -1);
+    QString dirf = Option::fixPathToTargetOS(f).section(Option::dir_sep, 0, -2);
     if(dirf == f)
 	dirf = "";
     else if(!dirf.isEmpty() && !dirf.endsWith(Option::output_dir))
@@ -87,27 +87,38 @@ QMakeMetaInfo::readLibtoolFile(const QSt
 	if(!vars.contains("QMAKE_PRL_TARGET") &&
 	   (it.key() == "dlname" || it.key() == "library_names" || it.key() == "old_library")) {
 	    QString dir = v["libdir"].first();
-	    if(dir.startsWith("'") || dir.startsWith("\"") && dir.endsWith(QString(dir[0])))
+	    if((dir.startsWith("'") || dir.startsWith("\"")) && dir.endsWith(QString(dir[0])))
 		dir = dir.mid(1, dir.length() - 2);
+	    dir = dir.stripWhiteSpace();
 	    if(!dir.isEmpty() && !dir.endsWith(Option::dir_sep))
 		dir += Option::dir_sep;
 	    if(lst.count() == 1)
 		lst = QStringList::split(" ", lst.first());
 	    for(QStringList::Iterator lst_it = lst.begin(); lst_it != lst.end(); ++lst_it) {
-		if(QFile::exists(Option::fixPathToLocalOS(dir + (*lst_it)))) {
-		    vars["QMAKE_PRL_TARGET"] << dir + (*lst_it);
-		    break;
-		} else if(QFile::exists(Option::fixPathToLocalOS(dirf + (*lst_it)))) {
-		    vars["QMAKE_PRL_TARGET"] << dirf + (*lst_it);
-		    break;
-		} else if(QFile::exists(Option::fixPathToLocalOS(dirf + ".libs" + Option::dir_sep + 
-								 (*lst_it)))) {
-		    vars["QMAKE_PRL_TARGET"] << dirf + ".libs" + Option::dir_sep + (*lst_it);
-		    break;
+		bool found = FALSE;
+		QString dirs[] = { "", dir, dirf, dirf + ".libs" + QDir::separator(), "(term)" };
+		for(int i = 0; !found && dirs[i] != "(term)"; i++) {
+		    if(QFile::exists(dirs[i] + (*lst_it))) {
+			QString targ = dirs[i] + (*lst_it);
+			if(QDir::isRelativePath(targ)) 
+			    targ.prepend(QDir::currentDirPath() + QDir::separator());
+			vars["QMAKE_PRL_TARGET"] << targ;
+			found = TRUE;
+		    }
 		}
+		if(found)
+ 		    break;
 	    }
 	} else if(it.key() == "dependency_libs") {
-	    vars["QMAKE_PRL_LIBS"] += lst;
+	    QStringList &libs = vars["QMAKE_PRL_LIBS"];
+	    if(lst.count() == 1) {
+		QString dep = lst.first();
+		if((dep.startsWith("'") || dep.startsWith("\"")) && dep.endsWith(QString(dep[0])))
+		    dep = dep.mid(1, dep.length() - 2);
+		libs += QStringList::split(" ", dep.stripWhiteSpace());
+	    } else {
+		libs += lst;
+	    }
 	}
     }
     return TRUE;
Index: generators/makefile.cpp
===================================================================
RCS file: /home/kde/qt-copy/qmake/generators/makefile.cpp,v
retrieving revision 1.25
diff -u -3 -p -r1.25 makefile.cpp
--- generators/makefile.cpp	16 May 2003 13:02:30 -0000	1.25
+++ generators/makefile.cpp	24 May 2003 10:51:58 -0000
@@ -1237,7 +1237,9 @@ MakefileGenerator::processPrlFile(QStrin
 		    int slsh = real_meta_file.findRev(Option::dir_sep);
 		    if(slsh != -1)
 			dir = real_meta_file.left(slsh+1);
-		    file = dir + libinfo.first("QMAKE_PRL_TARGET");
+		    file = libinfo.first("QMAKE_PRL_TARGET");
+		    if(QDir::isRelativePath(file))
+			file.prepend(dir);
 		}
 	    }
 	}


>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic