source: trunk/dports/aqua/qt4-mac/files/patch-mkspecs_features_qt_functions.prf.diff @ 97950

Last change on this file since 97950 was 97950, checked in by michaelld@…, 7 years ago

qt4-mac :

  • bump to 4.8.3_0;
  • disable +framework variant; always install as framework, and use symlinks to populate libraries and headers into ${prefix}/lib and ${prefix}/include;
  • correct patches to work with new version;
  • remove old 10.8 patchfile, and replace with the single remaining patch needed for linking corelib;
  • install private headers for some Qt modules to allow other ports to work fully (e.g., qt4-creator-mac).
File size: 6.4 KB
  • mkspecs/features/qt_functions.prf

    old new  
    1616}
    1717
    1818defineTest(qtAddLibrary) {
     19#    message(qtAddLibrary: 'LIBS' before $$1 is '$${LIBS}')
     20#    message(qtAddLibrary: 'INCLUDEPATH' before $$1 is '$${INCLUDEPATH}')
     21#    message(qtAddLibrary: 'QMAKE_LFLAGS' before $$1 is '$${QMAKE_LFLAGS}')
     22
     23    # reorder the includes path: user, this library, Qt headers
     24    INCLUDEPATH -= $$QMAKE_INCDIR_QT
    1925    INCLUDEPATH -= $$QMAKE_INCDIR_QT/$$1
    20     INCLUDEPATH = $$QMAKE_INCDIR_QT/$$1 $$INCLUDEPATH
     26    INCLUDEPATH += $$QMAKE_INCDIR_QT/$$1 $$QMAKE_INCDIR_QT
     27
     28    # first time through, append the path for Qt's installed libraries:
     29    # -after- all of the other necessary libraries and paths
     30
     31    mac:!static:contains(QT_CONFIG, qt_framework) {
     32      isEmpty(QMAKE_FRAMEWORKDIR_QT) {
     33         !contains(LIBS,-F$$[QT_INSTALL_PREFIX]/Library/Frameworks) {
     34           LIBS = $$LIBS -F$$[QT_INSTALL_PREFIX]/Library/Frameworks
     35         }
     36      } else {
     37        !contains(LIBS,-F$$QMAKE_FRAMEWORKDIR_QT) {
     38          LIBS = $$LIBS -F$$QMAKE_FRAMEWORKDIR_QT
     39        }
     40      }
     41      isEmpty(QMAKE_LIBDIR_QT) {
     42         !contains(LIBS,-F$$[QT_INSTALL_PREFIX]/lib) {
     43           LIBS = $$LIBS -F$$[QT_INSTALL_PREFIX]/lib
     44         }
     45      } else {
     46        !contains(LIBS,-F$$QMAKE_LIBDIR_QT) {
     47          LIBS = $$LIBS -F$$QMAKE_LIBDIR_QT
     48        }
     49      }
     50    }
     51    isEmpty(QMAKE_LIBDIR_QT) {
     52       !contains(LIBS,-L$$[QT_INSTALL_PREFIX]/lib) {
     53         LIBS = $$LIBS -L$$[QT_INSTALL_PREFIX]/lib
     54       }
     55    } else {
     56      !contains(LIBS,-L$$QMAKE_LIBDIR_QT) {
     57        LIBS = $$LIBS -L$$QMAKE_LIBDIR_QT
     58      }
     59    }
    2160
    2261    LIB_NAME = $$1
    2362    unset(LINKAGE)
    24     mac {
    25        CONFIG(qt_framework, qt_framework|qt_no_framework) { #forced
    26           QMAKE_FRAMEWORKPATH *= $${QMAKE_LIBDIR_QT}
    27           FRAMEWORK_INCLUDE = $$QMAKE_LIBDIR_QT/$${LIB_NAME}.framework/Headers
    28           !qt_no_framework_direct_includes:exists($$FRAMEWORK_INCLUDE) {
    29              INCLUDEPATH -= $$FRAMEWORK_INCLUDE
    30              INCLUDEPATH = $$FRAMEWORK_INCLUDE $$INCLUDEPATH
    31            }
    32            LINKAGE = -framework $${LIB_NAME}$${QT_LIBINFIX}
    33         } else:!qt_no_framework { #detection
    34            for(frmwrk_dir, $$list($$QMAKE_LIBDIR_QT $$QMAKE_LIBDIR $$(DYLD_FRAMEWORK_PATH) /Library/Frameworks)) {
    35               exists($${frmwrk_dir}/$${LIB_NAME}.framework) {
    36                 QMAKE_FRAMEWORKPATH *= $${frmwrk_dir}
     63
     64    # see if the framework, and exists in the current known paths
     65
     66    # add LIBS entries QMAKE_FRAMEWORKPATH, as appropriate
     67
     68    all_frmwrks = $$find(LIBS, -F.*) $$find(QMAKE_LFLAGS, -F.*)
     69#    message(qtAddLibrary: all frameworks is $$all_frmwrks)
     70
     71    for(frmwrk_dir, all_frmwrks) {
     72
     73#      message(qtAddLibrary: this frmwrk_dir is $$frmwrk_dir)
     74      tfp = $$frmwrk_dir
     75      tfp ~= s,-F,,
     76      QMAKE_FRAMEWORKPATH *= $$tfp
     77#      message(qtAddLibrary: this frmwrk_path is $$tfp)
     78
     79    }
     80
     81    mac:!qt_no_framework {
     82       for(frmwrk_dir, $$list($$QMAKE_FRAMEWORKPATH $$QMAKE_FRAMEWORKDIR_QT $$QMAKE_LIBDIR_QT $$QMAKE_LIBDIR $$(DYLD_FRAMEWORK_PATH))) {
     83
     84#           message(qtAddLibrary: looking for framework $$LIB_NAME in directory $$frmwrk_dir)
     85           exists($${frmwrk_dir}/$${LIB_NAME}.framework) {
     86
     87                message(qtAddLibrary: found framework $$LIB_NAME in directory $$frmwrk_dir)
    3788                FRAMEWORK_INCLUDE = $$frmwrk_dir/$${LIB_NAME}.framework/Headers
    3889                !qt_no_framework_direct_includes:exists($$FRAMEWORK_INCLUDE) {
    3990                  INCLUDEPATH -= $$FRAMEWORK_INCLUDE
     
    4192                }
    4293                LINKAGE = -framework $${LIB_NAME}
    4394                break()
     95
    4496              }
    45            }
    46        }
     97         }
    4798    }
     99
     100    # special for symbian
     101
    48102    symbian {
    49103        isEqual(LIB_NAME, QtCore) {
    50104            #workaround for dependency from f32file.h on e32svr.h which has moved location in symbian3
     
    70124        export(TARGET.EPOCHEAPSIZE)
    71125        export(TARGET.CAPABILITY)
    72126    }
     127
     128    isEmpty(LINKAGE) {
     129
     130      # not a framework or symbian
     131      # see if the library exists in the current known paths
     132
     133      # add LIBS entries QMAKE_LIBPATH, as appropriate
     134
     135      all_libs = $$find(LIBS, -L.*) $$find(QMAKE_LFLAGS, -L.*)
     136#      message(qtAddLibrary: all library paths is $$all_libs)
     137
     138      for(lib_dir, all_libs) {
     139
     140#        message(qtAddLibrary: this lib_dir is $$lib_dir)
     141        tlp = $$lib_dir
     142        tlp ~= s,-L,,
     143        QMAKE_LIBPATH *= $$tlp
     144#        message(qtAddLibrary: this lib_path is $$tlp)
     145
     146      }
     147
     148      for(lib_dir, $$list($$QMAKE_LIBPATH $$QMAKE_LIBDIR_QT $$QMAKE_LIBDIR)) {
     149
     150#           message(qtAddLibrary: looking for library $${LIB_NAME}$${QT_LIBINFIX} in directory $$lib_dir)
     151           exists($${lib_dir}/lib$${LIB_NAME}$${QT_LIBINFIX}.*) {
     152
     153                message(qtAddLibrary: found library $${LIB_NAME}$${QT_LIBINFIX} in directory $$lib_dir)
     154                LINKAGE = -l$${LIB_NAME}$${QT_LIBINFIX}
     155                break()
     156
     157              }
     158         }
     159    }
     160
    73161    isEmpty(LINKAGE) {
     162
     163       message(WARNING: Could not find library or framework $$LIB_NAME in the current known search directories; assuming a default library.)
     164
    74165       if(!debug_and_release|build_pass):CONFIG(debug, debug|release) {
    75166           win32:LINKAGE = -l$${LIB_NAME}$${QT_LIBINFIX}d
    76            mac:LINKAGE = -l$${LIB_NAME}$${QT_LIBINFIX}_debug
     167           # special for mac: cannot build QtWebKit as debug,
     168           # no-framework, and universal.  If things got here,
     169           # then this is no-framwork; just take care of the rest.
     170           mac {
     171               contains(QT_CONFIG, x86):contains(QT_CONFIG, x86_64):isEqual(LIB_NAME, QtWebKit) {
     172                   LINKAGE = -l$${LIB_NAME}$${QT_LIBINFIX}
     173               } else {
     174                   LINKAGE = -l$${LIB_NAME}$${QT_LIBINFIX}_debug
     175               }
     176           }
    77177       }
    78178       isEmpty(LINKAGE):LINKAGE = -l$${LIB_NAME}$${QT_LIBINFIX}
    79179    }
     
    83183        QMAKE_LFLAGS *= --lsb-shared-libs=$${LIB_NAME}$${QT_LIBINFIX}
    84184    }
    85185    LIBS += $$LINKAGE
     186#    message(qtAddLibrary: 'LIBS' after $$1 is now '$${LIBS}')
     187#    message(qtAddLibrary: 'INCLUDEPATH' after $$1 is now '$${INCLUDEPATH}')
     188#    message(qtAddLibrary: 'QMAKE_LFLAGS' after $$1 is now '$${QMAKE_LFLAGS}')
    86189    export(LIBS)
    87190    export(INCLUDEPATH)
    88191    export(QMAKE_FRAMEWORKPATH)
     192    export(QMAKE_LIBPATH)
    89193    export(QMAKE_LFLAGS)
    90194    return(true)
    91195}
     
    119223
    120224    return(true)
    121225}
    122 
Note: See TracBrowser for help on using the repository browser.