From 5b27d02c35d7b3f3feea9c5c97119b677578621d Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 4 Dec 2014 16:03:13 +0100 Subject: 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]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 --- configure | 369 +++++++++++++++++++++++++++++++++----------------------------- 1 file changed, 195 insertions(+), 174 deletions(-) (limited to 'configure') diff --git a/configure b/configure index 1ff8b4cd26..c4c52ac452 100755 --- a/configure +++ b/configure @@ -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 ......... User executables will be installed to (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 < "$outpath/src/corelib/global/qconfig.cpp.new" <> "$outpath/src/corelib/global/qconfig.cpp.new" <