summaryrefslogtreecommitdiffstats
path: root/bin/syncqt
diff options
context:
space:
mode:
Diffstat (limited to 'bin/syncqt')
-rwxr-xr-xbin/syncqt59
1 files changed, 44 insertions, 15 deletions
diff --git a/bin/syncqt b/bin/syncqt
index 307b157..9a6ef1d 100755
--- a/bin/syncqt
+++ b/bin/syncqt
@@ -3,7 +3,7 @@
#
# Synchronizes Qt header files - internal development tool.
#
-# Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
# Contact: Nokia Corporation (qt-info@nokia.com)
#
######################################################################
@@ -15,6 +15,13 @@ use Cwd;
use Config;
use strict;
+for (my $i = 0; $i < $#ARGV; $i++) {
+ if ($ARGV[$i] eq "-base-dir" && $i < $#ARGV - 1) {
+ $ENV{"QTDIR"} = $ARGV[$i + 1];
+ last;
+ }
+}
+
die "syncqt: QTDIR not defined" if ! $ENV{"QTDIR"}; # sanity check
# global variables
@@ -62,6 +69,8 @@ my $force_win = 0;
my $force_relative = 0;
my $check_includes = 0;
my $copy_headers = 0;
+my $create_uic_class_map = 1;
+my $create_private_headers = 1;
my @modules_to_sync ;
$force_relative = 1 if ( -d "/System/Library/Frameworks" );
my $out_basedir = $basedir;
@@ -86,6 +95,7 @@ sub showUsage
print " -showonly Show action but not perform (default: " . ($showonly ? "yes" : "no") . ")\n";
print " -outdir <PATH> Specify output directory for sync (default: $out_basedir)\n";
print " -quiet Only report problems, not activity (default: " . ($quiet ? "yes" : "no") . ")\n";
+ print " -separate-module <NAME>:<PROFILEDIR>:<HEADERDIR> Create headers for <NAME> with original headers in <HEADERDIR> relative to <PROFILEDIR> \n";
print " -help This help\n";
exit 0;
}
@@ -578,12 +588,19 @@ while ( @ARGV ) {
} elsif("$arg" eq "-module") {
$var = "module";
$val = shift @ARGV;
+ } elsif("$arg" eq "-separate-module") {
+ $var = "separate-module";
+ $val = shift @ARGV;
} elsif("$arg" eq "-show") {
$var = "showonly";
$val = "yes";
} elsif("$arg" eq "-quiet") {
$var = "quiet";
$val = "yes";
+ } elsif("$arg" eq "-base-dir") {
+ # skip, it's been dealt with at the top of the file
+ shift @ARGV;
+ next;
} elsif("$arg" eq '*') {
# workaround for windows 9x where "%*" expands to "*"
$var = 1;
@@ -639,6 +656,13 @@ while ( @ARGV ) {
print "module :$val:\n" unless $quiet;
die "No such module: $val" unless(defined $modules{$val});
push @modules_to_sync, $val;
+ } elsif ("$var" eq "separate-module") {
+ my ($module, $prodir, $headerdir) = split(/:/, $val);
+ $modules{$module} = $prodir;
+ push @modules_to_sync, $module;
+ $moduleheaders{$module} = $headerdir;
+ $create_uic_class_map = 0;
+ $create_private_headers = 0;
} elsif ("$var" eq "output") {
my $outdir = $val;
if(checkRelative($outdir)) {
@@ -811,13 +835,20 @@ foreach (@modules_to_sync) {
foreach(@classes) {
my $header_base = basename($header);
my $class = $_;
- if ($class =~ m/::/) {
- $class =~ s,::,/,g;
- }
+ # Strip namespaces:
+ $class =~ s/^.*:://;
+# if ($class =~ m/::/) {
+# class =~ s,::,/,g;
+# }
$class_lib_map_contents .= "QT_CLASS_LIB($_, $lib, $header_base)\n";
$header_copies++ if(syncHeader("$out_basedir/include/$lib/$class", "$out_basedir/include/$lib/$header", 0));
+
+ # KDE-Compat headers for Phonon
+ if ($lib eq "phonon") {
+ $header_copies++ if (syncHeader("$out_basedir/include/phonon_compat/Phonon/$class", "$out_basedir/include/$lib/$header", 0));
+ }
}
- } else {
+ } elsif ($create_private_headers) {
@headers = ( "$out_basedir/include/$lib/private/$header" );
push @headers, "$out_basedir/include/Qt/private/$header"
if ("$lib" ne "phonon");
@@ -835,9 +866,11 @@ foreach (@modules_to_sync) {
my $pri_install_iheader = fixPaths($iheader, $current_dir);
foreach(@classes) {
my $class = $_;
- if ($class =~ m/::/) {
- $class =~ s,::,/,g;
- }
+ # Strip namespaces:
+ $class =~ s/^.*:://;
+# if ($class =~ m/::/) {
+# $class =~ s,::,/,g;
+# }
my $class_header = fixPaths("$out_basedir/include/$lib/$class",
$current_dir) . " ";
$pri_install_classes .= $class_header
@@ -862,12 +895,8 @@ foreach (@modules_to_sync) {
unless($showonly) {
my @master_includes;
- if ($lib eq "phonon") {
- push @master_includes, "$out_basedir/include/phonon_compat/phonon/phonon";
- push @master_includes, "$out_basedir/include/phonon/Phonon/Phonon";
- } else {
- push @master_includes, "$out_basedir/include/$lib/$lib";
- }
+ push @master_includes, "$out_basedir/include/$lib/$lib";
+ push @master_includes, "$out_basedir/include/phonon_compat/Phonon/Phonon" if ($lib eq "phonon");
foreach my $master_include (@master_includes) {
#generate the "master" include file
$pri_install_files .= fixPaths($master_include, "$modules{$lib}") . " "; #get the master file installed too
@@ -915,7 +944,7 @@ foreach (@modules_to_sync) {
}
}
}
-unless($showonly) {
+unless($showonly || !$create_uic_class_map) {
my $class_lib_map = "$out_basedir/src/tools/uic/qclass_lib_map.h";
if(-e "$class_lib_map") {
open CLASS_LIB_MAP, "<$class_lib_map";