summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@digia.com>2013-05-08 16:29:11 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-06-12 16:27:24 +0200
commit0d463c05fc4f2e79e5a4e5a5382a1e6ed5d2615e (patch)
tree21f4fdd10b50396a5531ad0faf158c4a7240a95d
parentd795e9ff5fb676115a5c4eb9604c35cedd3fb186 (diff)
don't copy mkspecs to build directory
instead, teach qmake to use the mkspecs dir from the source dir as well. Change-Id: I9edac11f8997fcb0594d0a67419d4733dd4ed86b Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
-rwxr-xr-xconfigure42
-rw-r--r--qmake/library/qmakeevaluator.cpp2
-rw-r--r--qtbase.pro2
-rw-r--r--tools/configure/configureapp.cpp9
4 files changed, 12 insertions, 43 deletions
diff --git a/configure b/configure
index a3542bbd2e..b551eedb2a 100755
--- a/configure
+++ b/configure
@@ -2398,43 +2398,7 @@ if [ "$OPT_SHADOW" = "yes" ]; then
[ -d "$outpath/bin" ] || mkdir -p "$outpath/bin"
- # save a pre-existing mkspecs/modules dir
- test -d "$outpath/mkspecs/modules" && \
- mv "$outpath/mkspecs/modules" "$outpath/mkspecs-modules"
- # ditto for mkspecs/modules-inst
- test -d "$outpath/mkspecs/modules-inst" && \
- mv "$outpath/mkspecs/modules-inst" "$outpath/mkspecs-modules-inst"
-
- # symlink the mkspecs directory
mkdir -p "$outpath/mkspecs"
- rm -rf "$outpath"/mkspecs/*
- ln -s "$relpath"/mkspecs/* "$outpath/mkspecs"
-
- ShadowMkspecs()
- {
- rm -rf "$outpath/mkspecs/$1"
- find "$relpath/mkspecs/$1" -type d | sed "s,^$relpath,$outpath," | xargs mkdir -p
- find "$relpath/mkspecs/$1" -type f | sed "s,^$relpath/,," | while read f; do ln -s "$relpath/$f" "$outpath/$f"; done
- }
-
- # Special case for mkspecs/features directory.
- # To be able to place .prf files into a shadow build directory,
- # we're creating links for files only. The directory structure is reproduced.
- ShadowMkspecs features
-
- # The modules dir is special, too.
- if test -d "$outpath/mkspecs-modules"; then
- rm -rf "$outpath/mkspecs/modules"
- mv "$outpath/mkspecs-modules" "$outpath/mkspecs/modules"
- else
- ShadowMkspecs modules
- fi
-
- # The modules-inst dir is not quite as special, but still.
- if test -d "$outpath/mkspecs-modules-inst"; then
- rm -rf "$outpath/mkspecs/modules-inst"
- mv "$outpath/mkspecs-modules-inst" "$outpath/mkspecs/modules-inst"
- fi
# Prepare doc directory
mkdir -p "$outpath/doc"
@@ -4090,6 +4054,12 @@ cat > "$QTCONFFILE" <<EOF
[EffectivePaths]
Prefix=..
EOF
+if [ x"$relpath" != x"$outpath" ]; then
+ cat >> "$QTCONFFILE" <<EOF
+[EffectiveSourcePaths]
+Prefix=$relpath
+EOF
+fi
#-------------------------------------------------------------------------------
# write out device config before we run the test.
diff --git a/qmake/library/qmakeevaluator.cpp b/qmake/library/qmakeevaluator.cpp
index 388310eb64..1d90be9ca1 100644
--- a/qmake/library/qmakeevaluator.cpp
+++ b/qmake/library/qmakeevaluator.cpp
@@ -1428,6 +1428,7 @@ void QMakeEvaluator::updateMkspecPaths()
ret << m_sourceRoot + concat;
ret << m_option->propertyValue(ProKey("QT_HOST_DATA/get")) + concat;
+ ret << m_option->propertyValue(ProKey("QT_HOST_DATA/src")) + concat;
ret.removeDuplicates();
m_mkspecPaths = ret;
@@ -1481,6 +1482,7 @@ void QMakeEvaluator::updateFeaturePaths()
}
feature_bases << (m_option->propertyValue(ProKey("QT_HOST_DATA/get")) + mkspecs_concat);
+ feature_bases << (m_option->propertyValue(ProKey("QT_HOST_DATA/src")) + mkspecs_concat);
foreach (const QString &fb, feature_bases) {
foreach (const ProString &sfx, values(ProKey("QMAKE_PLATFORM")))
diff --git a/qtbase.pro b/qtbase.pro
index 02dc11eac2..857cc43446 100644
--- a/qtbase.pro
+++ b/qtbase.pro
@@ -105,7 +105,7 @@ prefix_build|!equals(PWD, $$OUT_PWD) {
mkspecs.path = $$[QT_HOST_DATA]/mkspecs
mkspecs.files = \
$$OUT_PWD/mkspecs/qconfig.pri $$OUT_PWD/mkspecs/qmodule.pri $$OUT_PWD/mkspecs/qdevice.pri \
- $$files($$PWD/mkspecs/*) # $$OUT_PWD contains only symlinks under Unix
+ $$files($$PWD/mkspecs/*)
mkspecs.files -= $$PWD/mkspecs/modules
INSTALLS += mkspecs
diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp
index 44498b6ccb..6457f742a9 100644
--- a/tools/configure/configureapp.cpp
+++ b/tools/configure/configureapp.cpp
@@ -160,13 +160,7 @@ Configure::Configure(int& argc, char** argv)
cout << "Preparing build tree..." << endl;
QDir(buildPath).mkpath("bin");
- //copy the mkspecs
buildDir.mkpath("mkspecs");
- if (!Environment::cpdir(sourcePath + "/mkspecs", buildPath + "/mkspecs")){
- cout << "Couldn't copy mkspecs!" << sourcePath << " " << buildPath << endl;
- dictionary["DONE"] = "error";
- return;
- }
buildDir.mkpath("doc");
if (!Environment::cpdir(sourcePath + "/doc/global", buildPath + "/doc/global")) {
@@ -3897,6 +3891,9 @@ void Configure::buildQmake()
QTextStream confStream(&confFile);
confStream << "[EffectivePaths]" << endl
<< "Prefix=.." << endl;
+ if (sourcePath != buildPath)
+ confStream << "[EffectiveSourcePaths]" << endl
+ << "Prefix=" << sourcePath << endl;
confStream.flush();
confFile.close();