From 3d50a0964587776c0915111947dc3401b21c158e Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 30 Jan 2014 18:53:44 +0100 Subject: remove vestiges of uic class map code amends ad52be1ac. Change-Id: I2bfb10908217708c4f046d0d315dadd1b626da12 Reviewed-by: Joerg Bornemann --- bin/syncqt.pl | 2 -- 1 file changed, 2 deletions(-) (limited to 'bin/syncqt.pl') diff --git a/bin/syncqt.pl b/bin/syncqt.pl index 8c1e04e0d0..8b7ea3b459 100755 --- a/bin/syncqt.pl +++ b/bin/syncqt.pl @@ -777,7 +777,6 @@ while ( @ARGV ) { # if we have no $basedir we cannot be sure which sources you want, so die die "Could not find any sync.profile for your module!\nPass to syncqt to sync your header files.\nsyncqt failed" if (!$basedir); -my $class_lib_map_contents = ""; our @ignore_headers = (); our @ignore_for_master_contents = (); our @ignore_for_include_check = (); @@ -940,7 +939,6 @@ foreach my $lib (@modules_to_sync) { if (defined $explicitheaders{$lib}{$class}) { $header_copies++ if(syncHeader($lib, "$out_basedir/include/$lib/$class", "$out_basedir/include/$lib/$explicitheaders{$lib}{$class}", 0, $ts)); } else { - $class_lib_map_contents .= "QT_CLASS_LIB($full_class, $lib, $header_base)\n"; $header_copies++ if(syncHeader($lib, "$out_basedir/include/$lib/$class", "$out_basedir/include/$lib/$header", 0, $ts)); } } -- cgit v1.2.3 From 6571aaf1c45885407038e03b0e9ed5952a06baeb Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 30 Jan 2014 19:34:49 +0100 Subject: merge %explicitheaders into %classnames MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit no need to have two mechanisms for the same thing. the values of %classnames can be comma-separated lists now, so one header can have multiple classes assigned. conversely, if an extracted class name reverse-maps to a different file name, it is omitted. Change-Id: Ia0a35d64764b6376f33b77bbfe59e1df70a3cf1a Reviewed-by: Jędrzej Nowacki Reviewed-by: Joerg Bornemann --- bin/syncqt.pl | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) (limited to 'bin/syncqt.pl') diff --git a/bin/syncqt.pl b/bin/syncqt.pl index 8b7ea3b459..2a1523bbbd 100755 --- a/bin/syncqt.pl +++ b/bin/syncqt.pl @@ -84,9 +84,12 @@ our $quoted_basedir; $INPUT_RECORD_SEPARATOR = "\r\n" if ($^O eq "msys"); # will be defined based on the modules sync.profile -our (%modules, %moduleheaders, @allmoduleheadersprivate, %classnames, %explicitheaders, %deprecatedheaders); +our (%modules, %moduleheaders, @allmoduleheadersprivate, %classnames, %deprecatedheaders); our @qpa_headers = (); +# will be derived from sync.profile +our %reverse_classnames = (); + # global variables (modified by options) my $isunix = 0; my $module = 0; @@ -206,8 +209,9 @@ sub classNames { my @ret; my ($iheader) = @_; - my $classname = $classnames{basename($iheader)}; - push @ret, $classname if ($classname); + my $ihdrbase = basename($iheader); + my $classname = $classnames{$ihdrbase}; + push @ret, split(/,/, $classname) if ($classname); my $parsable = ""; if(open(F, "<$iheader")) { @@ -306,6 +310,8 @@ sub classNames { foreach my $symbol (@symbols) { $symbol = (join("::", @namespaces) . "::" . $symbol) if (scalar @namespaces); + my $revhdr = $reverse_classnames{$symbol}; + next if (defined($revhdr) and $revhdr ne $ihdrbase); if ($symbol =~ /^Q[^:]*$/) { # no-namespace, starting with Q push @ret, $symbol; } elsif (defined($publicclassregexp)) { @@ -580,6 +586,13 @@ sub loadSyncProfile { die "syncqt couldn't parse $syncprofile: $@" if $@; die "syncqt couldn't execute $syncprofile: $!" unless defined $result; } + + for my $fn (keys %classnames) { + for my $cn (split(/,/, $classnames{$fn})) { + $reverse_classnames{$cn} = $fn; + } + } + return $result; } @@ -936,17 +949,8 @@ foreach my $lib (@modules_to_sync) { # class =~ s,::,/,g; # } - if (defined $explicitheaders{$lib}{$class}) { - $header_copies++ if(syncHeader($lib, "$out_basedir/include/$lib/$class", "$out_basedir/include/$lib/$explicitheaders{$lib}{$class}", 0, $ts)); - } else { - $header_copies++ if(syncHeader($lib, "$out_basedir/include/$lib/$class", "$out_basedir/include/$lib/$header", 0, $ts)); - } - } - - if ($explicitheaders{$lib}{basename($header)}) { - $header_copies++ if(syncHeader($lib, "$out_basedir/include/$lib/$explicitheaders{$lib}{basename($header)}", "$out_basedir/include/$lib/$header", 0, $ts)); + $header_copies++ if (syncHeader($lib, "$out_basedir/include/$lib/$class", "$out_basedir/include/$lib/$header", 0, $ts)); } - } elsif ($create_private_headers && !$qpa_header) { @headers = ( "$out_basedir/include/$lib/$module_version/$lib/private/$header" ); } elsif ($create_private_headers) { @@ -975,11 +979,6 @@ foreach my $lib (@modules_to_sync) { $pri_install_classes .= $class_header unless($pri_install_classes =~ $class_header); } - if ($explicitheaders{$lib}{basename($iheader)}) { - my $compat_header = fixPaths("$out_basedir/include/$lib/$explicitheaders{$lib}{basename($iheader)}", - $dir) . " "; - $pri_install_files .= $compat_header unless($pri_install_files =~ $compat_header); - } $pri_install_files.= "$pri_install_iheader ";; } } -- cgit v1.2.3 From 40babf8b4a039bc8671696c74d8e22c719c30021 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 30 Jan 2014 20:27:00 +0100 Subject: un-pluralize code since ever we've thrown out the phonon hack, each header is synced to only one location (CamelCase headers notwithstanding). Change-Id: Idfef33db9410908aefe309bc7a3edeae5fc5a671 Reviewed-by: Joerg Bornemann --- bin/syncqt.pl | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'bin/syncqt.pl') diff --git a/bin/syncqt.pl b/bin/syncqt.pl index 2a1523bbbd..6ae4128b81 100755 --- a/bin/syncqt.pl +++ b/bin/syncqt.pl @@ -937,9 +937,9 @@ foreach my $lib (@modules_to_sync) { } else { my $ts = (stat($iheader))[9]; #find out all the places it goes.. - my @headers; + my $oheader; if ($public_header) { - @headers = ( "$out_basedir/include/$lib/$header" ); + $oheader = "$out_basedir/include/$lib/$header"; foreach my $full_class (@classes) { my $header_base = basename($header); # Strip namespaces: @@ -952,14 +952,11 @@ foreach my $lib (@modules_to_sync) { $header_copies++ if (syncHeader($lib, "$out_basedir/include/$lib/$class", "$out_basedir/include/$lib/$header", 0, $ts)); } } elsif ($create_private_headers && !$qpa_header) { - @headers = ( "$out_basedir/include/$lib/$module_version/$lib/private/$header" ); + $oheader = "$out_basedir/include/$lib/$module_version/$lib/private/$header"; } elsif ($create_private_headers) { - @headers = ( "$out_basedir/include/$lib/$module_version/$lib/qpa/$header" ); - } - - foreach(@headers) { #sync them - $header_copies++ if (syncHeader($lib, $_, $iheader, $copy_headers, $ts)); + $oheader = "$out_basedir/include/$lib/$module_version/$lib/qpa/$header"; } + $header_copies++ if (syncHeader($lib, $oheader, $iheader, $copy_headers, $ts)); if($public_header) { #put it into the master file -- cgit v1.2.3 From e8b2ff63ec47b2f212bb0a92d59a0b5f9e8fb168 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 30 Jan 2014 21:00:49 +0100 Subject: remove duplicated nested condition Change-Id: I433773dbf21a7a7625d4f763b3cebe75c746aa1f Reviewed-by: Joerg Bornemann --- bin/syncqt.pl | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) (limited to 'bin/syncqt.pl') diff --git a/bin/syncqt.pl b/bin/syncqt.pl index 6ae4128b81..a2f1b02fcc 100755 --- a/bin/syncqt.pl +++ b/bin/syncqt.pl @@ -963,21 +963,18 @@ foreach my $lib (@modules_to_sync) { $master_contents .= "#include \"$public_header\"\n" if (shouldMasterInclude($iheader)); #deal with the install directives - if($public_header) { - my $pri_install_iheader = fixPaths($iheader, $dir); - foreach my $class (@classes) { - # Strip namespaces: - $class =~ s/^.*:://; - # if ($class =~ m/::/) { - # $class =~ s,::,/,g; - # } - my $class_header = fixPaths("$out_basedir/include/$lib/$class", - $dir) . " "; - $pri_install_classes .= $class_header - unless($pri_install_classes =~ $class_header); - } - $pri_install_files.= "$pri_install_iheader ";; + my $pri_install_iheader = fixPaths($iheader, $dir); + foreach my $class (@classes) { + # Strip namespaces: + $class =~ s/^.*:://; +# if ($class =~ m/::/) { +# $class =~ s,::,/,g; +# } + my $class_header = fixPaths("$out_basedir/include/$lib/$class", $dir) . " "; + $pri_install_classes .= $class_header + unless($pri_install_classes =~ $class_header); } + $pri_install_files.= "$pri_install_iheader ";; } elsif ($qpa_header) { my $pri_install_iheader = fixPaths($iheader, $dir); -- cgit v1.2.3 From 46feffea1b08767ab8753843beb2d0f93e4a637f Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 30 Jan 2014 21:01:23 +0100 Subject: de-duplicate header install source calculation Change-Id: I7c26d70fdfceac6d3c562e704cc725fad80c4f59 Reviewed-by: Joerg Bornemann --- bin/syncqt.pl | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'bin/syncqt.pl') diff --git a/bin/syncqt.pl b/bin/syncqt.pl index a2f1b02fcc..bbd514e58b 100755 --- a/bin/syncqt.pl +++ b/bin/syncqt.pl @@ -958,12 +958,12 @@ foreach my $lib (@modules_to_sync) { } $header_copies++ if (syncHeader($lib, $oheader, $iheader, $copy_headers, $ts)); + my $pri_install_iheader = fixPaths($iheader, $dir); if($public_header) { #put it into the master file $master_contents .= "#include \"$public_header\"\n" if (shouldMasterInclude($iheader)); #deal with the install directives - my $pri_install_iheader = fixPaths($iheader, $dir); foreach my $class (@classes) { # Strip namespaces: $class =~ s/^.*:://; @@ -977,11 +977,9 @@ foreach my $lib (@modules_to_sync) { $pri_install_files.= "$pri_install_iheader ";; } elsif ($qpa_header) { - my $pri_install_iheader = fixPaths($iheader, $dir); $pri_install_qpafiles.= "$pri_install_iheader ";; } else { - my $pri_install_iheader = fixPaths($iheader, $dir); $pri_install_pfiles.= "$pri_install_iheader ";; } } -- cgit v1.2.3 From f8c5dd9857211601e2ea4b704df92e240b2c3b4b Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 3 Feb 2014 22:22:14 +0100 Subject: automate handling of generated headers some more let the syncqt + qt_module_header.prf pair handle generation of forwarding headers. in qtbase this is ineffective to some degree, as the need to create QtCore's forwarding headers early for QtBootstrap requires qtbase.pro already doing the real work, but at least we get the verification that nothing breaks. Other Modules (TM) will need the full functionality. Change-Id: Ifd3dfa05c4c8a91698a365160edb6dabc84e553f Reviewed-by: Joerg Bornemann --- bin/syncqt.pl | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) (limited to 'bin/syncqt.pl') diff --git a/bin/syncqt.pl b/bin/syncqt.pl index bbd514e58b..826d3fc6fa 100755 --- a/bin/syncqt.pl +++ b/bin/syncqt.pl @@ -833,6 +833,7 @@ foreach my $lib (@modules_to_sync) { my $pri_install_files = ""; my $pri_install_pfiles = ""; my $pri_install_qpafiles = ""; + my $pri_injections = ""; my $libcapitals = uc($lib); my $master_contents = @@ -905,8 +906,15 @@ foreach my $lib (@modules_to_sync) { #calc files and "copy" them foreach my $subdir (@subdirs) { my @headers = findFiles($subdir, "^[-a-z0-9_]*\\.h\$" , 0); + if (defined $inject_headers{$subdir}) { + foreach my $if (@{$inject_headers{$subdir}}) { + @headers = grep(!/^\Q$if\E$/, @headers); #in case we configure'd previously + push @headers, "*".$if; + } + } my $header_dirname = ""; foreach my $header (@headers) { + my $shadow = ($header =~ s/^\*//); $header = 0 if($header =~ /^ui_.*.h/); foreach (@ignore_headers) { $header = 0 if($header eq $_); @@ -928,6 +936,7 @@ foreach my $lib (@modules_to_sync) { } my $iheader = $subdir . "/" . $header; + $iheader =~ s/^\Q$basedir\E/$out_basedir/ if ($shadow); my @classes = $public_header && (!$minimal && $is_qt) ? classNames($iheader) : (); if($showonly) { print "$header [$lib]\n"; @@ -935,7 +944,7 @@ foreach my $lib (@modules_to_sync) { print "SYMBOL: $_\n"; } } else { - my $ts = (stat($iheader))[9]; + my $ts = $shadow ? 0 : (stat($iheader))[9]; #find out all the places it goes.. my $oheader; if ($public_header) { @@ -949,19 +958,20 @@ foreach my $lib (@modules_to_sync) { # class =~ s,::,/,g; # } - $header_copies++ if (syncHeader($lib, "$out_basedir/include/$lib/$class", "$out_basedir/include/$lib/$header", 0, $ts)); + $header_copies++ if (!$shadow && syncHeader($lib, "$out_basedir/include/$lib/$class", "$out_basedir/include/$lib/$header", 0, $ts)); } } elsif ($create_private_headers && !$qpa_header) { $oheader = "$out_basedir/include/$lib/$module_version/$lib/private/$header"; } elsif ($create_private_headers) { $oheader = "$out_basedir/include/$lib/$module_version/$lib/qpa/$header"; } - $header_copies++ if (syncHeader($lib, $oheader, $iheader, $copy_headers, $ts)); + $header_copies++ if (!$shadow && syncHeader($lib, $oheader, $iheader, $copy_headers, $ts)); my $pri_install_iheader = fixPaths($iheader, $dir); + my $injection = ""; if($public_header) { #put it into the master file - $master_contents .= "#include \"$public_header\"\n" if (shouldMasterInclude($iheader)); + $master_contents .= "#include \"$public_header\"\n" if (!$shadow && shouldMasterInclude($iheader)); #deal with the install directives foreach my $class (@classes) { @@ -973,6 +983,7 @@ foreach my $lib (@modules_to_sync) { my $class_header = fixPaths("$out_basedir/include/$lib/$class", $dir) . " "; $pri_install_classes .= $class_header unless($pri_install_classes =~ $class_header); + $injection .= ":$class"; } $pri_install_files.= "$pri_install_iheader ";; } @@ -982,6 +993,9 @@ foreach my $lib (@modules_to_sync) { else { $pri_install_pfiles.= "$pri_install_iheader ";; } + $pri_injections .= fixPaths($iheader, "$out_basedir/include/$lib") + .":".fixPaths($oheader, "$out_basedir/include/$lib") + .$injection." " if ($shadow); } if ($verbose_level && $header_copies) { @@ -1112,6 +1126,7 @@ foreach my $lib (@modules_to_sync) { $headers_pri_contents .= "SYNCQT.HEADER_CLASSES = $pri_install_classes\n"; $headers_pri_contents .= "SYNCQT.PRIVATE_HEADER_FILES = $pri_install_pfiles\n"; $headers_pri_contents .= "SYNCQT.QPA_HEADER_FILES = $pri_install_qpafiles\n"; + $headers_pri_contents .= "SYNCQT.INJECTIONS = $pri_injections\n"; my $headers_pri_file = "$out_basedir/include/$lib/headers.pri"; writeFile($headers_pri_file, $headers_pri_contents, $lib, "headers.pri file"); } -- cgit v1.2.3