From a6eb28d3f68bec2d4b049da3d0b62808c6525895 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 9 Aug 2013 13:34:04 +0200 Subject: add configure -extprefix option this adds the possibility to put the actual qt installation outside the sysroot it is configured for. this makes it possible to install an x-built qt without "polluting" the sysroot, which makes it possible to have read-only sysroots, and multiple qt builds for one sysroot. -prefix is the location within the sysroot as seen by the target itself, and gets "burned" into QLibraryInfo in QtCore. -extprefix is the location in the host file system and gets "burned" into QLibraryInfo in qmake. if it is not specified, it defaults to the sysrootified prefix, which is the previous behavior. Task-number: QTBUG-26680 Change-Id: Ia43833c4e27733159afeb8c8b9b2d981378d0cd1 Reviewed-by: Thiago Macieira --- configure | 80 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 78 insertions(+), 2 deletions(-) (limited to 'configure') diff --git a/configure b/configure index ba6248eba8..f730ff4e46 100755 --- a/configure +++ b/configure @@ -384,6 +384,16 @@ 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 #------------------------------------------------------------------------------- @@ -1014,6 +1024,7 @@ QT_HOST_PREFIX= QT_HOST_BINS= QT_HOST_LIBS= QT_HOST_DATA= +QT_EXT_PREFIX= #flags for SQL drivers QT_CFLAGS_PSQL= @@ -1139,6 +1150,7 @@ while [ "$#" -gt 0 ]; do -hostdatadir| \ -hostbindir| \ -hostlibdir| \ + -extprefix| \ -sysroot| \ -depths| \ -make| \ @@ -1347,6 +1359,9 @@ while [ "$#" -gt 0 ]; do hostlibdir) QT_HOST_LIBS="$VAL" ;; + extprefix) + QT_EXT_PREFIX="$VAL" + ;; pkg-config) if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then CFG_PKGCONFIG="$VAL" @@ -3174,6 +3189,39 @@ if [ -z "$QT_INSTALL_TESTS" ]; then #default fi QT_INSTALL_TESTS=`"$relpath/config.tests/unix/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"` +fi + #------- host paths -------- if [ -z "$QT_HOST_PREFIX" ]; then @@ -3341,10 +3389,13 @@ Installation options: -prefix ...... This will install everything relative to (default $QT_INSTALL_PREFIX) + -extprefix ... When -sysroot is used, install everything to , + rather than into SYSROOT/PREFIX. + -hostprefix [dir] .. Tools and libraries needed when developing applications are installed in [dir]. If [dir] is not given, the current build directory will be used. - (default PREFIX) + (default EXTPREFIX) You may use these to separate different parts of the install: @@ -3869,6 +3920,12 @@ esac 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" <> "$outpath/src/corelib/global/qconfig.cpp.new" <