bin/syncqt
changeset 37 758a864f9613
parent 33 3e2da88830cd
--- a/bin/syncqt	Fri Sep 17 08:34:18 2010 +0300
+++ b/bin/syncqt	Mon Oct 04 01:19:32 2010 +0300
@@ -42,7 +42,7 @@
         "QtScript" => "$basedir/src/script",
         "QtScriptTools" => "$basedir/src/scripttools",
         "Qt3Support" => "$basedir/src/qt3support",
-        "ActiveQt" => "$basedir/src/activeqt/container;$basedir/src/activeqt/control;$basedir/src/activeqt/shared",
+        "ActiveQt" => "$basedir/src/activeqt",
         "QtTest" => "$basedir/src/testlib",
         "QtHelp" => "$basedir/tools/assistant/lib",
         "QtDesigner" => "$basedir/tools/designer/src/lib",
@@ -700,6 +700,7 @@
 $isunix = checkUnix; #cache checkUnix
 
 # create path
+mkpath "$out_basedir/include", !$quiet;
 mkpath "$out_basedir/$out_subdir/Qt", !$quiet;
 
 my @ignore_headers = ();
@@ -710,6 +711,10 @@
 my @ignore_for_qt_begin_namespace_check = ( "qconfig.h", "qconfig-dist.h", "qconfig-large.h", "qconfig-medium.h", "qconfig-minimal.h", "qconfig-small.h", "qfeatures.h", "qatomic_arch.h", "qatomic_windowsce.h", "qt_windows.h", "qatomic_macosx.h" );
 my @ignore_for_qt_module_check = ( "$modules{QtCore}/arch", "$modules{QtCore}/global", "$modules{QtSql}/drivers", "$modules{QtTest}", "$modules{QtDesigner}", "$modules{QtUiTools}", "$modules{QtDBus}", "$modules{phonon}" );
 my %colliding_headers = ();
+my %inject_headers;
+# Force generation of forwarding header for qconfig.h if (and only if) we can't
+# find the header by normal means.
+%inject_headers = ( "$basedir/src/corelib/global" => ( "*qconfig.h" ) ) unless (-e "$basedir/src/corelib/global/qconfig.h");
 
 foreach (@modules_to_sync) {
     #iteration info
@@ -819,8 +824,10 @@
         foreach (@subdirs) {
             my $subdir = "$_";
             my @headers = findFiles("$subdir", "^[-a-z0-9_]*\\.h\$" , 0);
+            push @headers, $inject_headers{$subdir} if (defined $inject_headers{$subdir});
             foreach (@headers) {
                 my $header = "$_";
+                my $shadow = ($header =~ s/^\*//);
                 $header = 0 if("$header" =~ /^ui_.*.h/);
                 foreach (@ignore_headers) {
                     $header = 0 if("$header" eq "$_");
@@ -838,6 +845,7 @@
                     }
 
                     my $iheader = $subdir . "/" . $header;
+                    $iheader =~ s/^\Q$basedir\E/$out_basedir/ if ($shadow);
                     my @classes = $public_header ? classNames($iheader) : ();
                     if($showonly) {
                         print "$header [$lib]\n";
@@ -862,7 +870,7 @@
                                     my $warning_msg = 'Inclusion of header files from include/Qt is deprecated.';
                                     $header_content = "#ifndef QT_NO_QT_INCLUDE_WARN\n" .
                                                       "    #if defined(__GNUC__)\n" .
-                                                      "        #pragma warning \"$warning_msg\"\n" .
+                                                      "        #warning \"$warning_msg\"\n" .
                                                       "    #elif defined(_MSC_VER)\n" .
                                                       "        #pragma message \"WARNING: $warning_msg\"\n" .
                                                       "    #endif\n".
@@ -1009,14 +1017,12 @@
     for (keys(%modules)) {
         #iteration info
         my $lib = $_;
-        my $dir = "$modules{$lib}";
-        foreach (split(/;/, $dir)) {
-            my $current_dir = "$_";
+        {
             #calc subdirs
-            my @subdirs = ($current_dir);
+            my @subdirs = ($modules{$lib});
             foreach (@subdirs) {
                 my $subdir = "$_";
-                opendir DIR, "$subdir";
+                opendir DIR, "$subdir" or die "Huh, directory ".$subdir." cannot be opened.";
                 while(my $t = readdir(DIR)) {
                     push @subdirs, "$subdir/$t" if(-d "$subdir/$t" && !($t eq ".") &&
                                                    !($t eq "..") && !($t eq ".obj") &&
@@ -1142,4 +1148,4 @@
     }
 }
 
-exit 0;
\ No newline at end of file
+exit 0;