Add missing emission of activated(QString)
[mirror/qt/qtbase.git] / src / corelib / global / qlibraryinfo.cpp
1 /****************************************************************************
2 **
3 ** Copyright (C) 2015 The Qt Company Ltd.
4 ** Copyright (C) 2014 Intel Corporation
5 ** Contact: http://www.qt.io/licensing/
6 **
7 ** This file is part of the QtCore module of the Qt Toolkit.
8 **
9 ** $QT_BEGIN_LICENSE:LGPL21$
10 ** Commercial License Usage
11 ** Licensees holding valid commercial Qt licenses may use this file in
12 ** accordance with the commercial license agreement provided with the
13 ** Software or, alternatively, in accordance with the terms contained in
14 ** a written agreement between you and The Qt Company. For licensing terms
15 ** and conditions see http://www.qt.io/terms-conditions. For further
16 ** information use the contact form at http://www.qt.io/contact-us.
17 **
18 ** GNU Lesser General Public License Usage
19 ** Alternatively, this file may be used under the terms of the GNU Lesser
20 ** General Public License version 2.1 or version 3 as published by the Free
21 ** Software Foundation and appearing in the file LICENSE.LGPLv21 and
22 ** LICENSE.LGPLv3 included in the packaging of this file. Please review the
23 ** following information to ensure the GNU Lesser General Public License
24 ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
25 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
26 **
27 ** As a special exception, The Qt Company gives you certain additional
28 ** rights. These rights are described in The Qt Company LGPL Exception
29 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
30 **
31 ** $QT_END_LICENSE$
32 **
33 ****************************************************************************/
34
35 #include "qdir.h"
36 #include "qstringlist.h"
37 #include "qfile.h"
38 #include "qsettings.h"
39 #include "qlibraryinfo.h"
40 #include "qscopedpointer.h"
41
42 #ifdef QT_BUILD_QMAKE
43 QT_BEGIN_NAMESPACE
44 extern QString qmake_libraryInfoFile();
45 QT_END_NAMESPACE
46 #else
47 # include "qcoreapplication.h"
48 #endif
49
50 #ifdef Q_OS_MAC
51 #  include "private/qcore_mac_p.h"
52 #endif
53
54 #include "qconfig.cpp"
55 #include "archdetect.cpp"
56
57 QT_BEGIN_NAMESPACE
58
59 extern void qDumpCPUFeatures(); // in qsimd.cpp
60
61 #ifndef QT_NO_SETTINGS
62
63 struct QLibrarySettings
64 {
65     QLibrarySettings();
66     void load();
67
68     QScopedPointer<QSettings> settings;
69 #ifdef QT_BUILD_QMAKE
70     bool haveDevicePaths;
71     bool haveEffectiveSourcePaths;
72     bool haveEffectivePaths;
73     bool havePaths;
74 #else
75     bool reloadOnQAppAvailable;
76 #endif
77 };
78 Q_GLOBAL_STATIC(QLibrarySettings, qt_library_settings)
79
80 class QLibraryInfoPrivate
81 {
82 public:
83     static QSettings *findConfiguration();
84 #ifdef QT_BUILD_QMAKE
85     static bool haveGroup(QLibraryInfo::PathGroup group)
86     {
87         QLibrarySettings *ls = qt_library_settings();
88         return ls ? (group == QLibraryInfo::EffectiveSourcePaths
89                      ? ls->haveEffectiveSourcePaths
90                      : group == QLibraryInfo::EffectivePaths
91                        ? ls->haveEffectivePaths
92                        : group == QLibraryInfo::DevicePaths
93                          ? ls->haveDevicePaths
94                          : ls->havePaths) : false;
95     }
96 #endif
97     static QSettings *configuration()
98     {
99         QLibrarySettings *ls = qt_library_settings();
100         if (ls) {
101 #ifndef QT_BUILD_QMAKE
102             if (ls->reloadOnQAppAvailable && QCoreApplication::instance() != 0)
103                 ls->load();
104 #endif
105             return ls->settings.data();
106         } else {
107             return 0;
108         }
109     }
110 };
111
112 static const char platformsSection[] = "Platforms";
113
114 QLibrarySettings::QLibrarySettings()
115 {
116     load();
117 }
118
119 void QLibrarySettings::load()
120 {
121     // If we get any settings here, those won't change when the application shows up.
122     settings.reset(QLibraryInfoPrivate::findConfiguration());
123 #ifndef QT_BUILD_QMAKE
124     reloadOnQAppAvailable = (settings.data() == 0 && QCoreApplication::instance() == 0);
125     bool haveDevicePaths;
126     bool haveEffectivePaths;
127     bool havePaths;
128 #endif
129     if (settings) {
130         // This code needs to be in the regular library, as otherwise a qt.conf that
131         // works for qmake would break things for dynamically built Qt tools.
132         QStringList children = settings->childGroups();
133         haveDevicePaths = children.contains(QLatin1String("DevicePaths"));
134 #ifdef QT_BUILD_QMAKE
135         haveEffectiveSourcePaths = children.contains(QLatin1String("EffectiveSourcePaths"));
136 #else
137         // EffectiveSourcePaths is for the Qt build only, so needs no backwards compat trickery.
138         bool haveEffectiveSourcePaths = false;
139 #endif
140         haveEffectivePaths = haveEffectiveSourcePaths || children.contains(QLatin1String("EffectivePaths"));
141         // Backwards compat: an existing but empty file is claimed to contain the Paths section.
142         havePaths = (!haveDevicePaths && !haveEffectivePaths
143                      && !children.contains(QLatin1String(platformsSection)))
144                     || children.contains(QLatin1String("Paths"));
145 #ifndef QT_BUILD_QMAKE
146         if (!havePaths)
147             settings.reset(0);
148 #else
149     } else {
150         haveDevicePaths = false;
151         haveEffectiveSourcePaths = false;
152         haveEffectivePaths = false;
153         havePaths = false;
154 #endif
155     }
156 }
157
158 QSettings *QLibraryInfoPrivate::findConfiguration()
159 {
160     QString qtconfig = QStringLiteral(":/qt/etc/qt.conf");
161     if (QFile::exists(qtconfig))
162         return new QSettings(qtconfig, QSettings::IniFormat);
163 #ifdef QT_BUILD_QMAKE
164     qtconfig = qmake_libraryInfoFile();
165     if (QFile::exists(qtconfig))
166         return new QSettings(qtconfig, QSettings::IniFormat);
167 #else
168 #ifdef Q_OS_MAC
169     CFBundleRef bundleRef = CFBundleGetMainBundle();
170     if (bundleRef) {
171         QCFType<CFURLRef> urlRef = CFBundleCopyResourceURL(bundleRef,
172                                                            QCFString(QLatin1String("qt.conf")),
173                                                            0,
174                                                            0);
175         if (urlRef) {
176             QCFString path = CFURLCopyFileSystemPath(urlRef, kCFURLPOSIXPathStyle);
177             qtconfig = QDir::cleanPath(path);
178             if (QFile::exists(qtconfig))
179                 return new QSettings(qtconfig, QSettings::IniFormat);
180         }
181     }
182 #endif
183     if (QCoreApplication::instance()) {
184         QDir pwd(QCoreApplication::applicationDirPath());
185         qtconfig = pwd.filePath(QLatin1String("qt.conf"));
186         if (QFile::exists(qtconfig))
187             return new QSettings(qtconfig, QSettings::IniFormat);
188     }
189 #endif
190     return 0;     //no luck
191 }
192
193 #endif // QT_NO_SETTINGS
194
195 /*!
196     \class QLibraryInfo
197     \inmodule QtCore
198     \brief The QLibraryInfo class provides information about the Qt library.
199
200     Many pieces of information are established when Qt is configured and built.
201     This class provides an abstraction for accessing that information.
202     By using the static functions of this class, an application can obtain
203     information about the instance of the Qt library which the application
204     is using at run-time.
205
206     You can also use a \c qt.conf file to override the hard-coded paths
207     that are compiled into the Qt library. For more information, see
208     the \l {Using qt.conf} documentation.
209
210     \sa QSysInfo, {Using qt.conf}
211 */
212
213 #ifndef QT_BUILD_QMAKE
214
215 /*!
216     \internal
217
218    You cannot create a QLibraryInfo, instead only the static functions are available to query
219    information.
220 */
221
222 QLibraryInfo::QLibraryInfo()
223 { }
224
225 /*!
226   Returns the person to whom this build of Qt is licensed.
227
228   \sa licensedProducts()
229 */
230
231 QString
232 QLibraryInfo::licensee()
233 {
234     const char * volatile str = QT_CONFIGURE_LICENSEE;
235     return QString::fromLocal8Bit(str);
236 }
237
238 /*!
239   Returns the products that the license for this build of Qt has access to.
240
241   \sa licensee()
242 */
243
244 QString
245 QLibraryInfo::licensedProducts()
246 {
247     const char * volatile str = QT_CONFIGURE_LICENSED_PRODUCTS;
248     return QString::fromLatin1(str);
249 }
250
251 /*!
252     \since 4.6
253     \deprecated
254     This function used to return the installation date for this build of Qt, but now returns a constant date.
255 */
256 #ifndef QT_NO_DATESTRING
257 #if QT_DEPRECATED_SINCE(5, 5)
258 QDate
259 QLibraryInfo::buildDate()
260 {
261     return QDate::fromString(QString::fromLatin1(qt_configure_installation + 12), Qt::ISODate);
262 }
263 #endif
264 #endif //QT_NO_DATESTRING
265
266 #if defined(Q_CC_INTEL) // must be before GNU, Clang and MSVC because ICC/ICL claim to be them
267 #  ifdef __INTEL_CLANG_COMPILER
268 #    define ICC_COMPAT "Clang"
269 #  elif defined(__INTEL_MS_COMPAT_LEVEL)
270 #    define ICC_COMPAT "Microsoft"
271 #  elif defined(__GNUC__)
272 #    define ICC_COMPAT "GCC"
273 #  else
274 #    define ICC_COMPAT "no"
275 #  endif
276 #  if __INTEL_COMPILER == 1300
277 #    define ICC_VERSION "13.0"
278 #  elif __INTEL_COMPILER == 1310
279 #    define ICC_VERSION "13.1"
280 #  elif __INTEL_COMPILER == 1400
281 #    define ICC_VERSION "14.0"
282 #  elif __INTEL_COMPILER == 1500
283 #    define ICC_VERSION "15.0"
284 #  else
285 #    define ICC_VERSION QT_STRINGIFY(__INTEL_COMPILER)
286 #  endif
287 #  ifdef __INTEL_COMPILER_UPDATE
288 #    define COMPILER_STRING "Intel(R) C++ " ICC_VERSION "." QT_STRINGIFY(__INTEL_COMPILER_UPDATE) \
289                             " build " QT_STRINGIFY(__INTEL_COMPILER_BUILD_DATE) " [" \
290                             ICC_COMPAT " compatibility]"
291 #  else
292 #    define COMPILER_STRING "Intel(R) C++ " ICC_VERSION \
293                             " build " QT_STRINGIFY(__INTEL_COMPILER_BUILD_DATE) " [" \
294                             ICC_COMPAT " compatibility]"
295 #  endif
296 #elif defined(Q_CC_CLANG) // must be before GNU, because clang claims to be GNU too
297 #  ifdef __apple_build_version__ // Apple clang has other version numbers
298 #    define COMPILER_STRING "Clang " __clang_version__ " (Apple)"
299 #  else
300 #    define COMPILER_STRING "Clang " __clang_version__
301 #  endif
302 #elif defined(Q_CC_GNU)
303 #  define COMPILER_STRING "GCC " __VERSION__
304 #elif defined(Q_CC_MSVC)
305 #  if _MSC_VER < 1600
306 #    define COMPILER_STRING "MSVC 2008"
307 #  elif _MSC_VER < 1700
308 #    define COMPILER_STRING "MSVC 2010"
309 #  elif _MSC_VER < 1800
310 #    define COMPILER_STRING "MSVC 2012"
311 #  elif _MSC_VER < 1900
312 #    define COMPILER_STRING "MSVC 2013"
313 #  elif _MSC_VER < 2000
314 #    define COMPILER_STRING "MSVC 2015"
315 #  else
316 #    define COMPILER_STRING "MSVC _MSC_VER " QT_STRINGIFY(_MSC_VER)
317 #  endif
318 #else
319 #  define COMPILER_STRING "<unknown compiler>"
320 #endif
321 #ifdef QT_NO_DEBUG
322 #  define DEBUG_STRING " release"
323 #else
324 #  define DEBUG_STRING " debug"
325 #endif
326 #ifdef QT_SHARED
327 #  define SHARED_STRING " shared (dynamic)"
328 #else
329 #  define SHARED_STRING " static"
330 #endif
331 #define QT_BUILD_STR "Qt " QT_VERSION_STR " (" ARCH_FULL SHARED_STRING DEBUG_STRING " build; by " COMPILER_STRING ")"
332
333 /*!
334   Returns a string describing how this version of Qt was built.
335
336   \internal
337
338   \since 5.3
339 */
340
341 const char *QLibraryInfo::build() Q_DECL_NOTHROW
342 {
343     return QT_BUILD_STR;
344 }
345
346 /*!
347     \since 5.0
348     Returns \c true if this build of Qt was built with debugging enabled, or
349     false if it was built in release mode.
350 */
351 bool
352 QLibraryInfo::isDebugBuild()
353 {
354 #ifdef QT_DEBUG
355     return true;
356 #else
357     return false;
358 #endif
359 }
360
361 #endif // QT_BUILD_QMAKE
362
363 /*
364  * To add a new entry in QLibrary::LibraryLocation, add it to the enum above the bootstrapped values and:
365  * - add its relative path in the qtConfEntries[] array below
366  *   (the key is what appears in a qt.conf file)
367  * - add a property name in qmake/property.cpp propList[] array
368  *   (it's used with qmake -query)
369  * - add to qt_config.prf, qt_module.prf, qt_module_fwdpri.prf
370  */
371
372 static const struct {
373     char key[19], value[13];
374 } qtConfEntries[] = {
375     { "Prefix", "." },
376     { "Documentation", "doc" }, // should be ${Data}/doc
377     { "Headers", "include" },
378     { "Libraries", "lib" },
379 #ifdef Q_OS_WIN
380     { "LibraryExecutables", "bin" },
381 #else
382     { "LibraryExecutables", "libexec" }, // should be ${ArchData}/libexec
383 #endif
384     { "Binaries", "bin" },
385     { "Plugins", "plugins" }, // should be ${ArchData}/plugins
386     { "Imports", "imports" }, // should be ${ArchData}/imports
387     { "Qml2Imports", "qml" }, // should be ${ArchData}/qml
388     { "ArchData", "." },
389     { "Data", "." },
390     { "Translations", "translations" }, // should be ${Data}/translations
391     { "Examples", "examples" },
392     { "Tests", "tests" },
393 #ifdef QT_BUILD_QMAKE
394     { "Sysroot", "" },
395     { "HostBinaries", "bin" },
396     { "HostLibraries", "lib" },
397     { "HostData", "." },
398     { "TargetSpec", "" },
399     { "HostSpec", "" },
400     { "HostPrefix", "" },
401 #endif
402 };
403
404 /*!
405   Returns the location specified by \a loc.
406
407 */
408 QString
409 QLibraryInfo::location(LibraryLocation loc)
410 {
411 #ifdef QT_BUILD_QMAKE
412     QString ret = rawLocation(loc, FinalPaths);
413
414     // Automatically prepend the sysroot to target paths
415     if ((loc < SysrootPath || loc > LastHostPath) && QT_CONFIGURE_SYSROOTIFY_PREFIX) {
416         QString sysroot = rawLocation(SysrootPath, FinalPaths);
417         if (!sysroot.isEmpty() && ret.length() > 2 && ret.at(1) == QLatin1Char(':')
418             && (ret.at(2) == QLatin1Char('/') || ret.at(2) == QLatin1Char('\\')))
419             ret.replace(0, 2, sysroot); // Strip out the drive on Windows targets
420         else
421             ret.prepend(sysroot);
422     }
423
424     return ret;
425 }
426
427 QString
428 QLibraryInfo::rawLocation(LibraryLocation loc, PathGroup group)
429 {
430 #endif
431     QString ret;
432 #ifdef QT_BUILD_QMAKE
433     // Logic for choosing the right data source: if EffectivePaths are requested
434     // and qt.conf with that section is present, use it, otherwise fall back to
435     // FinalPaths. For FinalPaths, use qt.conf if present and contains not only
436     // [EffectivePaths], otherwise fall back to builtins.
437     // EffectiveSourcePaths falls back to EffectivePaths.
438     // DevicePaths falls back to FinalPaths.
439     PathGroup orig_group = group;
440     if (!QLibraryInfoPrivate::haveGroup(group)
441         && !(group == EffectiveSourcePaths
442              && (group = EffectivePaths, QLibraryInfoPrivate::haveGroup(group)))
443         && !((group == EffectivePaths || group == DevicePaths)
444              && (group = FinalPaths, QLibraryInfoPrivate::haveGroup(group)))
445         && (group = orig_group, true))
446 #elif !defined(QT_NO_SETTINGS)
447     if (!QLibraryInfoPrivate::configuration())
448 #endif
449     {
450         const char * volatile path = 0;
451         if (loc == PrefixPath) {
452             path =
453 #ifdef QT_BUILD_QMAKE
454                 (group != DevicePaths) ?
455                     QT_CONFIGURE_EXT_PREFIX_PATH :
456 #endif
457                     QT_CONFIGURE_PREFIX_PATH;
458         } else if (unsigned(loc) <= sizeof(qt_configure_str_offsets)/sizeof(qt_configure_str_offsets[0])) {
459             path = qt_configure_strs + qt_configure_str_offsets[loc - 1];
460 #ifndef Q_OS_WIN // On Windows we use the registry
461         } else if (loc == SettingsPath) {
462             path = QT_CONFIGURE_SETTINGS_PATH;
463 #endif
464 #ifdef QT_BUILD_QMAKE
465         } else if (loc == HostPrefixPath) {
466             path = QT_CONFIGURE_HOST_PREFIX_PATH;
467 #endif
468         }
469
470         if (path)
471             ret = QString::fromLocal8Bit(path);
472 #ifndef QT_NO_SETTINGS
473     } else {
474         QString key;
475         QString defaultValue;
476         if (unsigned(loc) < sizeof(qtConfEntries)/sizeof(qtConfEntries[0])) {
477             key = QLatin1String(qtConfEntries[loc].key);
478             defaultValue = QLatin1String(qtConfEntries[loc].value);
479         }
480 #ifndef Q_OS_WIN // On Windows we use the registry
481         else if (loc == SettingsPath) {
482             key = QLatin1String("Settings");
483             defaultValue = QLatin1String(".");
484         }
485 #endif
486
487         if(!key.isNull()) {
488             QSettings *config = QLibraryInfoPrivate::configuration();
489             config->beginGroup(QLatin1String(
490 #ifdef QT_BUILD_QMAKE
491                    group == DevicePaths ? "DevicePaths" :
492                    group == EffectiveSourcePaths ? "EffectiveSourcePaths" :
493                    group == EffectivePaths ? "EffectivePaths" :
494 #endif
495                                              "Paths"));
496
497             ret = config->value(key, defaultValue).toString();
498
499 #ifdef QT_BUILD_QMAKE
500             if (ret.isEmpty()) {
501                 if (loc == HostPrefixPath)
502                     ret = config->value(QLatin1String(qtConfEntries[PrefixPath].key),
503                                         QLatin1String(qtConfEntries[PrefixPath].value)).toString();
504                 else if (loc == TargetSpecPath || loc == HostSpecPath)
505                     ret = QString::fromLocal8Bit(qt_configure_strs + qt_configure_str_offsets[loc - 1]);
506             }
507 #endif
508
509             // expand environment variables in the form $(ENVVAR)
510             int rep;
511             QRegExp reg_var(QLatin1String("\\$\\(.*\\)"));
512             reg_var.setMinimal(true);
513             while((rep = reg_var.indexIn(ret)) != -1) {
514                 ret.replace(rep, reg_var.matchedLength(),
515                             QString::fromLocal8Bit(qgetenv(ret.mid(rep + 2,
516                                 reg_var.matchedLength() - 3).toLatin1().constData()).constData()));
517             }
518
519             config->endGroup();
520
521             ret = QDir::fromNativeSeparators(ret);
522         }
523 #endif // QT_NO_SETTINGS
524     }
525
526 #ifdef QT_BUILD_QMAKE
527     // The specs need to be returned verbatim.
528     if (loc == TargetSpecPath || loc == HostSpecPath)
529         return ret;
530 #endif
531
532     if (!ret.isEmpty() && QDir::isRelativePath(ret)) {
533         QString baseDir;
534 #ifdef QT_BUILD_QMAKE
535         if (loc == HostPrefixPath || loc == PrefixPath || loc == SysrootPath) {
536             // We make the prefix/sysroot path absolute to the executable's directory.
537             // loc == PrefixPath while a sysroot is set would make no sense here.
538             // loc == SysrootPath only makes sense if qmake lives inside the sysroot itself.
539             baseDir = QFileInfo(qmake_libraryInfoFile()).absolutePath();
540         } else if (loc > SysrootPath && loc <= LastHostPath) {
541             // We make any other host path absolute to the host prefix directory.
542             baseDir = rawLocation(HostPrefixPath, group);
543         } else {
544             // we make any other path absolute to the prefix directory
545             baseDir = rawLocation(PrefixPath, group);
546 #else
547         if (loc == PrefixPath) {
548             if (QCoreApplication::instance()) {
549 #ifdef Q_OS_MAC
550                 CFBundleRef bundleRef = CFBundleGetMainBundle();
551                 if (bundleRef) {
552                     QCFType<CFURLRef> urlRef = CFBundleCopyBundleURL(bundleRef);
553                     if (urlRef) {
554                         QCFString path = CFURLCopyFileSystemPath(urlRef, kCFURLPOSIXPathStyle);
555 #ifdef Q_OS_MACX
556                         QString bundleContentsDir = QString(path) + QLatin1String("/Contents/");
557                         if (QDir(bundleContentsDir).exists())
558                             return QDir::cleanPath(bundleContentsDir + ret);
559 #else
560                         return QDir::cleanPath(QString(path) + QLatin1Char('/') + ret); // iOS
561 #endif
562                     }
563                 }
564 #endif
565                 // We make the prefix path absolute to the executable's directory.
566                 baseDir = QCoreApplication::applicationDirPath();
567             } else {
568                 baseDir = QDir::currentPath();
569             }
570         } else {
571             // we make any other path absolute to the prefix directory
572             baseDir = location(PrefixPath);
573 #endif
574         }
575         ret = QDir::cleanPath(baseDir + QLatin1Char('/') + ret);
576     }
577     return ret;
578 }
579
580 /*!
581   Returns additional arguments to the platform plugin matching
582   \a platformName which can be specified as a string list using
583   the key \c Arguments in a group called \c Platforms of the
584   \c qt.conf  file.
585
586   sa {Using qt.conf}
587
588   \internal
589
590   \since 5.3
591 */
592
593 QStringList QLibraryInfo::platformPluginArguments(const QString &platformName)
594 {
595 #if !defined(QT_BUILD_QMAKE) && !defined(QT_NO_SETTINGS)
596     QScopedPointer<const QSettings> settings(QLibraryInfoPrivate::findConfiguration());
597     if (!settings.isNull()) {
598         QString key = QLatin1String(platformsSection);
599         key += QLatin1Char('/');
600         key += platformName;
601         key += QLatin1String("Arguments");
602         return settings->value(key).toStringList();
603     }
604 #endif // !QT_BUILD_QMAKE && !QT_NO_SETTINGS
605     return QStringList();
606 }
607
608 /*!
609     \enum QLibraryInfo::LibraryLocation
610
611     \keyword library location
612
613     This enum type is used to specify a specific location
614     specifier:
615
616     \value PrefixPath The default prefix for all paths.
617     \value DocumentationPath The location for documentation upon install.
618     \value HeadersPath The location for all headers.
619     \value LibrariesPath The location of installed libraries.
620     \value LibraryExecutablesPath The location of installed executables required by libraries at runtime.
621     \value BinariesPath The location of installed Qt binaries (tools and applications).
622     \value PluginsPath The location of installed Qt plugins.
623     \value ImportsPath The location of installed QML extensions to import (QML 1.x).
624     \value Qml2ImportsPath The location of installed QML extensions to import (QML 2.x).
625     \value ArchDataPath The location of general architecture-dependent Qt data.
626     \value DataPath The location of general architecture-independent Qt data.
627     \value TranslationsPath The location of translation information for Qt strings.
628     \value ExamplesPath The location for examples upon install.
629     \value TestsPath The location of installed Qt testcases.
630     \value SettingsPath The location for Qt settings. Not applicable on Windows.
631
632     \sa location()
633 */
634
635 QT_END_NAMESPACE
636
637 #if defined(Q_CC_GNU) && defined(ELF_INTERPRETER)
638 #  include <stdio.h>
639 #  include <stdlib.h>
640
641 #include "private/qcoreapplication_p.h"
642
643 extern const char qt_core_interpreter[] __attribute__((section(".interp")))
644     = ELF_INTERPRETER;
645
646 extern "C" void qt_core_boilerplate();
647 void qt_core_boilerplate()
648 {
649     printf("This is the QtCore library version " QT_BUILD_STR "\n"
650            "Copyright (C) 2015 The Qt Company Ltd.\n"
651            "Contact: http://www.qt.io/licensing/\n"
652            "\n"
653            "Installation prefix: %s\n"
654            "Library path:        %s\n"
655            "Include path:        %s\n",
656            qt_configure_prefix_path_str + 12,
657            qt_configure_strs + qt_configure_str_offsets[QT_PREPEND_NAMESPACE(QLibraryInfo)::LibrariesPath - 1],
658            qt_configure_strs + qt_configure_str_offsets[QT_PREPEND_NAMESPACE(QLibraryInfo)::HeadersPath - 1]);
659
660     QT_PREPEND_NAMESPACE(qDumpCPUFeatures)();
661
662 #ifdef QT_EVAL
663     extern void qt_core_eval_init(QCoreApplicationPrivate::Type);
664     qt_core_eval_init(QCoreApplicationPrivate::Tty);
665 #endif
666
667     exit(0);
668 }
669
670 #endif