From 4712b0e99fdb90b6cbfe12ad16e534b49cd98343 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Mon, 24 Sep 2012 14:30:45 +0200 Subject: Add -archdatadir and change some of the default install dirs in Qt 5. Architecture-depedent Qt data defaults now to something under -archdatadir. Architecture-dependent data is everything that contains machine code (e.g., plugins) as well as anything that hardcodes build-specific data, like qconfig.pri and qmodule.pri. That is: QML imports: $archdatadir/imports (includes plugins) Qt plugins: $archdatadir/plugins (machine code) Mkspecs: $archdatadir/mkspecs (build-specific) Architecture-independent Qt data defaults now to something under -datadir. This option existed in Qt 4, but did not differentiate between arch-dependent and independent. Following Autoconf's lead, --datadir is the *independent* data root. translations: $datadir/translations (.qm files are arch-independent) docs: $datadir/doc By default, both new options are equal to the Qt install prefix. (Strictly speaking, for complete Autoconf compatibility, we'd need a --datarootdir=$prefix/share, --datadir=$datarootdir/qt5 and --docdir=$datarootdir/doc/qt5, but that's just nitpicking and unnecessary) Change-Id: I39c886a6a2d2d2c0b11923c50974179e21f2af76 Reviewed-by: Oswald Buddenhagen --- tools/configure/configureapp.cpp | 34 +++++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) (limited to 'tools/configure/configureapp.cpp') diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index cb853b3496..dfc3d216c3 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -1066,6 +1066,13 @@ void Configure::parseCmdLine() break; dictionary[ "QT_INSTALL_IMPORTS" ] = configCmdLine.at(i); } + else if (configCmdLine.at(i) == "-archdatadir") { + ++i; + if (i == argCount) + break; + dictionary[ "QT_INSTALL_ARCHDATA" ] = configCmdLine.at(i); + } + else if (configCmdLine.at(i) == "-datadir") { ++i; if (i == argCount) @@ -1577,12 +1584,13 @@ bool Configure::displayHelp() desc( "-bindir ", "Executables will be installed to \n(default PREFIX/bin)"); desc( "-libdir ", "Libraries will be installed to \n(default PREFIX/lib)"); - desc( "-docdir ", "Documentation will be installed to \n(default PREFIX/doc)"); desc( "-headerdir ", "Headers will be installed to \n(default PREFIX/include)"); - desc( "-plugindir ", "Plugins will be installed to \n(default PREFIX/plugins)"); - desc( "-importdir ", "Imports for QML will be installed to \n(default PREFIX/imports)"); + desc( "-archdatadir ", "Architecture-dependent data used by Qt will be installed to \n(default PREFIX)"); + desc( "-plugindir ", "Plugins will be installed to \n(default ARCHDATADIR/plugins)"); + desc( "-importdir ", "Imports for QML1 will be installed to \n(default ARCHDATADIR/imports)"); desc( "-datadir ", "Data used by Qt programs will be installed to \n(default PREFIX)"); - desc( "-translationdir ", "Translations of Qt programs will be installed to \n(default PREFIX/translations)"); + desc( "-docdir ", "Documentation will be installed to \n(default DATADIR/doc)"); + desc( "-translationdir ", "Translations of Qt programs will be installed to \n(default DATADIR/translations)"); desc( "-examplesdir ", "Examples will be installed to \n(default PREFIX/examples)"); desc( "-testsdir ", "Tests will be installed to \n(default PREFIX/tests)\n"); @@ -3387,11 +3395,12 @@ void Configure::displayConfig() sout << "Install prefix.............." << QDir::toNativeSeparators(dictionary["QT_INSTALL_PREFIX"]) << endl; sout << "Headers installed to........" << QDir::toNativeSeparators(dictionary["QT_INSTALL_HEADERS"]) << endl; sout << "Libraries installed to......" << QDir::toNativeSeparators(dictionary["QT_INSTALL_LIBS"]) << endl; + sout << "Arch-dep. data to..........." << QDir::toNativeSeparators(dictionary["QT_INSTALL_ARCHDATA"]) << endl; sout << "Plugins installed to........" << QDir::toNativeSeparators(dictionary["QT_INSTALL_PLUGINS"]) << endl; sout << "Imports installed to........" << QDir::toNativeSeparators(dictionary["QT_INSTALL_IMPORTS"]) << endl; sout << "Binaries installed to......." << QDir::toNativeSeparators(dictionary["QT_INSTALL_BINS"]) << endl; + sout << "Arch-indep. data to........." << QDir::toNativeSeparators(dictionary["QT_INSTALL_DATA"]) << endl; sout << "Docs installed to..........." << QDir::toNativeSeparators(dictionary["QT_INSTALL_DOCS"]) << endl; - sout << "Data installed to..........." << QDir::toNativeSeparators(dictionary["QT_INSTALL_DATA"]) << endl; sout << "Translations installed to..." << QDir::toNativeSeparators(dictionary["QT_INSTALL_TRANSLATIONS"]) << endl; sout << "Examples installed to......." << QDir::toNativeSeparators(dictionary["QT_INSTALL_EXAMPLES"]) << endl; sout << "Tests installed to.........." << QDir::toNativeSeparators(dictionary["QT_INSTALL_TESTS"]) << endl; @@ -3512,22 +3521,24 @@ void Configure::generateQConfigCpp() if (dictionary["QT_INSTALL_PREFIX"].isEmpty()) qipempty = true; - if (!dictionary["QT_INSTALL_DOCS"].size()) - dictionary["QT_INSTALL_DOCS"] = qipempty ? "" : dictionary["QT_INSTALL_PREFIX"] + "/doc"; if (!dictionary["QT_INSTALL_HEADERS"].size()) dictionary["QT_INSTALL_HEADERS"] = qipempty ? "" : dictionary["QT_INSTALL_PREFIX"] + "/include"; if (!dictionary["QT_INSTALL_LIBS"].size()) dictionary["QT_INSTALL_LIBS"] = qipempty ? "" : dictionary["QT_INSTALL_PREFIX"] + "/lib"; + if (!dictionary["QT_INSTALL_ARCHDATA"].size()) + dictionary["QT_INSTALL_ARCHDATA"] = qipempty ? "" : dictionary["QT_INSTALL_PREFIX"]; if (!dictionary["QT_INSTALL_BINS"].size()) dictionary["QT_INSTALL_BINS"] = qipempty ? "" : dictionary["QT_INSTALL_PREFIX"] + "/bin"; if (!dictionary["QT_INSTALL_PLUGINS"].size()) - dictionary["QT_INSTALL_PLUGINS"] = qipempty ? "" : dictionary["QT_INSTALL_PREFIX"] + "/plugins"; + dictionary["QT_INSTALL_PLUGINS"] = qipempty ? "" : dictionary["QT_INSTALL_ARCHDATA"] + "/plugins"; if (!dictionary["QT_INSTALL_IMPORTS"].size()) - dictionary["QT_INSTALL_IMPORTS"] = qipempty ? "" : dictionary["QT_INSTALL_PREFIX"] + "/imports"; + dictionary["QT_INSTALL_IMPORTS"] = qipempty ? "" : dictionary["QT_INSTALL_ARCHDATA"] + "/imports"; if (!dictionary["QT_INSTALL_DATA"].size()) dictionary["QT_INSTALL_DATA"] = qipempty ? "" : dictionary["QT_INSTALL_PREFIX"]; + if (!dictionary["QT_INSTALL_DOCS"].size()) + dictionary["QT_INSTALL_DOCS"] = qipempty ? "" : dictionary["QT_INSTALL_DATA"] + "/doc"; if (!dictionary["QT_INSTALL_TRANSLATIONS"].size()) - dictionary["QT_INSTALL_TRANSLATIONS"] = qipempty ? "" : dictionary["QT_INSTALL_PREFIX"] + "/translations"; + dictionary["QT_INSTALL_TRANSLATIONS"] = qipempty ? "" : dictionary["QT_INSTALL_DATA"] + "/translations"; if (!dictionary["QT_INSTALL_EXAMPLES"].size()) dictionary["QT_INSTALL_EXAMPLES"] = qipempty ? "" : dictionary["QT_INSTALL_PREFIX"] + "/examples"; if (!dictionary["QT_INSTALL_TESTS"].size()) @@ -3541,7 +3552,7 @@ void Configure::generateQConfigCpp() if (dictionary["QT_HOST_BINS"].isEmpty()) dictionary["QT_HOST_BINS"] = haveHpx ? dictionary["QT_HOST_PREFIX"] + "/bin" : dictionary["QT_INSTALL_BINS"]; if (dictionary["QT_HOST_DATA"].isEmpty()) - dictionary["QT_HOST_DATA"] = haveHpx ? dictionary["QT_HOST_PREFIX"] : dictionary["QT_INSTALL_DATA"]; + dictionary["QT_HOST_DATA"] = haveHpx ? dictionary["QT_HOST_PREFIX"] : dictionary["QT_INSTALL_ARCHDATA"]; // Generate the new qconfig.cpp file QDir(buildPath).mkpath("src/corelib/global"); @@ -3569,6 +3580,7 @@ void Configure::generateQConfigCpp() << " \"qt_binspath=" << formatPath(dictionary["QT_INSTALL_BINS"]) << "\"," << endl << " \"qt_plugpath=" << formatPath(dictionary["QT_INSTALL_PLUGINS"]) << "\"," << endl << " \"qt_impspath=" << formatPath(dictionary["QT_INSTALL_IMPORTS"]) << "\"," << endl + << " \"qt_adatpath=" << formatPath(dictionary["QT_INSTALL_ARCHDATA"]) << "\"," << endl << " \"qt_datapath=" << formatPath(dictionary["QT_INSTALL_DATA"]) << "\"," << endl << " \"qt_trnspath=" << formatPath(dictionary["QT_INSTALL_TRANSLATIONS"]) << "\"," << endl << " \"qt_xmplpath=" << formatPath(dictionary["QT_INSTALL_EXAMPLES"]) << "\"," << endl -- cgit v1.2.3