Changeset 846 for trunk/qmake/generators/unix/unixmake.cpp
- Timestamp:
- May 5, 2011, 5:36:53 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.7.2 (added) merged: 845 /branches/vendor/nokia/qt/current merged: 844 /branches/vendor/nokia/qt/4.6.3 removed
- Property svn:mergeinfo changed
-
trunk/qmake/generators/unix/unixmake.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 201 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation ([email protected]) … … 66 66 } 67 67 68 69 70 71 68 72 if(!project->isEmpty("QMAKE_FAILED_REQUIREMENTS")) /* no point */ 69 73 return; … … 100 104 if(project->isEmpty("MAKEFILE")) 101 105 project->values("MAKEFILE").append("Makefile"); 102 if(project->isEmpty("QMAKE_QMAKE"))103 project->values("QMAKE_QMAKE").append("qmake");104 106 if(project->values("QMAKE_INTERNAL_QMAKE_DEPS").indexOf("qmake_all") == -1) 105 107 project->values("QMAKE_INTERNAL_QMAKE_DEPS").append("qmake_all"); … … 452 454 libdirs.append(f); 453 455 } else if(opt.startsWith("-l")) { 454 if (project->isActiveConfig("rvct_linker")) { 456 if (!project->isEmpty("QMAKE_RVCT_LINKSTYLE")) { 457 (*it) = opt.mid(2); 458 } else if (project->isActiveConfig("rvct_linker")) { 455 459 (*it) = "lib" + opt.mid(2) + ".so"; 456 460 } else { … … 492 496 if(!extn.isNull()) 493 497 extens << extn; 498 499 500 494 501 else 495 502 extens << project->values("QMAKE_EXTENSION_SHLIB").first() << "a"; 496 503 for(QStringList::Iterator extit = extens.begin(); extit != extens.end(); ++extit) { 497 504 if(dir.isNull()) { 498 QString lib_stub;499 505 for(QList<QMakeLocalFileName>::Iterator dep_it = libdirs.begin(); dep_it != libdirs.end(); ++dep_it) { 500 if(exists((*dep_it).local() + Option::dir_sep + "lib" + stub + 501 "." + (*extit))) { 502 lib_stub = stub; 506 QString pathToLib = ((*dep_it).local() + Option::dir_sep 507 + project->values("QMAKE_PREFIX_SHLIB").first() 508 + stub + "." + (*extit)); 509 if(exists(pathToLib)) { 510 if (!project->isEmpty("QMAKE_RVCT_LINKSTYLE")) 511 (*it) = pathToLib; 512 else 513 (*it) = "-l" + stub; 514 found = true; 503 515 break; 504 516 } 505 517 } 506 if(!lib_stub.isNull()) { 507 (*it) = "-l" + lib_stub; 518 } else { 519 if(exists(project->values("QMAKE_PREFIX_SHLIB").first() + stub + "." + (*extit))) { 520 (*it) = project->values("QMAKE_PREFIX_SHLIB").first() + stub + "." + (*extit); 508 521 found = true; 509 522 break; 510 523 } 511 } else {512 if(exists("lib" + stub + "." + (*extit))) {513 (*it) = "lib" + stub + "." + (*extit);514 found = true;515 break;516 }517 524 } 518 525 } 519 526 if(!found && project->isActiveConfig("compile_libtool")) { 520 527 for(int dep_i = 0; dep_i < libdirs.size(); ++dep_i) { 521 if(exists(libdirs[dep_i].local() + Option::dir_sep + "lib"+ stub + Option::libtool_ext)) {522 (*it) = libdirs[dep_i].real() + Option::dir_sep + "lib"+ stub + Option::libtool_ext;528 if(exists(libdirs[dep_i].local() + Option::dir_sep + + stub + Option::libtool_ext)) { 529 (*it) = libdirs[dep_i].real() + Option::dir_sep + + stub + Option::libtool_ext; 523 530 found = true; 524 531 break; … … 545 552 QList<QMakeLocalFileName> libdirs, frameworkdirs; 546 553 frameworkdirs.append(QMakeLocalFileName("/System/Library/Frameworks")); 547 frameworkdirs.append(QMakeLocalFileName("/Library/Frameworks"));548 554 const QString lflags[] = { "QMAKE_LIBDIR_FLAGS", "QMAKE_FRAMEWORKPATH_FLAGS", "QMAKE_LFLAGS", "QMAKE_LIBS", QString() }; 549 555 for(int i = 0; !lflags[i].isNull(); i++) { … … 561 567 const QMakeLocalFileName &lfn = libdirs[dep_i]; 562 568 if(!project->isActiveConfig("compile_libtool")) { //give them the .libs.. 563 QString la = lfn.local() + Option::dir_sep + "lib"+ lib + Option::libtool_ext;569 QString la = lfn.local() + Option::dir_sep + + lib + Option::libtool_ext; 564 570 if(exists(la) && QFile::exists(lfn.local() + Option::dir_sep + ".libs")) { 565 571 QString dot_libs = lfn.real() + Option::dir_sep + ".libs"; … … 569 575 } 570 576 571 QString prl = lfn.local() + Option::dir_sep + "lib"+ lib;577 QString prl = lfn.local() + Option::dir_sep + + lib; 572 578 if(!project->isEmpty("QMAKE_" + lib.toUpper() + "_SUFFIX")) 573 579 prl += project->first("QMAKE_" + lib.toUpper() + "_SUFFIX"); … … 617 623 //merge them into a logical order 618 624 if(!project->isActiveConfig("no_smart_library_merge") && !project->isActiveConfig("no_lflags_merge")) { 619 Q StringListlflags;625 Q lflags; 620 626 for(int lit = 0; lit < l.size(); ++lit) { 627 621 628 QString opt = l.at(lit).trimmed(); 622 629 if(opt.startsWith("-")) { 630 631 632 633 634 635 636 623 637 if(opt.startsWith("-L") || 624 638 (Option::target_mode == Option::TARG_MACX_MODE && opt.startsWith("-F"))) { 625 if(lit == 0 || l.lastIndexOf(opt, lit-1) == -1) 626 lflags.append(opt); 627 } else if(opt.startsWith("-l")) { 628 if(lit == l.size()-1 || l.indexOf(opt, lit+1) == -1) 629 lflags.append(opt); 639 if(!lflags[arch].contains(opt)) 640 lflags[arch].append(opt); 641 } else if(opt.startsWith("-l") || opt == "-pthread") { 642 // Make sure we keep the dependency-order of libraries 643 if (lflags[arch].contains(opt)) 644 lflags[arch].removeAll(opt); 645 lflags[arch].append(opt); 630 646 } else if(Option::target_mode == Option::TARG_MACX_MODE && opt.startsWith("-framework")) { 631 647 if(opt.length() > 11) 632 648 opt = opt.mid(11); 633 else 649 else 634 650 opt = l.at(++lit); 651 652 653 635 654 bool found = false; 636 for(int x = lit+1; x < l.size(); ++x) {637 QString xf = l .at(x);655 for(int x = .size(); ++x) { 656 QString xf = l.at(x); 638 657 if(xf.startsWith("-framework")) { 639 658 QString framework; … … 641 660 framework = xf.mid(11); 642 661 else 643 framework = l .at(++x);662 framework = l.at(++x); 644 663 if(framework == opt) { 645 664 found = true; … … 649 668 } 650 669 if(!found) { 651 lflags .append("-framework");652 lflags .append(opt);670 lflags.append("-framework"); 671 lflags.append(opt); 653 672 } 654 673 } else { 655 lflags .append(opt);674 lflags.append(opt); 656 675 } 657 676 } else if(!opt.isNull()) { 658 if(lit == 0 || l.lastIndexOf(opt, lit-1) == -1) 659 lflags.append(opt); 660 } 661 } 662 l = lflags; 677 if(!lflags[arch].contains(opt)) 678 lflags[arch].append(opt); 679 } 680 } 681 682 l = lflags.take("default"); 683 684 // Process architecture specific options (Xarch) 685 QHash<QString, QStringList>::const_iterator archIterator = lflags.constBegin(); 686 while (archIterator != lflags.constEnd()) { 687 const QStringList archOptions = archIterator.value(); 688 for (int i = 0; i < archOptions.size(); ++i) { 689 l.append(QLatin1String("-Xarch_") + archIterator.key()); 690 l.append(archOptions.at(i)); 691 } 692 ++archIterator; 693 } 663 694 } 664 695 } … … 780 811 if(!links.isEmpty()) { 781 812 for(int i = 0; i < links.size(); ++i) { 782 if(Option::target_mode == Option::TARG_WIN_MODE || 783 Option::target_mode == Option::TARG_OS2_MODE || 784 Option::target_mode == Option::TARG_MAC9_MODE) { 785 } else if(Option::target_mode == Option::TARG_UNIX_MODE || 786 Option::target_mode == Option::TARG_MACX_MODE) { 813 if(Option::target_mode == Option::TARG_UNIX_MODE || 814 Option::target_mode == Option::TARG_MACX_MODE) { 787 815 QString link = Option::fixPathToTargetOS(destdir + links[i], false); 788 816 int lslash = link.lastIndexOf(Option::dir_sep);
Note:
See TracChangeset
for help on using the changeset viewer.