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 <oswald.buddenhagen@digia.com>
This commit is contained in:
Thiago Macieira 2012-09-24 14:30:45 +02:00 committed by The Qt Project
parent 2d07d3b4e3
commit 4712b0e99f
5 changed files with 70 additions and 42 deletions

64
configure vendored
View File

@ -884,6 +884,7 @@ QT_INSTALL_LIBS=
QT_INSTALL_BINS=
QT_INSTALL_PLUGINS=
QT_INSTALL_IMPORTS=
QT_INSTALL_ARCHDATA=
QT_INSTALL_DATA=
QT_INSTALL_TRANSLATIONS=
QT_INSTALL_SETTINGS=
@ -992,7 +993,7 @@ while [ "$#" -gt 0 ]; do
VAL=no
;;
#Qt style options that pass an argument
-prefix|-docdir|-headerdir|-plugindir|-importdir|-datadir|-libdir|-bindir|-translationdir|-sysconfdir|-examplesdir|-testsdir|-depths|-make|-nomake|-platform|-xplatform|-device|-device-option|-sdk|-arch|-host-arch|-mysql_config|-sysroot|-hostdatadir|-hostbindir|-qpa|-qconfig)
-prefix|-docdir|-headerdir|-plugindir|-importdir|-archdatadir|-datadir|-libdir|-bindir|-translationdir|-sysconfdir|-examplesdir|-testsdir|-depths|-make|-nomake|-platform|-xplatform|-device|-device-option|-sdk|-arch|-host-arch|-mysql_config|-sysroot|-hostdatadir|-hostbindir|-qpa|-qconfig)
VAR=`echo $1 | sed "s,^-\(.*\),\1,"`
shift
VAL="$1"
@ -1207,6 +1208,9 @@ while [ "$#" -gt 0 ]; do
importdir)
QT_INSTALL_IMPORTS="$VAL"
;;
archdatadir)
QT_INSTALL_ARCHDATA="$VAL"
;;
datadir)
QT_INSTALL_DATA="$VAL"
;;
@ -2772,11 +2776,6 @@ if [ -z "$QT_INSTALL_PREFIX" ]; then
fi
QT_INSTALL_PREFIX=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_PREFIX"`
if [ -z "$QT_INSTALL_DOCS" ]; then #default
QT_INSTALL_DOCS="$QT_INSTALL_PREFIX/doc" #fallback
fi
QT_INSTALL_DOCS=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_DOCS"`
if [ -z "$QT_INSTALL_HEADERS" ]; then #default
QT_INSTALL_HEADERS="$QT_INSTALL_PREFIX/include"
fi
@ -2787,28 +2786,38 @@ if [ -z "$QT_INSTALL_LIBS" ]; then #default
fi
QT_INSTALL_LIBS=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_LIBS"`
if [ -z "$QT_INSTALL_ARCHDATA" ]; then #default
QT_INSTALL_ARCHDATA="$QT_INSTALL_PREFIX" #fallback
fi
QT_INSTALL_ARCHDATA=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_ARCHDATA"`
if [ -z "$QT_INSTALL_DATA" ]; then #default
QT_INSTALL_DATA="$QT_INSTALL_PREFIX" #fallback
fi
QT_INSTALL_DATA=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_DATA"`
if [ -z "$QT_INSTALL_BINS" ]; then #default
QT_INSTALL_BINS="$QT_INSTALL_PREFIX/bin" #fallback
fi
QT_INSTALL_BINS=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_BINS"`
if [ -z "$QT_INSTALL_DOCS" ]; then #default
QT_INSTALL_DOCS="$QT_INSTALL_DATA/doc" #fallback
fi
QT_INSTALL_DOCS=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_DOCS"`
if [ -z "$QT_INSTALL_PLUGINS" ]; then #default
QT_INSTALL_PLUGINS="$QT_INSTALL_PREFIX/plugins" #fallback
QT_INSTALL_PLUGINS="$QT_INSTALL_ARCHDATA/plugins" #fallback
fi
QT_INSTALL_PLUGINS=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_PLUGINS"`
if [ -z "$QT_INSTALL_IMPORTS" ]; then #default
QT_INSTALL_IMPORTS="$QT_INSTALL_PREFIX/imports" #fallback
QT_INSTALL_IMPORTS="$QT_INSTALL_ARCHDATA/imports" #fallback
fi
QT_INSTALL_IMPORTS=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_IMPORTS"`
if [ -z "$QT_INSTALL_DATA" ]; then #default
QT_INSTALL_DATA="$QT_INSTALL_PREFIX"
fi
QT_INSTALL_DATA=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_DATA"`
if [ -z "$QT_INSTALL_TRANSLATIONS" ]; then #default
QT_INSTALL_TRANSLATIONS="$QT_INSTALL_PREFIX/translations"
QT_INSTALL_TRANSLATIONS="$QT_INSTALL_DATA/translations" #fallback
fi
QT_INSTALL_TRANSLATIONS=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_TRANSLATIONS"`
@ -2855,7 +2864,7 @@ if [ -z "$QT_HOST_DATA" ]; then #default
if $haveHpx; then
QT_HOST_DATA="$QT_HOST_PREFIX"
else
QT_HOST_DATA="$QT_INSTALL_DATA"
QT_HOST_DATA="$QT_INSTALL_ARCHDATA"
fi
else
QT_HOST_DATA=`"$relpath/config.tests/unix/makeabs" "$QT_HOST_DATA"`
@ -2995,20 +3004,22 @@ Installation options:
-bindir <dir> ......... Executables will be installed to <dir>
(default PREFIX/bin)
-libdir <dir> ......... Libraries will be installed to <dir>
(default PREFIX/lib)
-docdir <dir> ......... Documentation will be installed to <dir>
(default PREFIX/doc)
-headerdir <dir> ...... Headers will be installed to <dir>
(default PREFIX/include)
-plugindir <dir> ...... Plugins will be installed to <dir>
(default PREFIX/plugins)
-importdir <dir> ...... Imports for QML will be installed to <dir>
(default PREFIX/imports)
-datadir <dir> ........ Data used by Qt programs will be installed to <dir>
-libdir <dir> ......... Libraries will be installed to <dir>
(default PREFIX/lib)
-archdatadir <dir>..... Arch-dependent data used by Qt will be installed to <dir>
(default PREFIX)
-plugindir <dir> ...... Plugins will be installed to <dir>
(default ARCHDATADIR/plugins)
-importdir <dir> ...... Imports for QML will be installed to <dir>
(default ARCHDATADIR/imports)
-datadir <dir> ........ Arch-independent data used by Qt will be installed to <dir>
(default PREFIX)
-docdir <dir> ......... Documentation will be installed to <dir>
(default DATADIR/doc)
-translationdir <dir> . Translations of Qt programs will be installed to <dir>
(default PREFIX/translations)
(default DATADIR/translations)
-sysconfdir <dir> ..... Settings used by Qt programs will be looked for in <dir>
(default PREFIX/etc/settings)
-examplesdir <dir> .... Examples will be installed to <dir>
@ -3486,6 +3497,7 @@ static const char qt_configure_prefix_path_strs[][256 + 12] = {
"qt_binspath=$QT_INSTALL_BINS",
"qt_plugpath=$QT_INSTALL_PLUGINS",
"qt_impspath=$QT_INSTALL_IMPORTS",
"qt_adatpath=$QT_INSTALL_ARCHDATA",
"qt_datapath=$QT_INSTALL_DATA",
"qt_trnspath=$QT_INSTALL_TRANSLATIONS",
"qt_xmplpath=$QT_INSTALL_EXAMPLES",
@ -3644,7 +3656,7 @@ if true; then ###[ '!' -f "$outpath/bin/qmake" ];
fi
QMAKE_BIN_DIR="$QT_INSTALL_BINS"
[ -z "$QMAKE_BIN_DIR" ] && QMAKE_BIN_DIR="${QT_INSTALL_PREFIX}/bin"
QMAKE_DATA_DIR="$QT_INSTALL_DATA"
QMAKE_DATA_DIR="$QT_INSTALL_ARCHDATA"
[ -z "$QMAKE_DATA_DIR" ] && QMAKE_DATA_DIR="${QT_INSTALL_PREFIX}"
echo >>"$mkfile"
adjrelpath=`echo "$relpath" | sed 's/ /\\\\\\\\ /g'`

View File

@ -56,6 +56,7 @@ static const struct {
} propList[] = {
{ "QT_SYSROOT", QLibraryInfo::SysrootPath, true },
{ "QT_INSTALL_PREFIX", QLibraryInfo::PrefixPath, false },
{ "QT_INSTALL_ARCHDATA", QLibraryInfo::ArchDataPath, false },
{ "QT_INSTALL_DATA", QLibraryInfo::DataPath, false },
{ "QT_INSTALL_DOCS", QLibraryInfo::DocumentationPath, false },
{ "QT_INSTALL_HEADERS", QLibraryInfo::HeadersPath, false },

View File

@ -261,14 +261,15 @@ static const struct {
char key[14], value[13];
} qtConfEntries[] = {
{ "Prefix", "." },
{ "Documentation", "doc" },
{ "Documentation", "doc" }, // should be ${Data}/doc
{ "Headers", "include" },
{ "Libraries", "lib" },
{ "Binaries", "bin" },
{ "Plugins", "plugins" },
{ "Imports", "imports" },
{ "Plugins", "plugins" }, // should be ${ArchData}/plugins
{ "Imports", "imports" }, // should be ${ArchData}/imports
{ "ArchData", "." },
{ "Data", "." },
{ "Translations", "translations" },
{ "Translations", "translations" }, // should be ${Data}/translations
{ "Examples", "examples" },
{ "Tests", "tests" },
#ifdef QT_BOOTSTRAPPED
@ -444,7 +445,8 @@ QLibraryInfo::rawLocation(LibraryLocation loc, PathGroup group)
\value BinariesPath The location of installed Qt binaries (tools and applications).
\value PluginsPath The location of installed Qt plugins.
\value ImportsPath The location of installed QML extensions to import.
\value DataPath The location of general Qt data.
\value ArchDataPath The location of general architecture-dependent Qt data.
\value DataPath The location of general architecture-independent Qt data.
\value TranslationsPath The location of translation information for Qt strings.
\value ExamplesPath The location for examples upon install.
\value TestsPath The location of installed Qt testcases.

View File

@ -70,6 +70,7 @@ public:
BinariesPath,
PluginsPath,
ImportsPath,
ArchDataPath,
DataPath,
TranslationsPath,
ExamplesPath,

View File

@ -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 <dir>", "Executables will be installed to <dir>\n(default PREFIX/bin)");
desc( "-libdir <dir>", "Libraries will be installed to <dir>\n(default PREFIX/lib)");
desc( "-docdir <dir>", "Documentation will be installed to <dir>\n(default PREFIX/doc)");
desc( "-headerdir <dir>", "Headers will be installed to <dir>\n(default PREFIX/include)");
desc( "-plugindir <dir>", "Plugins will be installed to <dir>\n(default PREFIX/plugins)");
desc( "-importdir <dir>", "Imports for QML will be installed to <dir>\n(default PREFIX/imports)");
desc( "-archdatadir <dir>", "Architecture-dependent data used by Qt will be installed to <dir>\n(default PREFIX)");
desc( "-plugindir <dir>", "Plugins will be installed to <dir>\n(default ARCHDATADIR/plugins)");
desc( "-importdir <dir>", "Imports for QML1 will be installed to <dir>\n(default ARCHDATADIR/imports)");
desc( "-datadir <dir>", "Data used by Qt programs will be installed to <dir>\n(default PREFIX)");
desc( "-translationdir <dir>", "Translations of Qt programs will be installed to <dir>\n(default PREFIX/translations)");
desc( "-docdir <dir>", "Documentation will be installed to <dir>\n(default DATADIR/doc)");
desc( "-translationdir <dir>", "Translations of Qt programs will be installed to <dir>\n(default DATADIR/translations)");
desc( "-examplesdir <dir>", "Examples will be installed to <dir>\n(default PREFIX/examples)");
desc( "-testsdir <dir>", "Tests will be installed to <dir>\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