diff --git a/configure b/configure index 8c6e8ef1f5..b92c4cf25b 100755 --- a/configure +++ b/configure @@ -1003,6 +1003,7 @@ CFG_SYSROOT= CFG_GCC_SYSROOT="yes" QT_HOST_PREFIX= QT_HOST_BINS= +QT_HOST_LIBS= QT_HOST_DATA= #flags for SQL drivers @@ -1111,7 +1112,7 @@ while [ "$#" -gt 0 ]; do VAL=no ;; #Qt style options that pass an argument - -prefix|-docdir|-headerdir|-plugindir|-importdir|-qmldir|-archdatadir|-datadir|-libdir|-bindir|-libexecdir|-translationdir|-sysconfdir|-examplesdir|-testsdir|-depths|-make|-nomake|-skip|-platform|-xplatform|-device|-device-option|-sdk|-arch|-host-arch|-mysql_config|-sysroot|-hostdatadir|-hostbindir|-qpa|-qconfig|-android-sdk|-android-ndk|-android-ndk-platform|-android-ndk-host|-android-arch|-android-toolchain-version) + -prefix|-docdir|-headerdir|-plugindir|-importdir|-qmldir|-archdatadir|-datadir|-libdir|-bindir|-libexecdir|-translationdir|-sysconfdir|-examplesdir|-testsdir|-depths|-make|-nomake|-skip|-platform|-xplatform|-device|-device-option|-sdk|-arch|-host-arch|-mysql_config|-sysroot|-hostdatadir|-hostbindir|-hostlibdir|-qpa|-qconfig|-android-sdk|-android-ndk|-android-ndk-platform|-android-ndk-host|-android-arch|-android-toolchain-version) VAR=`echo $1 | sed "s,^-\(.*\),\1,"` shift VAL="$1" @@ -1296,6 +1297,9 @@ while [ "$#" -gt 0 ]; do hostbindir) QT_HOST_BINS="$VAL" ;; + hostlibdir) + QT_HOST_LIBS="$VAL" + ;; pkg-config) if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then CFG_PKGCONFIG="$VAL" @@ -3152,6 +3156,15 @@ if [ -z "$QT_HOST_BINS" ]; then #default fi QT_HOST_BINS=`"$relpath/config.tests/unix/makeabs" "$QT_HOST_BINS"` +if [ -z "$QT_HOST_LIBS" ]; then #default + if $haveHpx; then + QT_HOST_LIBS="$QT_HOST_PREFIX/lib" #fallback + else + QT_HOST_LIBS="$QT_INSTALL_LIBS" + fi +fi +QT_HOST_LIBS=`"$relpath/config.tests/unix/makeabs" "$QT_HOST_LIBS"` + if [ -z "$QT_HOST_DATA" ]; then #default if $haveHpx; then QT_HOST_DATA="$QT_HOST_PREFIX" @@ -3325,6 +3338,8 @@ Installation options: -hostbindir .. Host executables will be installed to (default HOSTPREFIX/bin) + -hostlibdir .. Host libraries will be installed to + (default HOSTPREFIX/lib) -hostdatadir . Data used by qmake will be installed to (default HOSTPREFIX) @@ -3839,6 +3854,7 @@ static const char qt_configure_prefix_path_strs[][256 + 12] = { "qt_ssrtpath=$CFG_SYSROOT", "qt_hpfxpath=$QT_HOST_PREFIX", "qt_hbinpath=$QT_HOST_BINS", + "qt_hlibpath=$QT_HOST_LIBS", "qt_hdatpath=$QT_HOST_DATA", "qt_targspec=$shortxspec", "qt_hostspec=$shortspec", diff --git a/mkspecs/features/qt_config.prf b/mkspecs/features/qt_config.prf index 061399d78c..77d2c0ffc7 100644 --- a/mkspecs/features/qt_config.prf +++ b/mkspecs/features/qt_config.prf @@ -20,6 +20,7 @@ QMAKE_QT_CONFIG = $$[QT_HOST_DATA/get]/mkspecs/qconfig.pri # qt_.pri forwarding file QT_MODULE_INCLUDE_BASE = $$[QT_INSTALL_HEADERS] QT_MODULE_LIB_BASE = $$[QT_INSTALL_LIBS] + QT_MODULE_HOST_LIB_BASE = $$[QT_HOST_LIBS] QT_MODULE_PLUGIN_BASE = $$[QT_INSTALL_PLUGINS] QT_MODULE_LIBEXEC_BASE = $$[QT_INSTALL_LIBEXECS] QT_MODULE_BIN_BASE = $$[QT_INSTALL_BINS] @@ -30,6 +31,7 @@ QMAKE_QT_CONFIG = $$[QT_HOST_DATA/get]/mkspecs/qconfig.pri } unset(QT_MODULE_INCLUDE_BASE) unset(QT_MODULE_LIB_BASE) + unset(QT_MODULE_HOST_LIB_BASE) unset(QT_MODULE_PLUGIN_BASE) unset(QT_MODULE_LIBEXEC_BASE) unset(QT_MODULE_BIN_BASE) diff --git a/mkspecs/features/qt_installs.prf b/mkspecs/features/qt_installs.prf index cc720ac8c0..e82b499009 100644 --- a/mkspecs/features/qt_installs.prf +++ b/mkspecs/features/qt_installs.prf @@ -12,10 +12,16 @@ #library !qt_no_install_library { win32 { - dlltarget.path = $$[QT_INSTALL_BINS] + host_build: \ + dlltarget.path = $$[QT_HOST_BINS] + else: \ + dlltarget.path = $$[QT_INSTALL_BINS] INSTALLS += dlltarget } - target.path = $$[QT_INSTALL_LIBS] + host_build: \ + target.path = $$[QT_HOST_LIBS] + else: \ + target.path = $$[QT_INSTALL_LIBS] INSTALLS += target } diff --git a/mkspecs/features/qt_module.prf b/mkspecs/features/qt_module.prf index 3531d28b42..429e00bed9 100644 --- a/mkspecs/features/qt_module.prf +++ b/mkspecs/features/qt_module.prf @@ -128,7 +128,10 @@ load(qt_installs) unix|win32-g++* { CONFIG += create_pc - QMAKE_PKGCONFIG_LIBDIR = $$[QT_INSTALL_LIBS/raw] + host_build: \ + QMAKE_PKGCONFIG_LIBDIR = $$[QT_HOST_LIBS] + else: \ + QMAKE_PKGCONFIG_LIBDIR = $$[QT_INSTALL_LIBS/raw] QMAKE_PKGCONFIG_INCDIR = $$[QT_INSTALL_HEADERS/raw] QMAKE_PKGCONFIG_CFLAGS = -I${includedir}/$$MODULE_INCNAME QMAKE_PKGCONFIG_DESTDIR = pkgconfig @@ -139,14 +142,14 @@ unix|win32-g++* { include_replace.match = $$rplbase/include include_replace.replace = $$[QT_INSTALL_HEADERS/raw] lib_replace.match = $$rplbase/lib - lib_replace.replace = $$[QT_INSTALL_LIBS/raw] + lib_replace.replace = $$QMAKE_PKGCONFIG_LIBDIR QMAKE_PKGCONFIG_INSTALL_REPLACE += include_replace lib_replace QMAKE_PRL_INSTALL_REPLACE += include_replace lib_replace } unix { CONFIG += create_libtool explicitlib - QMAKE_LIBTOOL_LIBDIR = $$[QT_INSTALL_LIBS/raw] + QMAKE_LIBTOOL_LIBDIR = $$QMAKE_PKGCONFIG_LIBDIR QMAKE_LIBTOOL_INSTALL_REPLACE += include_replace lib_replace } diff --git a/mkspecs/features/qt_module_pris.prf b/mkspecs/features/qt_module_pris.prf index bedcfd4c47..9e40a67b51 100644 --- a/mkspecs/features/qt_module_pris.prf +++ b/mkspecs/features/qt_module_pris.prf @@ -19,10 +19,18 @@ else: \ !build_pass { # Create a module .pri file - unix:!static: \ - module_rpath = "QT.$${MODULE}.rpath = $$[QT_INSTALL_LIBS/raw]" + host_build: \ + module_libs = "\$\$QT_MODULE_HOST_LIB_BASE" else: \ + module_libs = "\$\$QT_MODULE_LIB_BASE" + unix:!static { + host_build: \ + module_rpath = "QT.$${MODULE}.rpath = $$[QT_HOST_LIBS]" + else: \ + module_rpath = "QT.$${MODULE}.rpath = $$[QT_INSTALL_LIBS/raw]" + } else { module_rpath = + } !isEmpty(QT_FOR_PRIVATE) { contains(QT_FOR_PRIVATE, .*-private$):error("QT_FOR_PRIVATE may not contain *-private.") module_privdep = "QT.$${MODULE}.private_depends = $$QT_FOR_PRIVATE" @@ -55,15 +63,17 @@ else: \ "QT.$${MODULE}.PATCH_VERSION = $$section(VERSION, ., 2, 2)" \ "" \ "QT.$${MODULE}.name = $$TARGET" \ - "QT.$${MODULE}.bins = \$\$QT_MODULE_BIN_BASE" \ - "QT.$${MODULE}.includes = $$MODULE_INCLUDES" \ - "QT.$${MODULE}.private_includes = $$MODULE_PRIVATE_INCLUDES" \ - "QT.$${MODULE}.libs = \$\$QT_MODULE_LIB_BASE" \ - "QT.$${MODULE}.libexecs = \$\$QT_MODULE_LIBEXEC_BASE" \ + "QT.$${MODULE}.libs = $$module_libs" \ $$module_rpath \ + "QT.$${MODULE}.private_includes = $$MODULE_PRIVATE_INCLUDES" + !host_build: MODULE_PRI_CONT += \ + "QT.$${MODULE}.includes = $$MODULE_INCLUDES" \ + "QT.$${MODULE}.bins = \$\$QT_MODULE_BIN_BASE" \ + "QT.$${MODULE}.libexecs = \$\$QT_MODULE_LIBEXEC_BASE" \ "QT.$${MODULE}.plugins = \$\$QT_MODULE_PLUGIN_BASE" \ "QT.$${MODULE}.imports = \$\$QT_MODULE_IMPORT_BASE" \ - "QT.$${MODULE}.qml = \$\$QT_MODULE_QML_BASE" \ + "QT.$${MODULE}.qml = \$\$QT_MODULE_QML_BASE" + MODULE_PRI_CONT += \ "QT.$${MODULE}.depends =$$join(MODULE_DEPENDS, " ", " ")" \ $$module_privdep \ $$module_rundep \ @@ -84,6 +94,7 @@ else: \ "QT_MODULE_IMPORT_BASE = $$MODULE_BASE_OUTDIR/imports" \ "QT_MODULE_QML_BASE = $$MODULE_BASE_OUTDIR/qml" \ "QT_MODULE_LIB_BASE = $$MODULE_BASE_OUTDIR/lib" \ + "QT_MODULE_HOST_LIB_BASE = $$MODULE_BASE_OUTDIR/lib" \ "QT_MODULE_LIBEXEC_BASE = $$MODULE_BASE_OUTDIR/libexec" \ "QT_MODULE_PLUGIN_BASE = $$MODULE_BASE_OUTDIR/plugins" \ "include($$MODULE_PRI)" @@ -99,6 +110,7 @@ else: \ QT_MODULE_IMPORT_BASE = $$[QT_INSTALL_IMPORTS] QT_MODULE_QML_BASE = $$[QT_INSTALL_QML] QT_MODULE_LIB_BASE = $$[QT_INSTALL_LIBS] + QT_MODULE_HOST_LIB_BASE = $$[QT_HOST_LIBS] QT_MODULE_LIBEXEC_BASE = $$[QT_INSTALL_LIBEXECS] QT_MODULE_PLUGIN_BASE = $$[QT_INSTALL_PLUGINS] diff --git a/qmake/property.cpp b/qmake/property.cpp index c4fbcd6b78..4685440b48 100644 --- a/qmake/property.cpp +++ b/qmake/property.cpp @@ -74,6 +74,7 @@ static const struct { { "QT_HOST_PREFIX", QLibraryInfo::HostPrefixPath, true }, { "QT_HOST_DATA", QLibraryInfo::HostDataPath, true }, { "QT_HOST_BINS", QLibraryInfo::HostBinariesPath, true }, + { "QT_HOST_LIBS", QLibraryInfo::HostLibrariesPath, true }, { "QMAKE_SPEC", QLibraryInfo::HostSpecPath, true }, { "QMAKE_XSPEC", QLibraryInfo::TargetSpecPath, true }, }; diff --git a/src/corelib/global/qlibraryinfo.cpp b/src/corelib/global/qlibraryinfo.cpp index 5fb9640b19..1eaebe5f90 100644 --- a/src/corelib/global/qlibraryinfo.cpp +++ b/src/corelib/global/qlibraryinfo.cpp @@ -291,6 +291,7 @@ static const struct { { "Sysroot", "" }, { "HostPrefix", "" }, { "HostBinaries", "bin" }, + { "HostLibraries", "lib" }, { "HostData", "." }, { "TargetSpec", "" }, { "HostSpec", "" }, diff --git a/src/corelib/global/qlibraryinfo.h b/src/corelib/global/qlibraryinfo.h index 1a00a14caf..b275e018a0 100644 --- a/src/corelib/global/qlibraryinfo.h +++ b/src/corelib/global/qlibraryinfo.h @@ -82,6 +82,7 @@ public: SysrootPath, HostPrefixPath, HostBinariesPath, + HostLibrariesPath, HostDataPath, TargetSpecPath, HostSpecPath, diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index fa8456e447..fbc9941ac7 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -1171,6 +1171,13 @@ void Configure::parseCmdLine() dictionary[ "QT_HOST_BINS" ] = configCmdLine.at(i); } + else if (configCmdLine.at(i) == "-hostlibdir") { + ++i; + if (i == argCount) + break; + dictionary[ "QT_HOST_LIBS" ] = configCmdLine.at(i); + } + else if (configCmdLine.at(i) == "-hostdatadir") { ++i; if (i == argCount) @@ -1698,6 +1705,7 @@ bool Configure::displayHelp() desc( "-testsdir ", "Tests will be installed to \n(default PREFIX/tests)\n"); desc( "-hostbindir ", "Host executables will be installed to \n(default HOSTPREFIX/bin)"); + desc( "-hostlibdir ", "Host libraries will be installed to \n(default HOSTPREFIX/lib)"); desc( "-hostdatadir ", "Data used by qmake will be installed to \n(default HOSTPREFIX)"); #if !defined(EVAL) @@ -3758,6 +3766,8 @@ void Configure::generateQConfigCpp() haveHpx = true; if (dictionary["QT_HOST_BINS"].isEmpty()) dictionary["QT_HOST_BINS"] = haveHpx ? dictionary["QT_HOST_PREFIX"] + "/bin" : dictionary["QT_INSTALL_BINS"]; + if (dictionary["QT_HOST_LIBS"].isEmpty()) + dictionary["QT_HOST_LIBS"] = haveHpx ? dictionary["QT_HOST_PREFIX"] + "/lib" : dictionary["QT_INSTALL_LIBS"]; if (dictionary["QT_HOST_DATA"].isEmpty()) dictionary["QT_HOST_DATA"] = haveHpx ? dictionary["QT_HOST_PREFIX"] : dictionary["QT_INSTALL_ARCHDATA"]; @@ -3798,6 +3808,7 @@ void Configure::generateQConfigCpp() << " \"qt_ssrtpath=" << formatPath(dictionary["CFG_SYSROOT"]) << "\"," << endl << " \"qt_hpfxpath=" << formatPath(dictionary["QT_HOST_PREFIX"]) << "\"," << endl << " \"qt_hbinpath=" << formatPath(dictionary["QT_HOST_BINS"]) << "\"," << endl + << " \"qt_hlibpath=" << formatPath(dictionary["QT_HOST_LIBS"]) << "\"," << endl << " \"qt_hdatpath=" << formatPath(dictionary["QT_HOST_DATA"]) << "\"," << endl << " \"qt_targspec=" << targSpec << "\"," << endl << " \"qt_hostspec=" << hostSpec << "\"," << endl