Changeset 846 for trunk/qmake/generators/unix
- Timestamp:
- May 5, 2011, 5:36:53 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 4 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); -
trunk/qmake/generators/unix/unixmake.h
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]) … … 50 50 { 51 51 bool init_flag, include_deps; 52 bool writeMakefile(QTextStream &);53 52 QString libtoolFileName(bool fixify=true); 54 53 void writeLibtoolFile(); // for libtool … … 76 75 77 76 void writeMakeParts(QTextStream &); 77 78 78 79 79 private: -
trunk/qmake/generators/unix/unixmake2.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]) … … 82 82 writeHeader(t); 83 83 if(!project->values("QMAKE_FAILED_REQUIREMENTS").isEmpty()) { 84 t << "QMAKE = " << (project->isEmpty("QMAKE_QMAKE") ? QString("qmake") : var("QMAKE_QMAKE")) << endl;84 t << "QMAKE = " ) << endl; 85 85 QStringList &qut = project->values("QMAKE_EXTRA_TARGETS"); 86 86 for(QStringList::ConstIterator it = qut.begin(); it != qut.end(); ++it) … … 149 149 t << "LINK = " << var("QMAKE_LINK") << endl; 150 150 t << "LFLAGS = " << var("QMAKE_LFLAGS") << endl; 151 t << "LIBS = " << "$(SUBLIBS) " << var("QMAKE_FRAMEWORK DIR_FLAGS") << " "151 t << "LIBS = " << "$(SUBLIBS) " << var("QMAKE_FRAMEWORK_FLAGS") << " " 152 152 << var("QMAKE_LIBDIR_FLAGS") << " " << var("QMAKE_LIBS") << " " << var("QMAKE_LIBS_PRIVATE") << endl; 153 153 } … … 155 155 t << "AR = " << var("QMAKE_AR") << endl; 156 156 t << "RANLIB = " << var("QMAKE_RANLIB") << endl; 157 t << "QMAKE = " << (project->isEmpty("QMAKE_QMAKE") ? QString("qmake") : var("QMAKE_QMAKE")) << endl;157 t << "QMAKE = " << ) << endl; 158 158 t << "TAR = " << var("QMAKE_TAR") << endl; 159 159 t << "COMPRESS = " << var("QMAKE_GZIP") << endl; … … 178 178 t << "export MACOSX_DEPLOYMENT_TARGET = " //exported to children processes 179 179 << project->first("QMAKE_MACOSX_DEPLOYMENT_TARGET") << endl; 180 181 182 183 184 185 180 186 t << endl; 181 187 … … 234 240 t << "TARGETD = " << escapeFilePath(var("TARGET_x.y")) << endl; 235 241 t << "TARGET0 = " << escapeFilePath(var("TARGET_")) << endl; 242 243 236 244 } else if(project->isEmpty("QMAKE_HPUX_SHLIB")) { 237 245 t << "TARGETD = " << escapeFilePath(var("TARGET_x.y.z")) << endl; … … 333 341 QStringList &l = project->values("SUBLIBS"); 334 342 for(QStringList::Iterator it = l.begin(); it != l.end(); ++it) 335 t << libdir << "lib" << (*it) << ".a "; 343 t << libdir << project->first("QMAKE_PREFIX_STATICLIB") << (*it) << "." 344 << project->first("QMAKE_EXTENSION_STATICLIB") << " "; 336 345 t << endl << endl; 337 346 } … … 543 552 << varGlue("QMAKE_LN_SHLIB","-"," ", " " + project->first("QMAKE_FRAMEWORK_VERSION") + 544 553 " " + destdir + "Versions/Current") << "\n\t"; 554 555 556 557 558 559 560 561 562 563 564 545 565 if(!project->isEmpty("QMAKE_POST_LINK")) 546 566 t << "\n\t" << var("QMAKE_POST_LINK"); … … 861 881 QStringList &l = project->values("SUBLIBS"); 862 882 for(it = l.begin(); it != l.end(); ++it) 863 t << libdir << "lib" << (*it) << ".a" << ":\n\t" 883 t << libdir << project->first("QMAKE_PREFIX_STATICLIB") << (*it) << "." 884 << project->first("QMAKE_EXTENSION_STATICLIB") << ":\n\t" 864 885 << var(QString("MAKELIB") + (*it)) << endl << endl; 865 886 } … … 876 897 } else if(!project->isActiveConfig("staticlib") && project->values("QMAKE_APP_FLAG").isEmpty() && 877 898 !project->isActiveConfig("plugin")) { 878 t << "\t-$(DEL_FILE) " << destdir << "$(TARGET)" << " " << endl 879 << "\t-$(DEL_FILE) " << destdir << "$(TARGET0) " << destdir << "$(TARGET1) " 880 << destdir << "$(TARGET2) $(TARGETA)" << endl; 899 t << "\t-$(DEL_FILE) " << destdir << "$(TARGET)" << " " << endl; 900 if (project->values("QMAKE_SYMBIAN_SHLIB").isEmpty()) 901 t << "\t-$(DEL_FILE) " << destdir << "$(TARGET0) " << destdir << "$(TARGET1) " 902 << destdir << "$(TARGET2) $(TARGETA)" << endl; 881 903 } else { 882 904 t << "\t-$(DEL_FILE) " << "$(TARGET)" << " " << endl; … … 993 1015 project->values("TARGET_EXT").append(".exe"); 994 1016 } else if (project->isActiveConfig("staticlib")) { 995 project->values("TARGET").first().prepend( "lib");996 project->values("TARGET").first() += ". a";1017 project->values("TARGET").first().prepend(); 1018 project->values("TARGET").first() += ".; 997 1019 if(project->values("QMAKE_AR_CMD").isEmpty()) 998 1020 project->values("QMAKE_AR_CMD").append("$(AR) $(TARGET) $(OBJECTS)"); 999 1021 } else { 1000 project->values("TARGETA").append(project->first("DESTDIR") + "lib" + project->first("TARGET") + ".a"); 1022 project->values("TARGETA").append(project->first("DESTDIR") + project->first("QMAKE_PREFIX_STATICLIB") 1023 + project->first("TARGET") + "." + project->first("QMAKE_EXTENSION_STATICLIB")); 1001 1024 if(project->isActiveConfig("compile_libtool")) 1002 1025 project->values("TARGET_la") = QStringList(project->first("DESTDIR") + "lib" + project->first("TARGET") + Option::libtool_ext); … … 1046 1069 project->values("TARGET") = project->values("TARGET_x"); 1047 1070 } else if (!project->isEmpty("QMAKE_AIX_SHLIB")) { 1048 project->values("TARGET_").append("lib" + project->first("TARGET") + ".a"); 1071 project->values("TARGET_").append(project->first("QMAKE_PREFIX_STATICLIB") + project->first("TARGET") 1072 + "." + project->first("QMAKE_EXTENSION_STATICLIB")); 1049 1073 if(project->isActiveConfig("lib_version_first")) { 1050 1074 project->values("TARGET_x").append("lib" + project->first("TARGET") + "." + … … 1075 1099 } 1076 1100 project->values("TARGET") = project->values("TARGET_x.y.z"); 1101 1102 1103 1104 1077 1105 } else { 1078 1106 project->values("TARGET_").append("lib" + project->first("TARGET") + "." +
Note:
See TracChangeset
for help on using the changeset viewer.