2 ####################################################################################################
4 # Mother script for Qt Modularization
6 # Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
7 # Contact: Nokia Corporation (qt-info@nokia.com)
9 ####################################################################################################
19 # Makes sure the arguments are directories, and creates them if not.
20 # Will die if there is an error.
27 die ("$_ exists, but is not a directory");
30 File::Path::mkpath($_) or die("Could not create $_");
34 # `system', but also print the command
43 my $relpath = dirname(abs_path($0));
45 # the current directory is the "build tree" or "object tree"
46 my $outpath = getcwd();
48 if (! -e "$relpath/qtbase/configure") {
49 die("$relpath/qtbase/configure not found. Did you forget to run \"init-repository\"?");
52 ensureDir("$outpath/qtbase");
53 chdir("$outpath/qtbase");
54 if (-e ".qmake.cache") {
55 # Remove this so we can detect if configure finished properly
56 unlink ".qmake.cache";
58 my $ret = system_v("$relpath/qtbase/configure @ARGV");
59 exit $ret unless ($ret == 0);
60 if (! -e ".qmake.cache") {
61 # Even though there was no error code, this file wasn't created
62 # so configure didn't finish properly. This is probably because
63 # the user passed -help
69 open QMAKE_CACHE, ">.qmake.cache" || die "Could not open .qmake.cache for writing!\n";
70 print QMAKE_CACHE "include(\$\$PWD/qtbase/.qmake.cache)\n";
73 $ret = system_v("$outpath/qtbase/bin/qmake $relpath/qt.pro");