introduce "secret" configure -top-level option

shifts the makefile generation one directory level up.
this allows the top-level configure to leave the makefile creation
entirely to the qtbase configure.
this is not very clean modularization-wise, but consistent with -skip.

Change-Id: I7ee2d2f29f2e6619d61fe9b55faa0bacdf3c44c1
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
This commit is contained in:
Oswald Buddenhagen 2013-06-18 15:11:11 +02:00 committed by The Qt Project
parent fb6d46131f
commit e9d539623a
2 changed files with 31 additions and 4 deletions

20
configure vendored
View File

@ -61,6 +61,13 @@ if [ -f "$LICENSE_FILE" ]; then
diff "${LICENSE_FILE}.tmp" "${LICENSE_FILE}" >/dev/null 2>&1 || LICENSE_FILE="${LICENSE_FILE}.tmp"
fi
# do this early so we don't store it in config.status
CFG_TOPLEVEL=
if [ x"$1" = x"-top-level" ]; then
CFG_TOPLEVEL=yes
shift
fi
# later cache the command line in config.status
OPT_CMDLINE=`echo $@ | sed "s,-v ,,g; s,-v$,,g"`
@ -6910,14 +6917,23 @@ rm -f "$QMAKE_VARS_FILE" 2>/dev/null
#-------------------------------------------------------------------------------
if [ "$CFG_PROCESS" != "no" ]; then
( # fork to make the cd stay local
relpathMangled=$relpath
if [ -n "$CFG_TOPLEVEL" ]; then
relpathMangled=`dirname "$relpath"`
cd ..
fi
if [ "$CFG_PROCESS" = "full" ]; then
echo "Creating makefiles. Please wait..."
"$outpath/bin/qmake" -r "$relpath"
"$outpath/bin/qmake" -r "$relpathMangled"
echo "Done"
else
"$outpath/bin/qmake" "$relpath"
"$outpath/bin/qmake" "$relpathMangled"
fi
)
fi
#-------------------------------------------------------------------------------

View File

@ -389,6 +389,11 @@ QString Configure::firstLicensePath()
void Configure::parseCmdLine()
{
if (configCmdLine.size() && configCmdLine.at(0) == "-top-level") {
dictionary[ "TOPLEVEL" ] = "yes";
configCmdLine.removeAt(0);
}
int argCount = configCmdLine.size();
int i = 0;
const QStringList imageFormats = QStringList() << "gif" << "png" << "jpeg";
@ -3958,6 +3963,12 @@ void Configure::generateMakefiles()
QString pwd = QDir::currentPath();
{
QString sourcePathMangled = sourcePath;
QString buildPathMangled = buildPath;
if (dictionary.contains("TOPLEVEL")) {
sourcePathMangled = QFileInfo(sourcePath).path();
buildPathMangled = QFileInfo(buildPath).path();
}
bool generate = true;
bool doDsp = (dictionary["VCPROJFILES"] == "yes"
&& dictionary["PROCESS"] == "full");
@ -3977,9 +3988,9 @@ void Configure::generateMakefiles()
}
if (dictionary[ "PROCESS" ] == "full")
args << "-r";
args << sourcePath;
args << sourcePathMangled;
QDir::setCurrent(buildPath);
QDir::setCurrent(buildPathMangled);
if (int exitCode = Environment::execute(args, QStringList(), QStringList())) {
cout << "Qmake failed, return code " << exitCode << endl << endl;
dictionary[ "DONE" ] = "error";