Add a -libexecdir option to the configures
authorThiago Macieira <thiago.macieira@intel.com>
Thu, 25 Oct 2012 21:32:09 +0000 (14:32 -0700)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Wed, 28 Nov 2012 07:39:07 +0000 (08:39 +0100)
User applications are those that users run directly, whether it be for
development or not. The executable binaries that the user does not
usually run but is still required for proper functioning are called
"program executables" in Autoconf and they are placed in libexec.

This commit adds support for "program executables" in Qt by adding the
-libexecdir option to the configures, the qmake variable
QT_INSTALL_LIBEXECS (note the plural, to match all other properties),
and QLibraryInfo::LibraryExecutables.

At the time of this commit, the only expected "program executable" is
the QtWebProcess, the WebKit2 helper process from QtWebKit.

Change-Id: I66c3a3e0cf7f9d93b5f88f55f18e957faff608fc
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
configure
mkspecs/features/qt_config.prf
mkspecs/features/qt_module.prf
mkspecs/features/qt_module_fwdpri.prf
qmake/property.cpp
src/corelib/global/qlibraryinfo.cpp
src/corelib/global/qlibraryinfo.h
tools/configure/configureapp.cpp

index 3032443..e833494 100755 (executable)
--- a/configure
+++ b/configure
@@ -881,6 +881,7 @@ QT_INSTALL_DOCS=
 QT_INSTALL_HEADERS=
 QT_INSTALL_LIBS=
 QT_INSTALL_BINS=
+QT_INSTALL_LIBEXECS=
 QT_INSTALL_PLUGINS=
 QT_INSTALL_IMPORTS=
 QT_INSTALL_QML=
@@ -993,7 +994,7 @@ while [ "$#" -gt 0 ]; do
         VAL=no
         ;;
     #Qt style options that pass an argument
-    -prefix|-docdir|-headerdir|-plugindir|-importdir|-qmldir|-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)
+    -prefix|-docdir|-headerdir|-plugindir|-importdir|-qmldir|-archdatadir|-datadir|-libdir|-bindir|-libexecdir|-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"
@@ -1250,6 +1251,9 @@ while [ "$#" -gt 0 ]; do
     bindir)
         QT_INSTALL_BINS="$VAL"
         ;;
+    libexecdir)
+        QT_INSTALL_LIBEXECS="$VAL"
+        ;;
     sse)
         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
             CFG_SSE="$VAL"
@@ -2805,6 +2809,11 @@ if [ -z "$QT_INSTALL_BINS" ]; then #default
 fi
 QT_INSTALL_BINS=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_BINS"`
 
+if [ -z "$QT_INSTALL_LIBEXECS" ]; then #default
+    QT_INSTALL_LIBEXECS="$QT_INSTALL_ARCHDATA/libexec" #fallback
+fi
+QT_INSTALL_LIBEXECS=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_LIBEXECS"`
+
 if [ -z "$QT_INSTALL_DOCS" ]; then #default
     QT_INSTALL_DOCS="$QT_INSTALL_DATA/doc" #fallback
 fi
@@ -3012,7 +3021,7 @@ Installation options:
 
  You may use these to separate different parts of the install:
 
-    -bindir <dir> ......... Executables will be installed to <dir>
+    -bindir <dir> ......... User executables will be installed to <dir>
                             (default PREFIX/bin)
     -headerdir <dir> ...... Headers will be installed to <dir>
                             (default PREFIX/include)
@@ -3022,6 +3031,8 @@ Installation options:
                             (default PREFIX)
     -plugindir <dir> ...... Plugins will be installed to <dir>
                             (default ARCHDATADIR/plugins)
+    -libexecdir <dir> ..... Program executables will be installed to <dir>
+                            (default ARCHDATADIR/libexec)
     -importdir <dir> ...... Imports for QML1 will be installed to <dir>
                             (default ARCHDATADIR/imports)
     -qmldir <dir> ......... Imports for QML2 will be installed to <dir>
@@ -3506,6 +3517,7 @@ static const char qt_configure_prefix_path_strs[][256 + 12] = {
     "qt_docspath=$QT_INSTALL_DOCS",
     "qt_hdrspath=$QT_INSTALL_HEADERS",
     "qt_libspath=$QT_INSTALL_LIBS",
+    "qt_lbexpath=$QT_INSTALL_LIBEXECS",
     "qt_binspath=$QT_INSTALL_BINS",
     "qt_plugpath=$QT_INSTALL_PLUGINS",
     "qt_impspath=$QT_INSTALL_IMPORTS",
index 5d250ea..3b2b62e 100644 (file)
@@ -19,6 +19,7 @@ QMAKE_QT_CONFIG = $$[QT_HOST_DATA/get]/mkspecs/qconfig.pri
          QT_MODULE_INCLUDE_BASE = $$[QT_INSTALL_HEADERS]
          QT_MODULE_LIB_BASE = $$[QT_INSTALL_LIBS]
          QT_MODULE_PLUGIN_BASE = $$[QT_INSTALL_PLUGINS]
+         QT_MODULE_LIBEXEC_BASE = $$[QT_INSTALL_LIBEXECS]
          QT_MODULE_BIN_BASE = $$[QT_INSTALL_BINS]
          QT_MODULE_IMPORT_BASE = $$[QT_INSTALL_IMPORTS]
          QT_MODULE_QML_BASE = $$[QT_INSTALL_QML]
@@ -28,6 +29,7 @@ QMAKE_QT_CONFIG = $$[QT_HOST_DATA/get]/mkspecs/qconfig.pri
    unset(QT_MODULE_INCLUDE_BASE)
    unset(QT_MODULE_LIB_BASE)
    unset(QT_MODULE_PLUGIN_BASE)
+   unset(QT_MODULE_LIBEXEC_BASE)
    unset(QT_MODULE_BIN_BASE)
    unset(QT_MODULE_IMPORT_BASE)
    unset(QT_MODULE_QML_BASE)
index ca62923..a4f3243 100644 (file)
@@ -79,6 +79,7 @@ MODULE_PRI = $$MODULE_QMAKE_OUTDIR/mkspecs/modules-inst/qt_lib_$${MODULE}.pri
         "QT.$${MODULE}.private_includes = $$MODULE_PRIVATE_INCLUDES" \
         "QT.$${MODULE}.sources = $$val_escape(_PRO_FILE_PWD_)" \
         "QT.$${MODULE}.libs = \$\$QT_MODULE_LIB_BASE" \
+        "QT.$${MODULE}.libexecs = \$\$QT_MODULE_LIBEXEC_BASE" \
         "QT.$${MODULE}.rpath = $$[QT_INSTALL_LIBS/raw]" \
         "QT.$${MODULE}.plugins = \$\$QT_MODULE_PLUGIN_BASE" \
         "QT.$${MODULE}.imports = \$\$QT_MODULE_IMPORT_BASE" \
index cd3aed9..b7270ae 100644 (file)
@@ -54,6 +54,7 @@
         "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_LIBEXEC_BASE = $$MODULE_BASE_OUTDIR/libexec" \
         "QT_MODULE_PLUGIN_BASE = $$MODULE_BASE_OUTDIR/plugins" \
         $$module_rpathlink \
         $$module_rpathlink_priv \
@@ -70,7 +71,7 @@
     include($$MODULE_FWD_PRI)
     for(var, $$list(VERSION MAJOR_VERSION MINOR_VERSION PATCH_VERSION \
                     name depends private_depends module_config CONFIG DEFINES sources \
-                    includes private_includes bins libs plugins imports qml \
+                    includes private_includes bins libs libexecs plugins imports qml \
             )):defined(QT.$${MODULE}.$$var, var):cache(QT.$${MODULE}.$$var, transient)
     cache(QT_CONFIG, transient)
 
index 8379b2a..d9e861c 100644 (file)
@@ -61,6 +61,7 @@ static const struct {
     { "QT_INSTALL_DOCS", QLibraryInfo::DocumentationPath, false },
     { "QT_INSTALL_HEADERS", QLibraryInfo::HeadersPath, false },
     { "QT_INSTALL_LIBS", QLibraryInfo::LibrariesPath, false },
+    { "QT_INSTALL_LIBEXECS", QLibraryInfo::LibraryExecutablesPath, false },
     { "QT_INSTALL_BINS", QLibraryInfo::BinariesPath, false },
     { "QT_INSTALL_TESTS", QLibraryInfo::TestsPath, false },
     { "QT_INSTALL_PLUGINS", QLibraryInfo::PluginsPath, false },
index a756577..a8dc086 100644 (file)
@@ -267,12 +267,13 @@ QLibraryInfo::isDebugBuild()
  */
 
 static const struct {
-    char key[14], value[13];
+    char key[19], value[13];
 } qtConfEntries[] = {
     { "Prefix", "." },
     { "Documentation", "doc" }, // should be ${Data}/doc
     { "Headers", "include" },
     { "Libraries", "lib" },
+    { "LibraryExecutables", "libexec" }, // should be ${ArchData}/libexec
     { "Binaries", "bin" },
     { "Plugins", "plugins" }, // should be ${ArchData}/plugins
     { "Imports", "imports" }, // should be ${ArchData}/imports
@@ -452,6 +453,7 @@ QLibraryInfo::rawLocation(LibraryLocation loc, PathGroup group)
     \value DocumentationPath The location for documentation upon install.
     \value HeadersPath The location for all headers.
     \value LibrariesPath The location of installed libraries.
+    \value LibraryExecutablesPath The location of installed executables required by libraries at runtime.
     \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 (QML 1.x).
index 5d6e429..a574b4b 100644 (file)
@@ -67,6 +67,7 @@ public:
         DocumentationPath,
         HeadersPath,
         LibrariesPath,
+        LibraryExecutablesPath,
         BinariesPath,
         PluginsPath,
         ImportsPath,
index a08989d..0093fbc 100644 (file)
@@ -1033,6 +1033,13 @@ void Configure::parseCmdLine()
             dictionary[ "QT_INSTALL_BINS" ] = configCmdLine.at(i);
         }
 
+        else if (configCmdLine.at(i) == "-libexecdir") {
+            ++i;
+            if (i == argCount)
+                break;
+            dictionary[ "QT_INSTALL_LIBEXECS" ] = configCmdLine.at(i);
+        }
+
         else if (configCmdLine.at(i) == "-libdir") {
             ++i;
             if (i == argCount)
@@ -1597,10 +1604,11 @@ bool Configure::displayHelp()
 
         desc("You may use these to separate different parts of the install:\n\n");
 
-        desc(       "-bindir <dir>",                    "Executables will be installed to <dir>\n(default PREFIX/bin)");
+        desc(       "-bindir <dir>",                    "User executables will be installed to <dir>\n(default PREFIX/bin)");
         desc(       "-libdir <dir>",                    "Libraries will be installed to <dir>\n(default PREFIX/lib)");
         desc(       "-headerdir <dir>",                 "Headers will be installed to <dir>\n(default PREFIX/include)");
         desc(       "-archdatadir <dir>",               "Architecture-dependent data used by Qt will be installed to <dir>\n(default PREFIX)");
+        desc(       "-libexecdir <dir>",                "Program executables will be installed to <dir>\n(default ARCHDATADIR/libexec)");
         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(       "-qmldir <dir>",                    "Imports for QML2 will be installed to <dir>\n(default ARCHDATADIR/qml)");
@@ -3423,6 +3431,7 @@ void Configure::displayConfig()
     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 << "Library execs installed to.." << QDir::toNativeSeparators(dictionary["QT_INSTALL_LIBEXEC"]) << endl;
     sout << "QML1 imports installed to..." << QDir::toNativeSeparators(dictionary["QT_INSTALL_IMPORTS"]) << endl;
     sout << "QML2 imports installed to..." << QDir::toNativeSeparators(dictionary["QT_INSTALL_QML"]) << endl;
     sout << "Binaries installed to......." << QDir::toNativeSeparators(dictionary["QT_INSTALL_BINS"]) << endl;
@@ -3554,6 +3563,8 @@ void Configure::generateQConfigCpp()
         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_LIBEXECS"].size())
+        dictionary["QT_INSTALL_LIBEXECS"] = qipempty ? "" : dictionary["QT_INSTALL_ARCHDATA"] + "/libexec";
     if (!dictionary["QT_INSTALL_BINS"].size())
         dictionary["QT_INSTALL_BINS"] = qipempty ? "" : dictionary["QT_INSTALL_PREFIX"] + "/bin";
     if (!dictionary["QT_INSTALL_PLUGINS"].size())
@@ -3606,6 +3617,7 @@ void Configure::generateQConfigCpp()
                   << "    \"qt_docspath=" << formatPath(dictionary["QT_INSTALL_DOCS"]) << "\","  << endl
                   << "    \"qt_hdrspath=" << formatPath(dictionary["QT_INSTALL_HEADERS"]) << "\","  << endl
                   << "    \"qt_libspath=" << formatPath(dictionary["QT_INSTALL_LIBS"]) << "\","  << endl
+                  << "    \"qt_lbexpath=" << formatPath(dictionary["QT_INSTALL_LIBEXECS"]) << "\","  << endl
                   << "    \"qt_binspath=" << formatPath(dictionary["QT_INSTALL_BINS"]) << "\","  << endl
                   << "    \"qt_plugpath=" << formatPath(dictionary["QT_INSTALL_PLUGINS"]) << "\","  << endl
                   << "    \"qt_impspath=" << formatPath(dictionary["QT_INSTALL_IMPORTS"]) << "\","  << endl