diff options
author | Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> | 2014-12-04 16:03:13 +0100 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> | 2015-02-05 14:27:04 +0000 |
commit | 5b27d02c35d7b3f3feea9c5c97119b677578621d (patch) | |
tree | e94ec7b8e7bb9d5bb927f40f24b16231cdebd738 | |
parent | 887c8129e6b9c57b353d1b421c2497a6495e0f6b (diff) | |
download | qtbase-5b27d02c35d7b3f3feea9c5c97119b677578621d.tar.gz |
write relative paths to qconfig.cpp as far as possible
this cuts down the bloat in the binaries and the binary patching
requirements in the installer.
as a side effect, the sysroot and makespecs are not binary patchable any
more as well, which is ok, as the installer does not do it anyway.
we now also warn if -[host]<foo>dir is not a subdir of -[host]prefix, as
putting things outside the prefix is anti-thetical (the obvious
exception being the (unix-only) -sysconfdir).
Change-Id: I878f0e71a4dfcfd55b2f8b1cf3045b98b502569b
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
-rwxr-xr-x | configure | 369 | ||||
-rw-r--r-- | src/corelib/global/qlibraryinfo.cpp | 25 | ||||
-rw-r--r-- | src/corelib/global/qlibraryinfo.h | 4 | ||||
-rw-r--r-- | tools/configure/configureapp.cpp | 312 | ||||
-rw-r--r-- | tools/configure/configureapp.h | 5 |
5 files changed, 404 insertions, 311 deletions
@@ -436,16 +436,6 @@ filterLibraryOptions() filterPathOptions -L "$DEFAULT_LIBDIRS" } -substPrefix() -{ - base=${1#$QT_SYSROOT_PREFIX} - if [ x"$base" != x"$1" ]; then - echo "$QT_EXT_PREFIX$base" - else - echo "$1" - fi -} - #------------------------------------------------------------------------------- # device options #------------------------------------------------------------------------------- @@ -2284,7 +2274,8 @@ Installation options: host machine. If [dir] is not given, the current build directory will be used. (default EXTPREFIX) - You may use these to separate different parts of the install: + You may use these to change the layout of the install. Note that all directories + except -sysconfdir should be located under -prefix/-hostprefix: -bindir <dir> ......... User executables will be installed to <dir> (default PREFIX/bin) @@ -3507,7 +3498,7 @@ if echo $CFG_BUILD_PARTS | grep -v libs >/dev/null 2>&1; then fi #------------------------------------------------------------------------------- -# post process QT_INSTALL_* variables +# postprocess installation and deployment paths #------------------------------------------------------------------------------- if [ -z "$QT_INSTALL_PREFIX" ]; then @@ -3516,180 +3507,226 @@ if [ -z "$QT_INSTALL_PREFIX" ]; then else QT_INSTALL_PREFIX="/usr/local/Qt-${QT_VERSION}" # the default install prefix is /usr/local/Qt-$QT_VERSION fi + HAVE_INSTALL_PATH=false +else + HAVE_INSTALL_PATH=true fi QT_INSTALL_PREFIX=`makeabs "$QT_INSTALL_PREFIX"` -if [ -z "$QT_INSTALL_HEADERS" ]; then #default - QT_INSTALL_HEADERS="$QT_INSTALL_PREFIX/include" +if [ -z "$QT_EXT_PREFIX" ]; then + QT_EXT_PREFIX=$QT_INSTALL_PREFIX + if [ -n "$CFG_SYSROOT" ]; then + QMAKE_SYSROOTIFY=true + else + QMAKE_SYSROOTIFY=false + fi +else + QT_EXT_PREFIX=`makeabs "$QT_EXT_PREFIX"` + QMAKE_SYSROOTIFY=false +fi + +if [ -z "$QT_HOST_PREFIX" ]; then + if $QMAKE_SYSROOTIFY; then + QT_HOST_PREFIX=$CFG_SYSROOT$QT_EXT_PREFIX + else + QT_HOST_PREFIX=$QT_EXT_PREFIX + fi + HAVE_HOST_PATH=false +else + QT_HOST_PREFIX=`makeabs "$QT_HOST_PREFIX"` + HAVE_HOST_PATH=true +fi + +#------- make the paths relative to the prefixes -------- + +PREFIX_COMPLAINTS= +PREFIX_REMINDER=false +while read basevar baseoption var option; do + eval path=\$QT_${basevar}_$var + [ -z "$path" ] && continue + path=`makeabs "$path"` + eval base=\$QT_${basevar}_PREFIX + rel=${path##$base} + if [ x"$rel" = x"$path" ]; then + if [ x"$option" != x"sysconf" ]; then + PREFIX_COMPLAINTS="$PREFIX_COMPLAINTS + NOTICE: -${option}dir is not a subdirectory of ${baseoption}prefix." + eval \$HAVE_${basevar}_PATH || PREFIX_REMINDER=true + fi + eval QT_REL_${basevar}_$var=\$rel + elif [ -z "$rel" ]; then + eval QT_REL_${basevar}_$var=. + else + eval QT_REL_${basevar}_$var=\${rel#/} + fi +done <<EOF +INSTALL - DOCS doc +INSTALL - HEADERS header +INSTALL - LIBS lib +INSTALL - LIBEXECS libexec +INSTALL - BINS bin +INSTALL - PLUGINS plugin +INSTALL - IMPORTS import +INSTALL - QML qml +INSTALL - ARCHDATA archdata +INSTALL - DATA data +INSTALL - TRANSLATIONS translation +INSTALL - EXAMPLES examples +INSTALL - TESTS tests +INSTALL - SETTINGS sysconf +HOST -host BINS hostbin +HOST -host LIBS hostlib +HOST -host DATA hostdata +EOF +$PREFIX_REMINDER && PREFIX_COMPLAINTS="$PREFIX_COMPLAINTS + Maybe you forgot to specify -prefix/-hostprefix?" + +if [ -z "$QT_REL_INSTALL_HEADERS" ]; then + QT_REL_INSTALL_HEADERS=include fi -QT_INSTALL_HEADERS=`makeabs "$QT_INSTALL_HEADERS"` -if [ -z "$QT_INSTALL_LIBS" ]; then #default - QT_INSTALL_LIBS="$QT_INSTALL_PREFIX/lib" #fallback +if [ -z "$QT_REL_INSTALL_LIBS" ]; then + QT_REL_INSTALL_LIBS=lib fi -QT_INSTALL_LIBS=`makeabs "$QT_INSTALL_LIBS"` -if [ -z "$QT_INSTALL_ARCHDATA" ]; then #default - QT_INSTALL_ARCHDATA="$QT_INSTALL_PREFIX" #fallback +if [ -z "$QT_REL_INSTALL_BINS" ]; then + QT_REL_INSTALL_BINS=bin fi -QT_INSTALL_ARCHDATA=`makeabs "$QT_INSTALL_ARCHDATA"` -if [ -z "$QT_INSTALL_DATA" ]; then #default - QT_INSTALL_DATA="$QT_INSTALL_PREFIX" #fallback +if [ -z "$QT_REL_INSTALL_ARCHDATA" ]; then + QT_REL_INSTALL_ARCHDATA=. +fi +if [ x"$QT_REL_INSTALL_ARCHDATA" != x. ]; then + QT_REL_INSTALL_ARCHDATA_PREFIX=$QT_REL_INSTALL_ARCHDATA/ fi -QT_INSTALL_DATA=`makeabs "$QT_INSTALL_DATA"` -if [ -z "$QT_INSTALL_BINS" ]; then #default - QT_INSTALL_BINS="$QT_INSTALL_PREFIX/bin" #fallback +if [ -z "$QT_REL_INSTALL_LIBEXECS" ]; then + if [ "$XPLATFORM_MINGW" = "yes" ]; then + QT_REL_INSTALL_LIBEXECS=${QT_REL_INSTALL_ARCHDATA_PREFIX}bin + else + QT_REL_INSTALL_LIBEXECS=${QT_REL_INSTALL_ARCHDATA_PREFIX}libexec + fi fi -QT_INSTALL_BINS=`makeabs "$QT_INSTALL_BINS"` -if [ "$XPLATFORM_MINGW" = "yes" ]; then - QT_INSTALL_LIBEXECS_DIRNAME="bin" -else - QT_INSTALL_LIBEXECS_DIRNAME="libexec" +if [ -z "$QT_REL_INSTALL_PLUGINS" ]; then + QT_REL_INSTALL_PLUGINS=${QT_REL_INSTALL_ARCHDATA_PREFIX}plugins fi -if [ -z "$QT_INSTALL_LIBEXECS" ]; then #default - QT_INSTALL_LIBEXECS="$QT_INSTALL_ARCHDATA/$QT_INSTALL_LIBEXECS_DIRNAME" #fallback +if [ -z "$QT_REL_INSTALL_IMPORTS" ]; then + QT_REL_INSTALL_IMPORTS=${QT_REL_INSTALL_ARCHDATA_PREFIX}imports fi -QT_INSTALL_LIBEXECS=`makeabs "$QT_INSTALL_LIBEXECS"` -if [ -z "$QT_INSTALL_DOCS" ]; then #default - QT_INSTALL_DOCS="$QT_INSTALL_DATA/doc" #fallback +if [ -z "$QT_REL_INSTALL_QML" ]; then + QT_REL_INSTALL_QML=${QT_REL_INSTALL_ARCHDATA_PREFIX}qml fi -QT_INSTALL_DOCS=`makeabs "$QT_INSTALL_DOCS"` -if [ -z "$QT_INSTALL_PLUGINS" ]; then #default - QT_INSTALL_PLUGINS="$QT_INSTALL_ARCHDATA/plugins" #fallback +if [ -z "$QT_REL_INSTALL_DATA" ]; then + QT_REL_INSTALL_DATA=. +fi +if [ x"$QT_REL_INSTALL_DATA" != x. ]; then + QT_REL_INSTALL_DATA_PREFIX=$QT_REL_INSTALL_DATA/ +fi + +if [ -z "$QT_REL_INSTALL_DOCS" ]; then + QT_REL_INSTALL_DOCS=${QT_REL_INSTALL_DATA_PREFIX}doc fi -QT_INSTALL_PLUGINS=`makeabs "$QT_INSTALL_PLUGINS"` -if [ -z "$QT_INSTALL_IMPORTS" ]; then #default - QT_INSTALL_IMPORTS="$QT_INSTALL_ARCHDATA/imports" #fallback +if [ -z "$QT_REL_INSTALL_TRANSLATIONS" ]; then + QT_REL_INSTALL_TRANSLATIONS=${QT_REL_INSTALL_DATA_PREFIX}translations fi -QT_INSTALL_IMPORTS=`makeabs "$QT_INSTALL_IMPORTS"` -#qml -if [ -z "$QT_INSTALL_QML" ]; then #default - QT_INSTALL_QML="$QT_INSTALL_ARCHDATA/qml" #fallback +if [ -z "$QT_REL_INSTALL_EXAMPLES" ]; then + QT_REL_INSTALL_EXAMPLES=examples fi -QT_INSTALL_QML=`makeabs "$QT_INSTALL_QML"` -if [ -z "$QT_INSTALL_TRANSLATIONS" ]; then #default - QT_INSTALL_TRANSLATIONS="$QT_INSTALL_DATA/translations" #fallback +if [ -z "$QT_REL_INSTALL_TESTS" ]; then + QT_REL_INSTALL_TESTS=tests fi -QT_INSTALL_TRANSLATIONS=`makeabs "$QT_INSTALL_TRANSLATIONS"` -if [ -z "$QT_INSTALL_SETTINGS" ]; then #default +if [ -z "$QT_REL_INSTALL_SETTINGS" ]; then if [ "$XPLATFORM_MAC" = "yes" ]; then - QT_INSTALL_SETTINGS=/Library/Preferences/Qt + QT_REL_INSTALL_SETTINGS=/Library/Preferences/Qt else - QT_INSTALL_SETTINGS=$QT_INSTALL_PREFIX/etc/xdg - fi -fi -QT_INSTALL_SETTINGS=`makeabs "$QT_INSTALL_SETTINGS"` - -if [ -z "$QT_INSTALL_EXAMPLES" ]; then #default - QT_INSTALL_EXAMPLES="$QT_INSTALL_PREFIX/examples" #fallback -fi -QT_INSTALL_EXAMPLES=`makeabs "$QT_INSTALL_EXAMPLES"` - -#tests -if [ -z "$QT_INSTALL_TESTS" ]; then #default - QT_INSTALL_TESTS="$QT_INSTALL_PREFIX/tests" #fallback -fi -QT_INSTALL_TESTS=`makeabs "$QT_INSTALL_TESTS"` - -#------- sysroot-external install paths -------- - -QT_SYSROOT_PREFIX=$QT_INSTALL_PREFIX -QT_SYSROOT_DOCS=$QT_INSTALL_DOCS -QT_SYSROOT_HEADERS=$QT_INSTALL_HEADERS -QT_SYSROOT_LIBS=$QT_INSTALL_LIBS -QT_SYSROOT_LIBEXECS=$QT_INSTALL_LIBEXECS -QT_SYSROOT_BINS=$QT_INSTALL_BINS -QT_SYSROOT_PLUGINS=$QT_INSTALL_PLUGINS -QT_SYSROOT_IMPORTS=$QT_INSTALL_IMPORTS -QT_SYSROOT_QML=$QT_INSTALL_QML -QT_SYSROOT_ARCHDATA=$QT_INSTALL_ARCHDATA -QT_SYSROOT_DATA=$QT_INSTALL_DATA -QT_SYSROOT_TRANSLATIONS=$QT_INSTALL_TRANSLATIONS -QT_SYSROOT_EXAMPLES=$QT_INSTALL_EXAMPLES -QT_SYSROOT_TESTS=$QT_INSTALL_TESTS -if [ -n "$QT_EXT_PREFIX" ]; then - QT_INSTALL_PREFIX=$QT_EXT_PREFIX - QT_INSTALL_DOCS=`substPrefix "$QT_INSTALL_DOCS"` - QT_INSTALL_HEADERS=`substPrefix "$QT_INSTALL_HEADERS"` - QT_INSTALL_LIBS=`substPrefix "$QT_INSTALL_LIBS"` - QT_INSTALL_LIBEXECS=`substPrefix "$QT_INSTALL_LIBEXECS"` - QT_INSTALL_BINS=`substPrefix "$QT_INSTALL_BINS"` - QT_INSTALL_PLUGINS=`substPrefix "$QT_INSTALL_PLUGINS"` - QT_INSTALL_IMPORTS=`substPrefix "$QT_INSTALL_IMPORTS"` - QT_INSTALL_QML=`substPrefix "$QT_INSTALL_QML"` - QT_INSTALL_ARCHDATA=`substPrefix "$QT_INSTALL_ARCHDATA"` - QT_INSTALL_DATA=`substPrefix "$QT_INSTALL_DATA"` - QT_INSTALL_TRANSLATIONS=`substPrefix "$QT_INSTALL_TRANSLATIONS"` - QT_INSTALL_EXAMPLES=`substPrefix "$QT_INSTALL_EXAMPLES"` - QT_INSTALL_TESTS=`substPrefix "$QT_INSTALL_TESTS"` + QT_REL_INSTALL_SETTINGS=etc/xdg + fi fi #------- host paths -------- -if [ -z "$QT_HOST_PREFIX" ]; then - QT_HOST_PREFIX=$QT_INSTALL_PREFIX - haveHpx=false -else - QT_HOST_PREFIX=`makeabs "$QT_HOST_PREFIX"` - haveHpx=true -fi - -if [ -z "$QT_HOST_BINS" ]; then #default - if $haveHpx; then - QT_HOST_BINS="$QT_HOST_PREFIX/bin" #fallback +if [ -z "$QT_REL_HOST_BINS" ]; then + if $HAVE_HOST_PATH; then + QT_REL_HOST_BINS=bin else - QT_HOST_BINS="$QT_INSTALL_BINS" + QT_REL_HOST_BINS=$QT_REL_INSTALL_BINS fi fi -QT_HOST_BINS=`makeabs "$QT_HOST_BINS"` -if [ -z "$QT_HOST_LIBS" ]; then #default - if $haveHpx; then - QT_HOST_LIBS="$QT_HOST_PREFIX/lib" #fallback +if [ -z "$QT_REL_HOST_LIBS" ]; then + if $HAVE_HOST_PATH; then + QT_REL_HOST_LIBS=lib else - QT_HOST_LIBS="$QT_INSTALL_LIBS" + QT_REL_HOST_LIBS=$QT_REL_INSTALL_LIBS fi fi -QT_HOST_LIBS=`makeabs "$QT_HOST_LIBS"` -if [ -z "$QT_HOST_DATA" ]; then #default - if $haveHpx; then - QT_HOST_DATA="$QT_HOST_PREFIX" +if [ -z "$QT_REL_HOST_DATA" ]; then + if $HAVE_HOST_PATH; then + QT_REL_HOST_DATA=. else - QT_HOST_DATA="$QT_INSTALL_ARCHDATA" + QT_REL_HOST_DATA=$QT_REL_INSTALL_ARCHDATA fi -else - QT_HOST_DATA=`makeabs "$QT_HOST_DATA"` fi if [ "$CFG_COMPILE_EXAMPLES" = "yes" ]; then QMAKE_CONFIG="$QMAKE_CONFIG compile_examples" fi +shortxspec=`echo $XQMAKESPEC | sed "s,^${relpath}/mkspecs/,,"` +shortspec=`echo $QMAKESPEC | sed "s,^${relpath}/mkspecs/,,"` + +QT_CONFIGURE_STR_OFF=0 + +addConfStr() +{ + QT_CONFIGURE_STR_OFFSETS="$QT_CONFIGURE_STR_OFFSETS $QT_CONFIGURE_STR_OFF," + QT_CONFIGURE_STRS="$QT_CONFIGURE_STRS \"$1\\0\" +" + count=`echo "$1" | wc -c` + QT_CONFIGURE_STR_OFF=`expr $QT_CONFIGURE_STR_OFF + $count` +} + +QT_CONFIGURE_STR_OFFSETS= +QT_CONFIGURE_STRS= +addConfStr "$QT_REL_INSTALL_DOCS" +addConfStr "$QT_REL_INSTALL_HEADERS" +addConfStr "$QT_REL_INSTALL_LIBS" +addConfStr "$QT_REL_INSTALL_LIBEXECS" +addConfStr "$QT_REL_INSTALL_BINS" +addConfStr "$QT_REL_INSTALL_PLUGINS" +addConfStr "$QT_REL_INSTALL_IMPORTS" +addConfStr "$QT_REL_INSTALL_QML" +addConfStr "$QT_REL_INSTALL_ARCHDATA" +addConfStr "$QT_REL_INSTALL_DATA" +addConfStr "$QT_REL_INSTALL_TRANSLATIONS" +addConfStr "$QT_REL_INSTALL_EXAMPLES" +addConfStr "$QT_REL_INSTALL_TESTS" +QT_CONFIGURE_STR_OFFSETS_ALL=$QT_CONFIGURE_STR_OFFSETS +QT_CONFIGURE_STRS_ALL=$QT_CONFIGURE_STRS + +QT_CONFIGURE_STR_OFFSETS= +QT_CONFIGURE_STRS= +addConfStr "$CFG_SYSROOT" +addConfStr "$QT_REL_HOST_BINS" +addConfStr "$QT_REL_HOST_LIBS" +addConfStr "$QT_REL_HOST_DATA" +addConfStr "$shortxspec" +addConfStr "$shortspec" + #------------------------------------------------------------------------------- # generate qconfig.cpp #------------------------------------------------------------------------------- [ -d "$outpath/src/corelib/global" ] || mkdir -p "$outpath/src/corelib/global" -shortxspec=`echo $XQMAKESPEC | sed "s,^${relpath}/mkspecs/,,"` -shortspec=`echo $QMAKESPEC | sed "s,^${relpath}/mkspecs/,,"` - -if [ -z "$QT_EXT_PREFIX" ]; then - QMAKE_SYSROOTIFY=y -else - QMAKE_SYSROOTIFY=n -fi - cat > "$outpath/src/corelib/global/qconfig.cpp.new" <<EOF /* License Info */ static const char qt_configure_licensee_str [256 + 12] = "qt_lcnsuser=$Licensee"; @@ -3699,60 +3736,38 @@ 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`"; /* Installation Info */ -static const char qt_configure_prefix_path_strs[][256 + 12] = { #ifndef QT_BUILD_QMAKE - "qt_prfxpath=$QT_SYSROOT_PREFIX", - "qt_docspath=$QT_SYSROOT_DOCS", - "qt_hdrspath=$QT_SYSROOT_HEADERS", - "qt_libspath=$QT_SYSROOT_LIBS", - "qt_lbexpath=$QT_SYSROOT_LIBEXECS", - "qt_binspath=$QT_SYSROOT_BINS", - "qt_plugpath=$QT_SYSROOT_PLUGINS", - "qt_impspath=$QT_SYSROOT_IMPORTS", - "qt_qml2path=$QT_SYSROOT_QML", - "qt_adatpath=$QT_SYSROOT_ARCHDATA", - "qt_datapath=$QT_SYSROOT_DATA", - "qt_trnspath=$QT_SYSROOT_TRANSLATIONS", - "qt_xmplpath=$QT_SYSROOT_EXAMPLES", - "qt_tstspath=$QT_SYSROOT_TESTS", +static const char qt_configure_prefix_path_str [256 + 12] = "qt_prfxpath=$QT_INSTALL_PREFIX"; #else - "qt_prfxpath=$QT_INSTALL_PREFIX", - "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", - "qt_qml2path=$QT_INSTALL_QML", - "qt_adatpath=$QT_INSTALL_ARCHDATA", - "qt_datapath=$QT_INSTALL_DATA", - "qt_trnspath=$QT_INSTALL_TRANSLATIONS", - "qt_xmplpath=$QT_INSTALL_EXAMPLES", - "qt_tstspath=$QT_INSTALL_TESTS", - "qt_ssrtpath=$CFG_SYSROOT", - "qt_hpfxpath=$QT_HOST_PREFIX", - "qt_hbinpath=$QT_HOST_BINS", - "qt_hlibpath=$QT_HOST_LIBS", - "qt_hdatpath=$QT_HOST_DATA", - "qt_targspec=$shortxspec", - "qt_hostspec=$shortspec", +static const char qt_configure_prefix_path_str [256 + 12] = "qt_prfxpath=$QT_EXT_PREFIX"; +static const char qt_configure_host_prefix_path_str [256 + 12] = "qt_hpfxpath=$QT_HOST_PREFIX"; #endif -}; -static const char qt_configure_settings_path_str[256 + 12] = "qt_stngpath=$QT_INSTALL_SETTINGS"; +static const short qt_configure_str_offsets[] = { + $QT_CONFIGURE_STR_OFFSETS_ALL #ifdef QT_BUILD_QMAKE -static const char qt_sysrootify_prefix[] = "qt_ssrtfpfx=$QMAKE_SYSROOTIFY"; + $QT_CONFIGURE_STR_OFFSETS #endif -EOF +}; +static const char qt_configure_strs[] = +$QT_CONFIGURE_STRS_ALL#ifdef QT_BUILD_QMAKE +$QT_CONFIGURE_STRS#endif +; + +#define QT_CONFIGURE_SETTINGS_PATH "$QT_REL_INSTALL_SETTINGS" -cat >> "$outpath/src/corelib/global/qconfig.cpp.new" <<EOF +#ifdef QT_BUILD_QMAKE +# define QT_CONFIGURE_SYSROOTIFY_PREFIX $QMAKE_SYSROOTIFY +#endif /* strlen( "qt_lcnsxxxx" ) == 12 */ #define QT_CONFIGURE_LICENSEE qt_configure_licensee_str + 12 #define QT_CONFIGURE_LICENSED_PRODUCTS qt_configure_licensed_products_str + 12 -#define QT_CONFIGURE_SETTINGS_PATH qt_configure_settings_path_str + 12 +#define QT_CONFIGURE_PREFIX_PATH qt_configure_prefix_path_str + 12 +#ifdef QT_BUILD_QMAKE +# define QT_CONFIGURE_HOST_PREFIX_PATH qt_configure_host_prefix_path_str + 12 +#endif EOF # avoid unecessary rebuilds by copying only if qconfig.cpp has changed @@ -7093,6 +7108,12 @@ if [ -n "$RPATH_MESSAGE" ]; then echo "$RPATH_MESSAGE" fi +if [ -n "$PREFIX_COMPLAINTS" ]; then + echo + echo "$PREFIX_COMPLAINTS" + echo +fi + MAKE=`basename "$MAKE"` echo echo Qt is now configured for building. Just run \'$MAKE\'. diff --git a/src/corelib/global/qlibraryinfo.cpp b/src/corelib/global/qlibraryinfo.cpp index ea8c201acf..a75fb365a3 100644 --- a/src/corelib/global/qlibraryinfo.cpp +++ b/src/corelib/global/qlibraryinfo.cpp @@ -361,12 +361,12 @@ static const struct { { "Tests", "tests" }, #ifdef QT_BUILD_QMAKE { "Sysroot", "" }, - { "HostPrefix", "" }, { "HostBinaries", "bin" }, { "HostLibraries", "lib" }, { "HostData", "." }, { "TargetSpec", "" }, { "HostSpec", "" }, + { "HostPrefix", "" }, #endif }; @@ -381,7 +381,7 @@ QLibraryInfo::location(LibraryLocation loc) QString ret = rawLocation(loc, FinalPaths); // Automatically prepend the sysroot to target paths - if ((loc < SysrootPath || loc > LastHostPath) && qt_sysrootify_prefix[12] == 'y') { + if ((loc < SysrootPath || loc > LastHostPath) && QT_CONFIGURE_SYSROOTIFY_PREFIX) { QString sysroot = rawLocation(SysrootPath, FinalPaths); if (!sysroot.isEmpty() && ret.length() > 2 && ret.at(1) == QLatin1Char(':') && (ret.at(2) == QLatin1Char('/') || ret.at(2) == QLatin1Char('\\'))) @@ -416,12 +416,19 @@ QLibraryInfo::rawLocation(LibraryLocation loc, PathGroup group) #endif { const char *path = 0; - if (unsigned(loc) < sizeof(qt_configure_prefix_path_strs)/sizeof(qt_configure_prefix_path_strs[0])) - path = qt_configure_prefix_path_strs[loc] + 12; + if (loc == PrefixPath) { + path = QT_CONFIGURE_PREFIX_PATH; + } 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]; #ifndef Q_OS_WIN // On Windows we use the registry - else if (loc == SettingsPath) + } else if (loc == SettingsPath) { path = QT_CONFIGURE_SETTINGS_PATH; #endif +#ifdef QT_BOOTSTRAPPED + } else if (loc == HostPrefixPath) { + path = QT_CONFIGURE_HOST_PREFIX_PATH; +#endif + } if (path) ret = QString::fromLocal8Bit(path); @@ -455,7 +462,7 @@ QLibraryInfo::rawLocation(LibraryLocation loc, PathGroup group) ret = config->value(QLatin1String(qtConfEntries[PrefixPath].key), QLatin1String(qtConfEntries[PrefixPath].value)).toString(); else if (loc == TargetSpecPath || loc == HostSpecPath) - ret = QString::fromLocal8Bit(qt_configure_prefix_path_strs[loc] + 12); + ret = QString::fromLocal8Bit(qt_configure_strs + qt_configure_str_offsets[loc - 1]); } #endif @@ -608,9 +615,9 @@ void qt_core_boilerplate() "Library path: %s\n" "Include path: %s\n", qt_configure_installation + 12, - qt_configure_prefix_path_strs[QT_PREPEND_NAMESPACE(QLibraryInfo)::PrefixPath] + 12, - qt_configure_prefix_path_strs[QT_PREPEND_NAMESPACE(QLibraryInfo)::LibrariesPath] + 12, - qt_configure_prefix_path_strs[QT_PREPEND_NAMESPACE(QLibraryInfo)::HeadersPath] + 12); + qt_configure_prefix_path_str + 12, + qt_configure_strs + qt_configure_str_offsets[QT_PREPEND_NAMESPACE(QLibraryInfo)::LibrariesPath - 1], + qt_configure_strs + qt_configure_str_offsets[QT_PREPEND_NAMESPACE(QLibraryInfo)::HeadersPath - 1]); QT_PREPEND_NAMESPACE(qDumpCPUFeatures)(); diff --git a/src/corelib/global/qlibraryinfo.h b/src/corelib/global/qlibraryinfo.h index 80d19f415c..8dccb25665 100644 --- a/src/corelib/global/qlibraryinfo.h +++ b/src/corelib/global/qlibraryinfo.h @@ -76,13 +76,13 @@ public: #ifdef QT_BUILD_QMAKE // These are not subject to binary compatibility constraints SysrootPath, - HostPrefixPath, HostBinariesPath, HostLibrariesPath, HostDataPath, TargetSpecPath, HostSpecPath, - LastHostPath = HostSpecPath, + HostPrefixPath, + LastHostPath = HostPrefixPath, #endif SettingsPath = 100 }; diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index 847ab3a092..c206075646 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -1727,7 +1727,8 @@ bool Configure::displayHelp() "host machine. If [dir] is not given, the current build\n" "directory will be used. (default EXTPREFIX)\n"); - desc("You may use these to separate different parts of the install:\n\n"); + desc("You may use these to change the layout of the install. Note that all directories\n" + "except -sysconfdir should be located under -prefix/-hostprefix:\n\n"); 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)"); @@ -3832,6 +3833,11 @@ void Configure::displayConfig() << "will be the same unless you are cross-compiling)." << endl << endl; } + if (!dictionary["PREFIX_COMPLAINTS"].isEmpty()) { + sout << endl + << dictionary["PREFIX_COMPLAINTS"] << endl + << endl; + } // display config.summary sout.seekg(0, ios::beg); @@ -3867,11 +3873,11 @@ void Configure::generateHeaders() } } -void Configure::substPrefix(QString *path) +void Configure::addConfStr(int group, const QString &val) { - QString spfx = dictionary["QT_SYSROOT_PREFIX"]; - if (path->startsWith(spfx)) - path->replace(0, spfx.size(), dictionary["QT_EXT_PREFIX"]); + confStrOffsets[group] += ' ' + QString::number(confStringOff) + ','; + confStrings[group] += " \"" + val + "\\0\"\n"; + confStringOff += val.length() + 1; } void Configure::generateQConfigCpp() @@ -3879,87 +3885,163 @@ void Configure::generateQConfigCpp() QString hostSpec = dictionary["QMAKESPEC"]; QString targSpec = dictionary.contains("XQMAKESPEC") ? dictionary["XQMAKESPEC"] : hostSpec; - // if QT_INSTALL_* have not been specified on commandline, define them now from QT_INSTALL_PREFIX - // if prefix is empty (WINCE), make all of them empty, if they aren't set + dictionary["CFG_SYSROOT"] = QDir::cleanPath(dictionary["CFG_SYSROOT"]); + bool qipempty = false; if (dictionary["QT_INSTALL_PREFIX"].isEmpty()) qipempty = true; - - 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_LIBEXECS"].size()) { - if (targSpec.startsWith("win")) - dictionary["QT_INSTALL_LIBEXECS"] = qipempty ? "" : dictionary["QT_INSTALL_ARCHDATA"] + "/bin"; - else - 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()) - dictionary["QT_INSTALL_PLUGINS"] = qipempty ? "" : dictionary["QT_INSTALL_ARCHDATA"] + "/plugins"; - if (!dictionary["QT_INSTALL_IMPORTS"].size()) - dictionary["QT_INSTALL_IMPORTS"] = qipempty ? "" : dictionary["QT_INSTALL_ARCHDATA"] + "/imports"; - if (!dictionary["QT_INSTALL_QML"].size()) - dictionary["QT_INSTALL_QML"] = qipempty ? "" : dictionary["QT_INSTALL_ARCHDATA"] + "/qml"; - 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_DATA"] + "/translations"; - if (!dictionary["QT_INSTALL_EXAMPLES"].size()) - dictionary["QT_INSTALL_EXAMPLES"] = qipempty ? "" : dictionary["QT_INSTALL_PREFIX"] + "/examples"; - if (!dictionary["QT_INSTALL_TESTS"].size()) - dictionary["QT_INSTALL_TESTS"] = qipempty ? "" : dictionary["QT_INSTALL_PREFIX"] + "/tests"; - - QChar sysrootifyPrefix = QLatin1Char('y'); - dictionary["QT_SYSROOT_PREFIX"] = dictionary["QT_INSTALL_PREFIX"]; - dictionary["QT_SYSROOT_HEADERS"] = dictionary["QT_INSTALL_HEADERS"]; - dictionary["QT_SYSROOT_LIBS"] = dictionary["QT_INSTALL_LIBS"]; - dictionary["QT_SYSROOT_ARCHDATA"] = dictionary["QT_INSTALL_ARCHDATA"]; - dictionary["QT_SYSROOT_LIBEXECS"] = dictionary["QT_INSTALL_LIBEXECS"]; - dictionary["QT_SYSROOT_BINS"] = dictionary["QT_INSTALL_BINS"]; - dictionary["QT_SYSROOT_PLUGINS"] = dictionary["QT_INSTALL_PLUGINS"]; - dictionary["QT_SYSROOT_IMPORTS"] = dictionary["QT_INSTALL_IMPORTS"]; - dictionary["QT_SYSROOT_QML"] = dictionary["QT_INSTALL_QML"]; - dictionary["QT_SYSROOT_DATA"] = dictionary["QT_INSTALL_DATA"]; - dictionary["QT_SYSROOT_DOCS"] = dictionary["QT_INSTALL_DOCS"]; - dictionary["QT_SYSROOT_TRANSLATIONS"] = dictionary["QT_INSTALL_TRANSLATIONS"]; - dictionary["QT_SYSROOT_EXAMPLES"] = dictionary["QT_INSTALL_EXAMPLES"]; - dictionary["QT_SYSROOT_TESTS"] = dictionary["QT_INSTALL_TESTS"]; - if (dictionary["QT_EXT_PREFIX"].size()) { - sysrootifyPrefix = QLatin1Char('n'); - dictionary["QT_INSTALL_PREFIX"] = dictionary["QT_EXT_PREFIX"]; - substPrefix(&dictionary["QT_INSTALL_HEADERS"]); - substPrefix(&dictionary["QT_INSTALL_LIBS"]); - substPrefix(&dictionary["QT_INSTALL_ARCHDATA"]); - substPrefix(&dictionary["QT_INSTALL_LIBEXECS"]); - substPrefix(&dictionary["QT_INSTALL_BINS"]); - substPrefix(&dictionary["QT_INSTALL_PLUGINS"]); - substPrefix(&dictionary["QT_INSTALL_IMPORTS"]); - substPrefix(&dictionary["QT_INSTALL_QML"]); - substPrefix(&dictionary["QT_INSTALL_DATA"]); - substPrefix(&dictionary["QT_INSTALL_DOCS"]); - substPrefix(&dictionary["QT_INSTALL_TRANSLATIONS"]); - substPrefix(&dictionary["QT_INSTALL_EXAMPLES"]); - substPrefix(&dictionary["QT_INSTALL_TESTS"]); - } - - bool haveHpx = false; - if (dictionary["QT_HOST_PREFIX"].isEmpty()) - dictionary["QT_HOST_PREFIX"] = dictionary["QT_INSTALL_PREFIX"]; else + dictionary["QT_INSTALL_PREFIX"] = QDir::cleanPath(dictionary["QT_INSTALL_PREFIX"]); + + bool sysrootifyPrefix; + if (dictionary["QT_EXT_PREFIX"].isEmpty()) { + dictionary["QT_EXT_PREFIX"] = dictionary["QT_INSTALL_PREFIX"]; + sysrootifyPrefix = !dictionary["CFG_SYSROOT"].isEmpty(); + } else { + dictionary["QT_EXT_PREFIX"] = QDir::cleanPath(dictionary["QT_EXT_PREFIX"]); + sysrootifyPrefix = false; + } + + bool haveHpx; + if (dictionary["QT_HOST_PREFIX"].isEmpty()) { + dictionary["QT_HOST_PREFIX"] = (sysrootifyPrefix ? dictionary["CFG_SYSROOT"] : QString()) + + dictionary["QT_INSTALL_PREFIX"]; + haveHpx = false; + } else { + dictionary["QT_HOST_PREFIX"] = QDir::cleanPath(dictionary["QT_HOST_PREFIX"]); haveHpx = true; - if (dictionary["QT_HOST_BINS"].isEmpty()) - dictionary["QT_HOST_BINS"] = haveHpx ? dictionary["QT_HOST_PREFIX"] + "/bin" : dictionary["QT_INSTALL_BINS"]; - if (dictionary["QT_HOST_LIBS"].isEmpty()) - dictionary["QT_HOST_LIBS"] = haveHpx ? dictionary["QT_HOST_PREFIX"] + "/lib" : dictionary["QT_INSTALL_LIBS"]; - if (dictionary["QT_HOST_DATA"].isEmpty()) - dictionary["QT_HOST_DATA"] = haveHpx ? dictionary["QT_HOST_PREFIX"] : dictionary["QT_INSTALL_ARCHDATA"]; + } + + static const struct { + const char *basevar, *baseoption, *var, *option; + } varmod[] = { + { "INSTALL_", "-prefix", "DOCS", "-docdir" }, + { "INSTALL_", "-prefix", "HEADERS", "-headerdir" }, + { "INSTALL_", "-prefix", "LIBS", "-libdir" }, + { "INSTALL_", "-prefix", "LIBEXECS", "-libexecdir" }, + { "INSTALL_", "-prefix", "BINS", "-bindir" }, + { "INSTALL_", "-prefix", "PLUGINS", "-plugindir" }, + { "INSTALL_", "-prefix", "IMPORTS", "-importdir" }, + { "INSTALL_", "-prefix", "QML", "-qmldir" }, + { "INSTALL_", "-prefix", "ARCHDATA", "-archdatadir" }, + { "INSTALL_", "-prefix", "DATA", "-datadir" }, + { "INSTALL_", "-prefix", "TRANSLATIONS", "-translationdir" }, + { "INSTALL_", "-prefix", "EXAMPLES", "-examplesdir" }, + { "INSTALL_", "-prefix", "TESTS", "-testsdir" }, + { "INSTALL_", "-prefix", "SETTINGS", "-sysconfdir" }, + { "HOST_", "-hostprefix", "BINS", "-hostbindir" }, + { "HOST_", "-hostprefix", "LIBS", "-hostlibdir" }, + { "HOST_", "-hostprefix", "DATA", "-hostdatadir" }, + }; + + bool prefixReminder = false; + for (int i = 0; i < sizeof(varmod) / sizeof(varmod[0]); i++) { + QString path = QDir::cleanPath( + dictionary[QLatin1String("QT_") + varmod[i].basevar + varmod[i].var]); + if (path.isEmpty()) + continue; + QString base = dictionary[QLatin1String("QT_") + varmod[i].basevar + "PREFIX"]; + if (!path.startsWith(base)) { + if (i != 13) { + dictionary["PREFIX_COMPLAINTS"] += QLatin1String("\n NOTICE: ") + + varmod[i].option + " is not a subdirectory of " + varmod[i].baseoption + "."; + if (i < 13 ? qipempty : !haveHpx) + prefixReminder = true; + } + } else { + path.remove(0, base.size()); + if (path.startsWith('/')) + path.remove(0, 1); + } + dictionary[QLatin1String("QT_REL_") + varmod[i].basevar + varmod[i].var] + = path.isEmpty() ? "." : path; + } + if (prefixReminder) { + dictionary["PREFIX_COMPLAINTS"] + += "\n Maybe you forgot to specify -prefix/-hostprefix?"; + } + + if (!qipempty) { + // If QT_INSTALL_* have not been specified on the command line, + // default them here, unless prefix is empty (WinCE). + + if (dictionary["QT_REL_INSTALL_HEADERS"].isEmpty()) + dictionary["QT_REL_INSTALL_HEADERS"] = "include"; + + if (dictionary["QT_REL_INSTALL_LIBS"].isEmpty()) + dictionary["QT_REL_INSTALL_LIBS"] = "lib"; + + if (dictionary["QT_REL_INSTALL_BINS"].isEmpty()) + dictionary["QT_REL_INSTALL_BINS"] = "bin"; + + if (dictionary["QT_REL_INSTALL_ARCHDATA"].isEmpty()) + dictionary["QT_REL_INSTALL_ARCHDATA"] = "."; + if (dictionary["QT_REL_INSTALL_ARCHDATA"] != ".") + dictionary["QT_REL_INSTALL_ARCHDATA_PREFIX"] = dictionary["QT_REL_INSTALL_ARCHDATA"] + '/'; + + if (dictionary["QT_REL_INSTALL_LIBEXECS"].isEmpty()) { + if (targSpec.startsWith("win")) + dictionary["QT_REL_INSTALL_LIBEXECS"] = dictionary["QT_REL_INSTALL_ARCHDATA_PREFIX"] + "bin"; + else + dictionary["QT_REL_INSTALL_LIBEXECS"] = dictionary["QT_REL_INSTALL_ARCHDATA_PREFIX"] + "libexec"; + } + + if (dictionary["QT_REL_INSTALL_PLUGINS"].isEmpty()) + dictionary["QT_REL_INSTALL_PLUGINS"] = dictionary["QT_REL_INSTALL_ARCHDATA_PREFIX"] + "plugins"; + + if (dictionary["QT_REL_INSTALL_IMPORTS"].isEmpty()) + dictionary["QT_REL_INSTALL_IMPORTS"] = dictionary["QT_REL_INSTALL_ARCHDATA_PREFIX"] + "imports"; + + if (dictionary["QT_REL_INSTALL_QML"].isEmpty()) + dictionary["QT_REL_INSTALL_QML"] = dictionary["QT_REL_INSTALL_ARCHDATA_PREFIX"] + "qml"; + + if (dictionary["QT_REL_INSTALL_DATA"].isEmpty()) + dictionary["QT_REL_INSTALL_DATA"] = "."; + if (dictionary["QT_REL_INSTALL_DATA"] != ".") + dictionary["QT_REL_INSTALL_DATA_PREFIX"] = dictionary["QT_REL_INSTALL_DATA"] + '/'; + + if (dictionary["QT_REL_INSTALL_DOCS"].isEmpty()) + dictionary["QT_REL_INSTALL_DOCS"] = dictionary["QT_REL_INSTALL_DATA_PREFIX"] + "doc"; + + if (dictionary["QT_REL_INSTALL_TRANSLATIONS"].isEmpty()) + dictionary["QT_REL_INSTALL_TRANSLATIONS"] = dictionary["QT_REL_INSTALL_DATA_PREFIX"] + "translations"; + + if (dictionary["QT_REL_INSTALL_EXAMPLES"].isEmpty()) + dictionary["QT_REL_INSTALL_EXAMPLES"] = "examples"; + + if (dictionary["QT_REL_INSTALL_TESTS"].isEmpty()) + dictionary["QT_REL_INSTALL_TESTS"] = "tests"; + } + + if (dictionary["QT_REL_HOST_BINS"].isEmpty()) + dictionary["QT_REL_HOST_BINS"] = haveHpx ? "bin" : dictionary["QT_REL_INSTALL_BINS"]; + + if (dictionary["QT_REL_HOST_LIBS"].isEmpty()) + dictionary["QT_REL_HOST_LIBS"] = haveHpx ? "lib" : dictionary["QT_REL_INSTALL_LIBS"]; + + if (dictionary["QT_REL_HOST_DATA"].isEmpty()) + dictionary["QT_REL_HOST_DATA"] = haveHpx ? "." : dictionary["QT_REL_INSTALL_ARCHDATA"]; + + confStringOff = 0; + addConfStr(0, dictionary["QT_REL_INSTALL_DOCS"]); + addConfStr(0, dictionary["QT_REL_INSTALL_HEADERS"]); + addConfStr(0, dictionary["QT_REL_INSTALL_LIBS"]); + addConfStr(0, dictionary["QT_REL_INSTALL_LIBEXECS"]); + addConfStr(0, dictionary["QT_REL_INSTALL_BINS"]); + addConfStr(0, dictionary["QT_REL_INSTALL_PLUGINS"]); + addConfStr(0, dictionary["QT_REL_INSTALL_IMPORTS"]); + addConfStr(0, dictionary["QT_REL_INSTALL_QML"]); + addConfStr(0, dictionary["QT_REL_INSTALL_ARCHDATA"]); + addConfStr(0, dictionary["QT_REL_INSTALL_DATA"]); + addConfStr(0, dictionary["QT_REL_INSTALL_TRANSLATIONS"]); + addConfStr(0, dictionary["QT_REL_INSTALL_EXAMPLES"]); + addConfStr(0, dictionary["QT_REL_INSTALL_TESTS"]); + addConfStr(1, dictionary["CFG_SYSROOT"]); + addConfStr(1, dictionary["QT_REL_HOST_BINS"]); + addConfStr(1, dictionary["QT_REL_HOST_LIBS"]); + addConfStr(1, dictionary["QT_REL_HOST_DATA"]); + addConfStr(1, targSpec); + addConfStr(1, hostSpec); // Generate the new qconfig.cpp file { @@ -3971,60 +4053,40 @@ void Configure::generateQConfigCpp() << "/* Build date */" << endl << "static const char qt_configure_installation [11 + 12] = \"qt_instdate=" << QDate::currentDate().toString(Qt::ISODate) << "\";" << endl << endl - << "static const char qt_configure_prefix_path_strs[][12 + 512] = {" << endl + << "/* Installation Info */" << endl << "#ifndef QT_BUILD_QMAKE" << endl - << " \"qt_prfxpath=" << QDir::cleanPath(dictionary["QT_SYSROOT_PREFIX"]) << "\"," << endl - << " \"qt_docspath=" << QDir::cleanPath(dictionary["QT_SYSROOT_DOCS"]) << "\"," << endl - << " \"qt_hdrspath=" << QDir::cleanPath(dictionary["QT_SYSROOT_HEADERS"]) << "\"," << endl - << " \"qt_libspath=" << QDir::cleanPath(dictionary["QT_SYSROOT_LIBS"]) << "\"," << endl - << " \"qt_lbexpath=" << QDir::cleanPath(dictionary["QT_SYSROOT_LIBEXECS"]) << "\"," << endl - << " \"qt_binspath=" << QDir::cleanPath(dictionary["QT_SYSROOT_BINS"]) << "\"," << endl - << " \"qt_plugpath=" << QDir::cleanPath(dictionary["QT_SYSROOT_PLUGINS"]) << "\"," << endl - << " \"qt_impspath=" << QDir::cleanPath(dictionary["QT_SYSROOT_IMPORTS"]) << "\"," << endl - << " \"qt_qml2path=" << QDir::cleanPath(dictionary["QT_SYSROOT_QML"]) << "\"," << endl - << " \"qt_adatpath=" << QDir::cleanPath(dictionary["QT_SYSROOT_ARCHDATA"]) << "\"," << endl - << " \"qt_datapath=" << QDir::cleanPath(dictionary["QT_SYSROOT_DATA"]) << "\"," << endl - << " \"qt_trnspath=" << QDir::cleanPath(dictionary["QT_SYSROOT_TRANSLATIONS"]) << "\"," << endl - << " \"qt_xmplpath=" << QDir::cleanPath(dictionary["QT_SYSROOT_EXAMPLES"]) << "\"," << endl - << " \"qt_tstspath=" << QDir::cleanPath(dictionary["QT_SYSROOT_TESTS"]) << "\"," << endl + << "static const char qt_configure_prefix_path_str [512 + 12] = \"qt_prfxpath=" << dictionary["QT_INSTALL_PREFIX"] << "\";" << endl << "#else" << endl - << " \"qt_prfxpath=" << QDir::cleanPath(dictionary["QT_INSTALL_PREFIX"]) << "\"," << endl - << " \"qt_docspath=" << QDir::cleanPath(dictionary["QT_INSTALL_DOCS"]) << "\"," << endl - << " \"qt_hdrspath=" << QDir::cleanPath(dictionary["QT_INSTALL_HEADERS"]) << "\"," << endl - << " \"qt_libspath=" << QDir::cleanPath(dictionary["QT_INSTALL_LIBS"]) << "\"," << endl - << " \"qt_lbexpath=" << QDir::cleanPath(dictionary["QT_INSTALL_LIBEXECS"]) << "\"," << endl - << " \"qt_binspath=" << QDir::cleanPath(dictionary["QT_INSTALL_BINS"]) << "\"," << endl - << " \"qt_plugpath=" << QDir::cleanPath(dictionary["QT_INSTALL_PLUGINS"]) << "\"," << endl - << " \"qt_impspath=" << QDir::cleanPath(dictionary["QT_INSTALL_IMPORTS"]) << "\"," << endl - << " \"qt_qml2path=" << QDir::cleanPath(dictionary["QT_INSTALL_QML"]) << "\"," << endl - << " \"qt_adatpath=" << QDir::cleanPath(dictionary["QT_INSTALL_ARCHDATA"]) << "\"," << endl - << " \"qt_datapath=" << QDir::cleanPath(dictionary["QT_INSTALL_DATA"]) << "\"," << endl - << " \"qt_trnspath=" << QDir::cleanPath(dictionary["QT_INSTALL_TRANSLATIONS"]) << "\"," << endl - << " \"qt_xmplpath=" << QDir::cleanPath(dictionary["QT_INSTALL_EXAMPLES"]) << "\"," << endl - << " \"qt_tstspath=" << QDir::cleanPath(dictionary["QT_INSTALL_TESTS"]) << "\"," << endl - << " \"qt_ssrtpath=" << QDir::cleanPath(dictionary["CFG_SYSROOT"]) << "\"," << endl - << " \"qt_hpfxpath=" << QDir::cleanPath(dictionary["QT_HOST_PREFIX"]) << "\"," << endl - << " \"qt_hbinpath=" << QDir::cleanPath(dictionary["QT_HOST_BINS"]) << "\"," << endl - << " \"qt_hlibpath=" << QDir::cleanPath(dictionary["QT_HOST_LIBS"]) << "\"," << endl - << " \"qt_hdatpath=" << QDir::cleanPath(dictionary["QT_HOST_DATA"]) << "\"," << endl - << " \"qt_targspec=" << targSpec << "\"," << endl - << " \"qt_hostspec=" << hostSpec << "\"," << endl + << "static const char qt_configure_prefix_path_str [512 + 12] = \"qt_prfxpath=" << dictionary["QT_EXT_PREFIX"] << "\";" << endl + << "static const char qt_configure_host_prefix_path_str [512 + 12] = \"qt_hpfxpath=" << dictionary["QT_HOST_PREFIX"] << "\";" << endl << "#endif" << endl - << "};" << endl; - + << endl + << "static const short qt_configure_str_offsets[] = {\n" + << " " << confStrOffsets[0] << endl + << "#ifdef QT_BUILD_QMAKE\n" + << " " << confStrOffsets[1] << endl + << "#endif\n" + << "};\n" + << "static const char qt_configure_strs[] =\n" + << confStrings[0] << "#ifdef QT_BUILD_QMAKE\n" + << confStrings[1] << "#endif\n" + << ";\n" + << endl; if ((platform() != WINDOWS) && (platform() != WINDOWS_CE) && (platform() != WINDOWS_RT)) - tmpStream << "static const char qt_configure_settings_path_str [256 + 12] = \"qt_stngpath=" << QDir::cleanPath(dictionary["QT_INSTALL_SETTINGS"]) << "\";" << endl; + tmpStream << "#define QT_CONFIGURE_SETTINGS_PATH \"" << QDir::cleanPath(dictionary["QT_INSTALL_SETTINGS"]) << "\"" << endl; tmpStream << endl << "#ifdef QT_BUILD_QMAKE\n" - << "static const char qt_sysrootify_prefix[] = \"qt_ssrtfpfx=" << sysrootifyPrefix << "\";\n" + << "# define QT_CONFIGURE_SYSROOTIFY_PREFIX " << (sysrootifyPrefix ? "true" : "false") << endl << "#endif\n\n" << "/* strlen( \"qt_lcnsxxxx\") == 12 */" << endl << "#define QT_CONFIGURE_LICENSEE qt_configure_licensee_str + 12" << endl - << "#define QT_CONFIGURE_LICENSED_PRODUCTS qt_configure_licensed_products_str + 12" << endl; - - if ((platform() != WINDOWS) && (platform() != WINDOWS_CE) && (platform() != WINDOWS_RT)) - tmpStream << "#define QT_CONFIGURE_SETTINGS_PATH qt_configure_settings_path_str + 12" << endl; + << "#define QT_CONFIGURE_LICENSED_PRODUCTS qt_configure_licensed_products_str + 12" << endl + << endl + << "#define QT_CONFIGURE_PREFIX_PATH qt_configure_prefix_path_str + 12\n" + << "#ifdef QT_BUILD_QMAKE\n" + << "# define QT_CONFIGURE_HOST_PREFIX_PATH qt_configure_host_prefix_path_str + 12\n" + << "#endif\n"; if (!tmpStream.flush()) dictionary[ "DONE" ] = "error"; diff --git a/tools/configure/configureapp.h b/tools/configure/configureapp.h index d2f26cfc15..15c568842a 100644 --- a/tools/configure/configureapp.h +++ b/tools/configure/configureapp.h @@ -143,8 +143,11 @@ private: int descIndent; int outputWidth; - void substPrefix(QString *path); + QString confStrOffsets[2]; + QString confStrings[2]; + int confStringOff; + void addConfStr(int group, const QString &val); QString formatPath(const QString &path); QString formatPaths(const QStringList &paths); |