introduce /dev variants of qmake properties

these reflect the on-target paths (unlike /raw, which are host paths, just
without the -sysroot). this is necessary for anything deployment-related,
starting with RPATH.

Change-Id: I13d598995d0e4d6cb0dc1fc7938b8631cf3e3a95
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
This commit is contained in:
Oswald Buddenhagen 2014-12-03 22:07:29 +01:00
parent 5b27d02c35
commit 1043bf202b
6 changed files with 32 additions and 13 deletions

6
configure vendored
View File

@ -3736,10 +3736,9 @@ static const char qt_configure_licensed_products_str [256 + 12] = "qt_lcnsprod=$
static const char qt_configure_installation [12+11] = "qt_instdate=`date +%Y-%m-%d`"; static const char qt_configure_installation [12+11] = "qt_instdate=`date +%Y-%m-%d`";
/* Installation Info */ /* Installation Info */
#ifndef QT_BUILD_QMAKE
static const char qt_configure_prefix_path_str [256 + 12] = "qt_prfxpath=$QT_INSTALL_PREFIX"; static const char qt_configure_prefix_path_str [256 + 12] = "qt_prfxpath=$QT_INSTALL_PREFIX";
#else #ifdef QT_BUILD_QMAKE
static const char qt_configure_prefix_path_str [256 + 12] = "qt_prfxpath=$QT_EXT_PREFIX"; static const char qt_configure_ext_prefix_path_str [256 + 12] = "qt_epfxpath=$QT_EXT_PREFIX";
static const char qt_configure_host_prefix_path_str [256 + 12] = "qt_hpfxpath=$QT_HOST_PREFIX"; static const char qt_configure_host_prefix_path_str [256 + 12] = "qt_hpfxpath=$QT_HOST_PREFIX";
#endif #endif
@ -3766,6 +3765,7 @@ $QT_CONFIGURE_STRS#endif
#define QT_CONFIGURE_PREFIX_PATH qt_configure_prefix_path_str + 12 #define QT_CONFIGURE_PREFIX_PATH qt_configure_prefix_path_str + 12
#ifdef QT_BUILD_QMAKE #ifdef QT_BUILD_QMAKE
# define QT_CONFIGURE_EXT_PREFIX_PATH qt_configure_ext_prefix_path_str + 12
# define QT_CONFIGURE_HOST_PREFIX_PATH qt_configure_host_prefix_path_str + 12 # define QT_CONFIGURE_HOST_PREFIX_PATH qt_configure_host_prefix_path_str + 12
#endif #endif
EOF EOF

View File

@ -50,7 +50,7 @@ MODULE_FWD_PRI = $$mod_work_pfx/qt_lib_$${MODULE_ID}.pri
host_build: \ host_build: \
module_rpath = "QT.$${MODULE_ID}.rpath = $$[QT_HOST_LIBS]" module_rpath = "QT.$${MODULE_ID}.rpath = $$[QT_HOST_LIBS]"
else: \ else: \
module_rpath = "QT.$${MODULE_ID}.rpath = $$[QT_INSTALL_LIBS/raw]" module_rpath = "QT.$${MODULE_ID}.rpath = $$[QT_INSTALL_LIBS/dev]"
} else { } else {
module_rpath = module_rpath =
} }

View File

@ -80,6 +80,7 @@ QMakeProperty::QMakeProperty() : settings(0)
m_values[ProKey(name + "/get")] = QLibraryInfo::rawLocation(propList[i].loc, QLibraryInfo::EffectivePaths); m_values[ProKey(name + "/get")] = QLibraryInfo::rawLocation(propList[i].loc, QLibraryInfo::EffectivePaths);
QString val = QLibraryInfo::rawLocation(propList[i].loc, QLibraryInfo::FinalPaths); QString val = QLibraryInfo::rawLocation(propList[i].loc, QLibraryInfo::FinalPaths);
if (!propList[i].raw) { if (!propList[i].raw) {
m_values[ProKey(name + "/dev")] = QLibraryInfo::rawLocation(propList[i].loc, QLibraryInfo::DevicePaths);
m_values[ProKey(name)] = QLibraryInfo::location(propList[i].loc); m_values[ProKey(name)] = QLibraryInfo::location(propList[i].loc);
name += "/raw"; name += "/raw";
} }
@ -159,6 +160,7 @@ QMakeProperty::exec()
ProString pval = value(ProKey(prop + "/raw")); ProString pval = value(ProKey(prop + "/raw"));
ProString gval = value(ProKey(prop + "/get")); ProString gval = value(ProKey(prop + "/get"));
ProString sval = value(ProKey(prop + "/src")); ProString sval = value(ProKey(prop + "/src"));
ProString dval = value(ProKey(prop + "/dev"));
fprintf(stdout, "%s:%s\n", prop.toLatin1().constData(), val.toLatin1().constData()); fprintf(stdout, "%s:%s\n", prop.toLatin1().constData(), val.toLatin1().constData());
if (!pval.isEmpty() && pval != val) if (!pval.isEmpty() && pval != val)
fprintf(stdout, "%s/raw:%s\n", prop.toLatin1().constData(), pval.toLatin1().constData()); fprintf(stdout, "%s/raw:%s\n", prop.toLatin1().constData(), pval.toLatin1().constData());
@ -166,6 +168,8 @@ QMakeProperty::exec()
fprintf(stdout, "%s/get:%s\n", prop.toLatin1().constData(), gval.toLatin1().constData()); fprintf(stdout, "%s/get:%s\n", prop.toLatin1().constData(), gval.toLatin1().constData());
if (!sval.isEmpty() && sval != gval) if (!sval.isEmpty() && sval != gval)
fprintf(stdout, "%s/src:%s\n", prop.toLatin1().constData(), sval.toLatin1().constData()); fprintf(stdout, "%s/src:%s\n", prop.toLatin1().constData(), sval.toLatin1().constData());
if (!dval.isEmpty() && dval != pval)
fprintf(stdout, "%s/dev:%s\n", prop.toLatin1().constData(), dval.toLatin1().constData());
} }
return true; return true;
} }

View File

@ -65,6 +65,7 @@ struct QLibrarySettings
QLibrarySettings(); QLibrarySettings();
QScopedPointer<QSettings> settings; QScopedPointer<QSettings> settings;
#ifdef QT_BUILD_QMAKE #ifdef QT_BUILD_QMAKE
bool haveDevicePaths;
bool haveEffectiveSourcePaths; bool haveEffectiveSourcePaths;
bool haveEffectivePaths; bool haveEffectivePaths;
bool havePaths; bool havePaths;
@ -83,7 +84,10 @@ public:
return ls ? (group == QLibraryInfo::EffectiveSourcePaths return ls ? (group == QLibraryInfo::EffectiveSourcePaths
? ls->haveEffectiveSourcePaths ? ls->haveEffectiveSourcePaths
: group == QLibraryInfo::EffectivePaths : group == QLibraryInfo::EffectivePaths
? ls->haveEffectivePaths : ls->havePaths) : false; ? ls->haveEffectivePaths
: group == QLibraryInfo::DevicePaths
? ls->haveDevicePaths
: ls->havePaths) : false;
} }
#endif #endif
static QSettings *configuration() static QSettings *configuration()
@ -99,6 +103,7 @@ QLibrarySettings::QLibrarySettings()
: settings(QLibraryInfoPrivate::findConfiguration()) : settings(QLibraryInfoPrivate::findConfiguration())
{ {
#ifndef QT_BUILD_QMAKE #ifndef QT_BUILD_QMAKE
bool haveDevicePaths;
bool haveEffectivePaths; bool haveEffectivePaths;
bool havePaths; bool havePaths;
#endif #endif
@ -106,6 +111,7 @@ QLibrarySettings::QLibrarySettings()
// This code needs to be in the regular library, as otherwise a qt.conf that // This code needs to be in the regular library, as otherwise a qt.conf that
// works for qmake would break things for dynamically built Qt tools. // works for qmake would break things for dynamically built Qt tools.
QStringList children = settings->childGroups(); QStringList children = settings->childGroups();
haveDevicePaths = children.contains(QLatin1String("DevicePaths"));
#ifdef QT_BUILD_QMAKE #ifdef QT_BUILD_QMAKE
haveEffectiveSourcePaths = children.contains(QLatin1String("EffectiveSourcePaths")); haveEffectiveSourcePaths = children.contains(QLatin1String("EffectiveSourcePaths"));
#else #else
@ -114,13 +120,15 @@ QLibrarySettings::QLibrarySettings()
#endif #endif
haveEffectivePaths = haveEffectiveSourcePaths || children.contains(QLatin1String("EffectivePaths")); haveEffectivePaths = haveEffectiveSourcePaths || children.contains(QLatin1String("EffectivePaths"));
// Backwards compat: an existing but empty file is claimed to contain the Paths section. // Backwards compat: an existing but empty file is claimed to contain the Paths section.
havePaths = (!haveEffectivePaths && !children.contains(QLatin1String(platformsSection))) havePaths = (!haveDevicePaths && !haveEffectivePaths
&& !children.contains(QLatin1String(platformsSection)))
|| children.contains(QLatin1String("Paths")); || children.contains(QLatin1String("Paths"));
#ifndef QT_BUILD_QMAKE #ifndef QT_BUILD_QMAKE
if (!havePaths) if (!havePaths)
settings.reset(0); settings.reset(0);
#else #else
} else { } else {
haveDevicePaths = false;
haveEffectiveSourcePaths = false; haveEffectiveSourcePaths = false;
haveEffectivePaths = false; haveEffectivePaths = false;
havePaths = false; havePaths = false;
@ -404,11 +412,12 @@ QLibraryInfo::rawLocation(LibraryLocation loc, PathGroup group)
// FinalPaths. For FinalPaths, use qt.conf if present and contains not only // FinalPaths. For FinalPaths, use qt.conf if present and contains not only
// [EffectivePaths], otherwise fall back to builtins. // [EffectivePaths], otherwise fall back to builtins.
// EffectiveSourcePaths falls back to EffectivePaths. // EffectiveSourcePaths falls back to EffectivePaths.
// DevicePaths falls back to FinalPaths.
PathGroup orig_group = group; PathGroup orig_group = group;
if (!QLibraryInfoPrivate::haveGroup(group) if (!QLibraryInfoPrivate::haveGroup(group)
&& !(group == EffectiveSourcePaths && !(group == EffectiveSourcePaths
&& (group = EffectivePaths, QLibraryInfoPrivate::haveGroup(group))) && (group = EffectivePaths, QLibraryInfoPrivate::haveGroup(group)))
&& !(group == EffectivePaths && !((group == EffectivePaths || group == DevicePaths)
&& (group = FinalPaths, QLibraryInfoPrivate::haveGroup(group))) && (group = FinalPaths, QLibraryInfoPrivate::haveGroup(group)))
&& (group = orig_group, true)) && (group = orig_group, true))
#elif !defined(QT_NO_SETTINGS) #elif !defined(QT_NO_SETTINGS)
@ -417,14 +426,19 @@ QLibraryInfo::rawLocation(LibraryLocation loc, PathGroup group)
{ {
const char *path = 0; const char *path = 0;
if (loc == PrefixPath) { if (loc == PrefixPath) {
path = QT_CONFIGURE_PREFIX_PATH; path =
#ifdef QT_BUILD_QMAKE
(group != DevicePaths) ?
QT_CONFIGURE_EXT_PREFIX_PATH :
#endif
QT_CONFIGURE_PREFIX_PATH;
} else if (unsigned(loc) <= sizeof(qt_configure_str_offsets)/sizeof(qt_configure_str_offsets[0])) { } else if (unsigned(loc) <= sizeof(qt_configure_str_offsets)/sizeof(qt_configure_str_offsets[0])) {
path = qt_configure_strs + qt_configure_str_offsets[loc - 1]; path = qt_configure_strs + qt_configure_str_offsets[loc - 1];
#ifndef Q_OS_WIN // On Windows we use the registry #ifndef Q_OS_WIN // On Windows we use the registry
} else if (loc == SettingsPath) { } else if (loc == SettingsPath) {
path = QT_CONFIGURE_SETTINGS_PATH; path = QT_CONFIGURE_SETTINGS_PATH;
#endif #endif
#ifdef QT_BOOTSTRAPPED #ifdef QT_BUILD_QMAKE
} else if (loc == HostPrefixPath) { } else if (loc == HostPrefixPath) {
path = QT_CONFIGURE_HOST_PREFIX_PATH; path = QT_CONFIGURE_HOST_PREFIX_PATH;
#endif #endif
@ -449,6 +463,7 @@ QLibraryInfo::rawLocation(LibraryLocation loc, PathGroup group)
QSettings *config = QLibraryInfoPrivate::configuration(); QSettings *config = QLibraryInfoPrivate::configuration();
config->beginGroup(QLatin1String( config->beginGroup(QLatin1String(
#ifdef QT_BUILD_QMAKE #ifdef QT_BUILD_QMAKE
group == DevicePaths ? "DevicePaths" :
group == EffectiveSourcePaths ? "EffectiveSourcePaths" : group == EffectiveSourcePaths ? "EffectiveSourcePaths" :
group == EffectivePaths ? "EffectivePaths" : group == EffectivePaths ? "EffectivePaths" :
#endif #endif

View File

@ -88,7 +88,7 @@ public:
}; };
static QString location(LibraryLocation); // ### Qt 6: consider renaming it to path() static QString location(LibraryLocation); // ### Qt 6: consider renaming it to path()
#ifdef QT_BUILD_QMAKE #ifdef QT_BUILD_QMAKE
enum PathGroup { FinalPaths, EffectivePaths, EffectiveSourcePaths }; enum PathGroup { FinalPaths, EffectivePaths, EffectiveSourcePaths, DevicePaths };
static QString rawLocation(LibraryLocation, PathGroup); static QString rawLocation(LibraryLocation, PathGroup);
#endif #endif

View File

@ -4054,10 +4054,9 @@ void Configure::generateQConfigCpp()
<< "static const char qt_configure_installation [11 + 12] = \"qt_instdate=" << QDate::currentDate().toString(Qt::ISODate) << "\";" << endl << "static const char qt_configure_installation [11 + 12] = \"qt_instdate=" << QDate::currentDate().toString(Qt::ISODate) << "\";" << endl
<< endl << endl
<< "/* Installation Info */" << endl << "/* Installation Info */" << endl
<< "#ifndef QT_BUILD_QMAKE" << endl
<< "static const char qt_configure_prefix_path_str [512 + 12] = \"qt_prfxpath=" << dictionary["QT_INSTALL_PREFIX"] << "\";" << endl << "static const char qt_configure_prefix_path_str [512 + 12] = \"qt_prfxpath=" << dictionary["QT_INSTALL_PREFIX"] << "\";" << endl
<< "#else" << endl << "#ifdef QT_BUILD_QMAKE" << endl
<< "static const char qt_configure_prefix_path_str [512 + 12] = \"qt_prfxpath=" << dictionary["QT_EXT_PREFIX"] << "\";" << endl << "static const char qt_configure_ext_prefix_path_str [512 + 12] = \"qt_epfxpath=" << dictionary["QT_EXT_PREFIX"] << "\";" << endl
<< "static const char qt_configure_host_prefix_path_str [512 + 12] = \"qt_hpfxpath=" << dictionary["QT_HOST_PREFIX"] << "\";" << endl << "static const char qt_configure_host_prefix_path_str [512 + 12] = \"qt_hpfxpath=" << dictionary["QT_HOST_PREFIX"] << "\";" << endl
<< "#endif" << endl << "#endif" << endl
<< endl << endl
@ -4085,6 +4084,7 @@ void Configure::generateQConfigCpp()
<< endl << endl
<< "#define QT_CONFIGURE_PREFIX_PATH qt_configure_prefix_path_str + 12\n" << "#define QT_CONFIGURE_PREFIX_PATH qt_configure_prefix_path_str + 12\n"
<< "#ifdef QT_BUILD_QMAKE\n" << "#ifdef QT_BUILD_QMAKE\n"
<< "# define QT_CONFIGURE_EXT_PREFIX_PATH qt_configure_ext_prefix_path_str + 12\n"
<< "# define QT_CONFIGURE_HOST_PREFIX_PATH qt_configure_host_prefix_path_str + 12\n" << "# define QT_CONFIGURE_HOST_PREFIX_PATH qt_configure_host_prefix_path_str + 12\n"
<< "#endif\n"; << "#endif\n";