Skip to content

Commit

Permalink
support spaces in build and install dirs
Browse files Browse the repository at this point in the history
spaces in the source dir are not supported for now, as that requires
some more profound refactoring of the bootstrap makefiles.

Change-Id: Ie0c07a1558b8326f642f2ea144bc1cd85ee761af
Reviewed-by: Joerg Bornemann <[email protected]>
  • Loading branch information
ossilator committed Feb 17, 2015
1 parent 7e71eec commit b6f0060
Show file tree
Hide file tree
Showing 9 changed files with 39 additions and 31 deletions.
1 change: 1 addition & 0 deletions bin/syncqt.pl
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,7 @@ sub fixPaths {

my $out = File::Spec->abs2rel(cleanupPath($file), cleanupPath($dir));
$out =~ s,\\,/,g;
$out = "\"$out\"" if ($out =~ / /);
return $out;
}

Expand Down
6 changes: 3 additions & 3 deletions config.tests/unix/arch.test
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ while [ "$#" -gt 0 ]; do
PARAM=$1
case $PARAM in
-L*|-l*)
LFLAGS="$LFLAGS $PARAM"
LFLAGS="$LFLAGS \"$PARAM\""
;;
-I*)
INC=`echo $PARAM | sed -e 's/^-I//'`
INCLUDEPATH="$INCLUDEPATH $INC"
INCLUDEPATH="$INCLUDEPATH \"$INC\""
;;
-D*)
CXXFLAGS="$CXXFLAGS $PARAM"
CXXFLAGS="$CXXFLAGS \"$PARAM\""
;;
*) ;;
esac
Expand Down
10 changes: 5 additions & 5 deletions config.tests/unix/compile.test
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,18 @@ while [ "$#" -gt 0 ]; do
shift
;;
-F*|-m*|-x*)
LFLAGS="$LFLAGS $PARAM"
CXXFLAGS="$CXXFLAGS $PARAM"
LFLAGS="$LFLAGS \"$PARAM\""
CXXFLAGS="$CXXFLAGS \"$PARAM\""
;;
-L*|-l*|-pthread)
LFLAGS="$LFLAGS $PARAM"
LFLAGS="$LFLAGS \"$PARAM\""
;;
-I*)
INC=`echo $PARAM | sed -e 's/^-I//'`
INCLUDEPATH="$INCLUDEPATH $INC"
INCLUDEPATH="$INCLUDEPATH \"$INC\""
;;
-f*|-D*)
CXXFLAGS="$CXXFLAGS $PARAM"
CXXFLAGS="$CXXFLAGS \"$PARAM\""
;;
-Qoption)
# Two-argument form for the Sun Compiler
Expand Down
2 changes: 1 addition & 1 deletion configure
Original file line number Diff line number Diff line change
Expand Up @@ -4047,7 +4047,7 @@ fi
#-------------------------------------------------------------------------------
# Verify makespec
#-------------------------------------------------------------------------------
QMAKE_OUTPUT=`$outpath/bin/qmake -E -nocache -spec "$XQMAKESPEC" "QT=" $DEV_NULL 2>&1`
QMAKE_OUTPUT=`"$outpath/bin/qmake" -E -nocache -spec "$XQMAKESPEC" "QT=" $DEV_NULL 2>&1`
if [ $? != "0" ]; then
echo "Failed to process makespec for platform '$XPLATFORM'"
if [ "$OPT_VERBOSE" = "yes" ]; then
Expand Down
2 changes: 1 addition & 1 deletion configure.bat
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ if not exist mkspecs (
md mkspecs
if errorlevel 1 goto exit
)
perl %QTSRC%bin\syncqt.pl -minimal -module QtCore -outdir %QTDIR% %QTSRC%
perl %QTSRC%bin\syncqt.pl -minimal -module QtCore -outdir "%QTDIR%" %QTSRC%
if errorlevel 1 goto exit

if not exist tools\configure (
Expand Down
16 changes: 11 additions & 5 deletions mkspecs/features/qt_config.prf
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,21 @@ QMAKE_QT_CONFIG = $$[QT_HOST_DATA/get]/mkspecs/qconfig.pri
debug(1, "Cannot load qconfig.pri!")
} else {
debug(1, "Loaded .qconfig.pri from ($$QMAKE_QT_CONFIG)")
QMAKE_MODULE_PATH = $$split($$list($$(QMAKEMODULES)), $$DIRLIST_SEPARATOR)
dirs = $$(QMAKEMODULES)
QMAKE_MODULE_PATH = $$split(dirs, $$DIRLIST_SEPARATOR)
QMAKE_MODULE_PATH += $$QMAKEMODULES
QMAKE_MODULE_PATH += $$split($$list($$[QMAKEMODULES]), $$DIRLIST_SEPARATOR)
QMAKE_MODULE_PATH += $$replace($$list($$split($$list($$[QMAKE_MKSPECS]), $$DIRLIST_SEPARATOR)), \
\$, /modules)
dirs = $$[QMAKEMODULES]
QMAKE_MODULE_PATH += $$split(dirs, $$DIRLIST_SEPARATOR)
dirs = $$[QMAKE_MKSPECS]
dirs = $$split(dirs, $$DIRLIST_SEPARATOR)
QMAKE_MODULE_PATH += $$replace(dirs, \$, /modules)
unset(dirs)
QMAKE_MODULE_PATH = $$unique(QMAKE_MODULE_PATH)
QMAKE_MODULE_PATH = $$reverse(QMAKE_MODULE_PATH)
for(dir, QMAKE_MODULE_PATH) {
debug(1, "Loading modules from $${dir}")
for(mod, $$list($$files($$dir/qt_*.pri))) {
mods = $$files($$dir/qt_*.pri)
for (mod, mods) {
# For installed Qt these paths will be common for all modules.
# For uninstalled prefix builds these will vary per module, via the
# forwarding module pri files. Keep qt_module_pris.prf in sync with this!
Expand All @@ -28,6 +33,7 @@ QMAKE_QT_CONFIG = $$[QT_HOST_DATA/get]/mkspecs/qconfig.pri
QT_MODULE_QML_BASE = $$[QT_INSTALL_QML]
include($$mod)
}
unset(mods)
}
QT_MODULES = $$unique(QT_MODULES) # In case modules appear in multiple places
unset(QT_MODULE_INCLUDE_BASE)
Expand Down
2 changes: 1 addition & 1 deletion mkspecs/features/qt_module_headers.prf
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ load(qt_build_paths)
QMAKE_SYNCQT += -module $$MODULE_INCNAME -version $$VERSION
}
QMAKE_SYNCQT += \
-outdir $$MODULE_BASE_OUTDIR $$MODULE_SYNCQT_DIR
-outdir $$system_quote($$MODULE_BASE_OUTDIR) $$MODULE_SYNCQT_DIR
!silent: message($$QMAKE_SYNCQT)
system($$QMAKE_SYNCQT)|error("Failed to run: $$QMAKE_SYNCQT")
}
Expand Down
29 changes: 15 additions & 14 deletions mkspecs/features/qt_module_pris.prf
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,10 @@ MODULE_FWD_PRI = $$mod_work_pfx/qt_lib_$${MODULE_ID}.pri
module_libs = "\$\$QT_MODULE_LIB_BASE"
unix:!static {
host_build: \
module_rpath = "QT.$${MODULE_ID}.rpath = $$[QT_HOST_LIBS]"
module_rpath = $$[QT_HOST_LIBS]
else: \
module_rpath = "QT.$${MODULE_ID}.rpath = $$[QT_INSTALL_LIBS/dev]"
module_rpath = $$[QT_INSTALL_LIBS/dev]
module_rpath = "QT.$${MODULE_ID}.rpath = $$val_escape(module_rpath)"
} else {
module_rpath =
}
Expand Down Expand Up @@ -93,7 +94,7 @@ MODULE_FWD_PRI = $$mod_work_pfx/qt_lib_$${MODULE_ID}.pri
internal_module: \
MODULE_INCLUDES += $$MODULE_PRIVATE_INCLUDES
split_incpath: \
MODULE_FWD_PRI_CONT_SUFFIX += "QT.$${MODULE_ID}.includes += $$MODULE_SHADOW_INCLUDES"
MODULE_FWD_PRI_CONT_SUFFIX += "QT.$${MODULE_ID}.includes += $$val_escape(MODULE_SHADOW_INCLUDES)"
MODULE_PRI_CONT = \
"QT.$${MODULE_ID}.VERSION = $${VERSION}" \
"QT.$${MODULE_ID}.MAJOR_VERSION = $$section(VERSION, ., 0, 0)" \
Expand All @@ -117,7 +118,7 @@ MODULE_FWD_PRI = $$mod_work_pfx/qt_lib_$${MODULE_ID}.pri
$$module_rundep \
"QT.$${MODULE_ID}.module_config =$$join(module_build_type, " ", " ")" \
$$module_config \
"QT.$${MODULE_ID}.DEFINES = $$MODULE_DEFINES" \ # assume sufficient quoting
"QT.$${MODULE_ID}.DEFINES = $$val_escape(MODULE_DEFINES)" \
"" \
"QT_MODULES += $$MODULE"
write_file($$MODULE_PRI, MODULE_PRI_CONT)|error("Aborting.")
Expand Down Expand Up @@ -147,18 +148,18 @@ MODULE_FWD_PRI = $$mod_work_pfx/qt_lib_$${MODULE_ID}.pri

# Create a forwarding module .pri file
MODULE_FWD_PRI_CONT = \
"QT_MODULE_BIN_BASE = $$MODULE_BASE_OUTDIR/bin" \
"QT_MODULE_INCLUDE_BASE = $$MODULE_BASE_INCDIR/include" \
"QT_MODULE_IMPORT_BASE = $$MODULE_BASE_OUTDIR/imports" \
"QT_MODULE_QML_BASE = $$MODULE_BASE_OUTDIR/qml" \
"QT_MODULE_LIB_BASE = $$MODULE_BASE_OUTDIR/lib" \
"QT_MODULE_HOST_LIB_BASE = $$MODULE_BASE_OUTDIR/lib" \
"QT_MODULE_LIBEXEC_BASE = $$MODULE_BASE_OUTDIR/libexec" \
"QT_MODULE_PLUGIN_BASE = $$MODULE_BASE_OUTDIR/plugins" \
"include($$MODULE_PRI)" \
"QT_MODULE_BIN_BASE = $$val_escape(MODULE_BASE_OUTDIR)/bin" \
"QT_MODULE_INCLUDE_BASE = $$val_escape(MODULE_BASE_INCDIR)/include" \
"QT_MODULE_IMPORT_BASE = $$val_escape(MODULE_BASE_OUTDIR)/imports" \
"QT_MODULE_QML_BASE = $$val_escape(MODULE_BASE_OUTDIR)/qml" \
"QT_MODULE_LIB_BASE = $$val_escape(MODULE_BASE_OUTDIR)/lib" \
"QT_MODULE_HOST_LIB_BASE = $$val_escape(MODULE_BASE_OUTDIR)/lib" \
"QT_MODULE_LIBEXEC_BASE = $$val_escape(MODULE_BASE_OUTDIR)/libexec" \
"QT_MODULE_PLUGIN_BASE = $$val_escape(MODULE_BASE_OUTDIR)/plugins" \
"include($$val_escape(MODULE_PRI))" \
"QT.$${MODULE_ID}.priority = 1"
!internal_module: MODULE_FWD_PRI_CONT += \
"include($$MODULE_PRIVATE_PRI)" \
"include($$val_escape(MODULE_PRIVATE_PRI))" \
"QT.$${MODULE}_private.priority = 1"
MODULE_FWD_PRI_CONT += $$MODULE_FWD_PRI_CONT_SUFFIX
write_file($$MODULE_FWD_PRI, MODULE_FWD_PRI_CONT)|error("Aborting.")
Expand Down
2 changes: 1 addition & 1 deletion mkspecs/features/testlib_defines.prf
Original file line number Diff line number Diff line change
@@ -1 +1 @@
DEFINES += QT_TESTCASE_BUILDDIR=\\\"$$OUT_PWD\\\"
DEFINES += QT_TESTCASE_BUILDDIR=$$shell_quote(\"$$OUT_PWD\")

0 comments on commit b6f0060

Please sign in to comment.