From c8dead71865de3e09414c413faa38b53df09223b Mon Sep 17 00:00:00 2001 From: axis Date: Fri, 13 May 2011 16:07:56 +0200 Subject: Fixed an argument parsing bug in syncqt. We need to move the detection up above the general -no-* match, otherwise it never hits. Change-Id: I04ab5a1ed2c4a01219e7b9e10948b3fc4989f4b8 Task: QTBUG-19585 Reviewed-on: http://codereview.qt.nokia.com/228 Reviewed-by: Qt Sanity Bot Reviewed-by: Marius Storm-Olsen --- bin/syncqt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'bin') diff --git a/bin/syncqt b/bin/syncqt index 69d50ec4ca..7cf8b1b45a 100755 --- a/bin/syncqt +++ b/bin/syncqt @@ -590,6 +590,12 @@ while ( @ARGV ) { $arg eq "-relative" || $arg eq "-check-includes") { $var = substr($arg, 1); $val = "yes"; + } elsif($arg eq "-no-module-fwd") { + $var = "no_module_fwd"; + $val = "yes"; + } elsif($arg eq "-no-module-version-header") { + $var = "no_module_version_header"; + $val = "yes"; } elsif($arg =~ /^-no-(.*)$/) { $var = $1; $val = "no"; @@ -619,12 +625,6 @@ while ( @ARGV ) { # skip, it's been dealt with at the top of the file shift @ARGV; next; - } elsif($arg eq "-no-module-fwd") { - $var = "no_module_fwd"; - $val = "yes"; - } elsif($arg eq "-no-module-version-header") { - $var = "no_module_version_header"; - $val = "yes"; } elsif($arg =~/^-/) { print "Unknown option: $arg\n\n" if(!$var); showUsage(); -- cgit v1.2.3 From d3e048da7ef0f2f71a24e999feabbe1a56e3d936 Mon Sep 17 00:00:00 2001 From: axis Date: Fri, 13 May 2011 16:22:09 +0200 Subject: Make sure that we error out if we cannot write forwarding profile. Change-Id: Ic0b62532dd8a52cf6ab7a7c10c5ffbe3c9039ec1 Task: QTBUG-19585 Reviewed-on: http://codereview.qt.nokia.com/229 Reviewed-by: Qt Sanity Bot Reviewed-by: Marius Storm-Olsen --- bin/syncqt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bin') diff --git a/bin/syncqt b/bin/syncqt index 7cf8b1b45a..dbdac4d157 100755 --- a/bin/syncqt +++ b/bin/syncqt @@ -1071,7 +1071,7 @@ foreach my $lib (@modules_to_sync) { if (-e $modulepri) { my $modulepriname = basename($modulepri); my $moduleprifwd = "$qtbasedir/mkspecs/modules/$modulepriname"; - open MODULE_PRI_FILE, ">$moduleprifwd"; + open MODULE_PRI_FILE, ">$moduleprifwd" or die("Could not open $moduleprifwd for writing"); print MODULE_PRI_FILE "QT_MODULE_BASE = $basedir\n"; print MODULE_PRI_FILE "QT_MODULE_BIN_BASE = $qtbasedir/bin\n"; print MODULE_PRI_FILE "QT_MODULE_INCLUDE_BASE = $out_basedir/include\n"; -- cgit v1.2.3 From 0e6be2aa5dcddbab4e13e55e7f84a1099972f194 Mon Sep 17 00:00:00 2001 From: axis Date: Wed, 18 May 2011 15:23:51 +0200 Subject: Implemented module-local caching of module profiles. We use syncqt to generate .qmake.cache also for submodules, which contains the location of forwarding module profiles for that module. This enables us to build without having to put module profiles into mkspecs/modules until install time. Also added support for -developer-build to syncqt. What it does is to point build directories for binaries and libraries to a common location in QtBase. This is more convenient when doing development, since you don't need to set your path to every module's bin/ directory, but it cannot be used with release builds, since they need to build independently of QtBase, in their own directory. Change-Id: I959c62c11c644f2147a98da894a72452d9c44327 Task: QTBUG-19585 Task: QTBUG-19583 Reviewed-on: http://codereview.qt.nokia.com/232 Reviewed-by: Qt Sanity Bot Reviewed-by: Marius Storm-Olsen --- bin/syncqt | 62 +++++++++++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 47 insertions(+), 15 deletions(-) (limited to 'bin') diff --git a/bin/syncqt b/bin/syncqt index dbdac4d157..a955456fec 100755 --- a/bin/syncqt +++ b/bin/syncqt @@ -46,7 +46,9 @@ my $check_includes = 0; my $copy_headers = 0; my $create_uic_class_map = 0; my $create_private_headers = 1; -my $no_module_fwd = 0; +my $module_fwd = ""; +my $cache_module_fwd = 0; +my $developer_build = 0; my $no_module_version_header = 0; my @modules_to_sync ; $force_relative = 1 if ( -d "/System/Library/Frameworks" ); @@ -72,12 +74,18 @@ sub showUsage print " -windows Force platform to Windows (default: " . ($force_win ? "yes" : "no") . ")\n"; print " -showonly Show action but not perform (default: " . ($showonly ? "yes" : "no") . ")\n"; print " -outdir Specify output directory for sync (default: $out_basedir)\n"; - print " -qtdir Set the path to QtBase (detected: " . (defined $qtbasedir ? $qtbasedir : "-none-") . ")\n"; + print " -qtdir Set the path to QtBase (detected: " . (defined $qtbasedir ? $qtbasedir : "-none-") . ")\n"; print " -quiet Only report problems, not activity (default: " . ($quiet ? "yes" : "no") . ")\n"; print " -separate-module ::\n"; - print " Create headers for with original headers in relative to \n"; + print " Create headers for with original headers in\n"; + print " relative to \n"; print " -private Force copy private headers (default: " . ($create_private_headers ? "yes" : "no") . ")\n"; - print " -no-module-fwd Don't create fwd includes for module pri files\n"; + print " -module-fwd Create fwd includes for module pri files in the given\n"; + print " path (default: none)\n"; + print " -cache-module-fwd Create a .qmake.cache file to cache the location of the\n"; + print " fwd includes\n"; + print " -developer-build Point libraries and binaries to a common directory for\n"; + print " easy development\n"; print " -no-module-version-header\n"; print " Don't create module version header file\n"; print " -help This help\n"; @@ -590,8 +598,14 @@ while ( @ARGV ) { $arg eq "-relative" || $arg eq "-check-includes") { $var = substr($arg, 1); $val = "yes"; - } elsif($arg eq "-no-module-fwd") { - $var = "no_module_fwd"; + } elsif($arg eq "-module-fwd") { + $var = "module_fwd"; + $val = shift @ARGV; + } elsif($arg eq "-cache-module-fwd") { + $var = "cache_module_fwd"; + $val = "yes"; + } elsif($arg eq "-developer-build") { + $var = "developer_build"; $val = "yes"; } elsif($arg eq "-no-module-version-header") { $var = "no_module_version_header"; @@ -700,8 +714,12 @@ while ( @ARGV ) { } else { die "The -qtdir option requires an argument"; } - } elsif ($var eq "no_module_fwd") { - $no_module_fwd = 1; + } elsif ($var eq "module_fwd") { + $module_fwd = $val; + } elsif ($var eq "cache_module_fwd") { + $cache_module_fwd = 1; + } elsif ($var eq "developer_build") { + $developer_build = 1; } elsif ($var eq "no_module_version_header") { $no_module_version_header = 1; } elsif ($var eq "output") { @@ -1066,21 +1084,35 @@ foreach my $lib (@modules_to_sync) { } # create forwarding module pri in qtbase/mkspecs/modules - unless ($no_module_fwd) { + if ($module_fwd) { my $modulepri = $modulepris{$lib}; if (-e $modulepri) { my $modulepriname = basename($modulepri); - my $moduleprifwd = "$qtbasedir/mkspecs/modules/$modulepriname"; + mkpath($module_fwd); + my $moduleprifwd = "$module_fwd/$modulepriname"; + my $mod_base = $developer_build ? $basedir : $out_basedir; + my $mod_component_base = $developer_build ? $qtbasedir : $out_basedir; open MODULE_PRI_FILE, ">$moduleprifwd" or die("Could not open $moduleprifwd for writing"); - print MODULE_PRI_FILE "QT_MODULE_BASE = $basedir\n"; - print MODULE_PRI_FILE "QT_MODULE_BIN_BASE = $qtbasedir/bin\n"; + print MODULE_PRI_FILE "QT_MODULE_BASE = $mod_base\n"; + print MODULE_PRI_FILE "QT_MODULE_BIN_BASE = $mod_component_base/bin\n"; print MODULE_PRI_FILE "QT_MODULE_INCLUDE_BASE = $out_basedir/include\n"; - print MODULE_PRI_FILE "QT_MODULE_IMPORT_BASE = $qtbasedir/imports\n"; - print MODULE_PRI_FILE "QT_MODULE_LIB_BASE = $qtbasedir/lib\n"; - print MODULE_PRI_FILE "QT_MODULE_PLUGIN_BASE = $qtbasedir/plugins\n"; + print MODULE_PRI_FILE "QT_MODULE_IMPORT_BASE = $mod_component_base/imports\n"; + print MODULE_PRI_FILE "QT_MODULE_LIB_BASE = $mod_component_base/lib\n"; + print MODULE_PRI_FILE "QT_MODULE_PLUGIN_BASE = $mod_component_base/plugins\n"; print MODULE_PRI_FILE "include($modulepri)\n"; close MODULE_PRI_FILE; utime(time, (stat($modulepri))[9], $moduleprifwd); + if ($cache_module_fwd) { + my $cacheStatement = "QMAKE_EXTRA_MODULE_FORWARDS = \"$module_fwd\""; + my $cacheFile = "$out_basedir/.qmake.cache"; + my $existingQmakeCache = fileContents($cacheFile); + # Skip if it's already there. + if ($existingQmakeCache !~ $cacheStatement) { + open QMAKE_CACHE_FILE, ">>$cacheFile" or die("Could not open $cacheFile for writing"); + print QMAKE_CACHE_FILE "$cacheStatement\n"; + close(QMAKE_CACHE_FILE); + } + } } elsif ($modulepri) { print "WARNING: Module $lib\'s pri file '$modulepri' not found.\nSkipped creating forwarding pri for $lib.\n"; } -- cgit v1.2.3