bin/syncqt
changeset 37 758a864f9613
parent 33 3e2da88830cd
equal deleted inserted replaced
36:ef0373b55136 37:758a864f9613
    40         "QtSvg" => "$basedir/src/svg",
    40         "QtSvg" => "$basedir/src/svg",
    41         "QtDeclarative" => "$basedir/src/declarative",
    41         "QtDeclarative" => "$basedir/src/declarative",
    42         "QtScript" => "$basedir/src/script",
    42         "QtScript" => "$basedir/src/script",
    43         "QtScriptTools" => "$basedir/src/scripttools",
    43         "QtScriptTools" => "$basedir/src/scripttools",
    44         "Qt3Support" => "$basedir/src/qt3support",
    44         "Qt3Support" => "$basedir/src/qt3support",
    45         "ActiveQt" => "$basedir/src/activeqt/container;$basedir/src/activeqt/control;$basedir/src/activeqt/shared",
    45         "ActiveQt" => "$basedir/src/activeqt",
    46         "QtTest" => "$basedir/src/testlib",
    46         "QtTest" => "$basedir/src/testlib",
    47         "QtHelp" => "$basedir/tools/assistant/lib",
    47         "QtHelp" => "$basedir/tools/assistant/lib",
    48         "QtDesigner" => "$basedir/tools/designer/src/lib",
    48         "QtDesigner" => "$basedir/tools/designer/src/lib",
    49         "QtUiTools" => "$basedir/tools/designer/src/uitools",
    49         "QtUiTools" => "$basedir/tools/designer/src/uitools",
    50         "QtDBus" => "$basedir/src/dbus",
    50         "QtDBus" => "$basedir/src/dbus",
   698 @modules_to_sync = keys(%modules) if($#modules_to_sync == -1);
   698 @modules_to_sync = keys(%modules) if($#modules_to_sync == -1);
   699 
   699 
   700 $isunix = checkUnix; #cache checkUnix
   700 $isunix = checkUnix; #cache checkUnix
   701 
   701 
   702 # create path
   702 # create path
       
   703 mkpath "$out_basedir/include", !$quiet;
   703 mkpath "$out_basedir/$out_subdir/Qt", !$quiet;
   704 mkpath "$out_basedir/$out_subdir/Qt", !$quiet;
   704 
   705 
   705 my @ignore_headers = ();
   706 my @ignore_headers = ();
   706 my $class_lib_map_contents = "";
   707 my $class_lib_map_contents = "";
   707 my @ignore_for_master_contents = ( "qt.h", "qpaintdevicedefs.h" );
   708 my @ignore_for_master_contents = ( "qt.h", "qpaintdevicedefs.h" );
   708 my @ignore_for_include_check = ( "qatomic.h" );
   709 my @ignore_for_include_check = ( "qatomic.h" );
   709 my @ignore_for_qt_begin_header_check = ( "qiconset.h", "qconfig.h", "qconfig-dist.h", "qconfig-large.h", "qconfig-medium.h", "qconfig-minimal.h", "qconfig-small.h", "qfeatures.h", "qt_windows.h" );
   710 my @ignore_for_qt_begin_header_check = ( "qiconset.h", "qconfig.h", "qconfig-dist.h", "qconfig-large.h", "qconfig-medium.h", "qconfig-minimal.h", "qconfig-small.h", "qfeatures.h", "qt_windows.h" );
   710 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" );
   711 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" );
   711 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}" );
   712 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}" );
   712 my %colliding_headers = ();
   713 my %colliding_headers = ();
       
   714 my %inject_headers;
       
   715 # Force generation of forwarding header for qconfig.h if (and only if) we can't
       
   716 # find the header by normal means.
       
   717 %inject_headers = ( "$basedir/src/corelib/global" => ( "*qconfig.h" ) ) unless (-e "$basedir/src/corelib/global/qconfig.h");
   713 
   718 
   714 foreach (@modules_to_sync) {
   719 foreach (@modules_to_sync) {
   715     #iteration info
   720     #iteration info
   716     my $lib = $_;
   721     my $lib = $_;
   717     my $dir = "$modules{$lib}";
   722     my $dir = "$modules{$lib}";
   817 
   822 
   818         #calc files and "copy" them
   823         #calc files and "copy" them
   819         foreach (@subdirs) {
   824         foreach (@subdirs) {
   820             my $subdir = "$_";
   825             my $subdir = "$_";
   821             my @headers = findFiles("$subdir", "^[-a-z0-9_]*\\.h\$" , 0);
   826             my @headers = findFiles("$subdir", "^[-a-z0-9_]*\\.h\$" , 0);
       
   827             push @headers, $inject_headers{$subdir} if (defined $inject_headers{$subdir});
   822             foreach (@headers) {
   828             foreach (@headers) {
   823                 my $header = "$_";
   829                 my $header = "$_";
       
   830                 my $shadow = ($header =~ s/^\*//);
   824                 $header = 0 if("$header" =~ /^ui_.*.h/);
   831                 $header = 0 if("$header" =~ /^ui_.*.h/);
   825                 foreach (@ignore_headers) {
   832                 foreach (@ignore_headers) {
   826                     $header = 0 if("$header" eq "$_");
   833                     $header = 0 if("$header" eq "$_");
   827                 }
   834                 }
   828                 if($header) {
   835                 if($header) {
   836                             $public_header = 0 if("$header" eq "$_");
   843                             $public_header = 0 if("$header" eq "$_");
   837                         }
   844                         }
   838                     }
   845                     }
   839 
   846 
   840                     my $iheader = $subdir . "/" . $header;
   847                     my $iheader = $subdir . "/" . $header;
       
   848                     $iheader =~ s/^\Q$basedir\E/$out_basedir/ if ($shadow);
   841                     my @classes = $public_header ? classNames($iheader) : ();
   849                     my @classes = $public_header ? classNames($iheader) : ();
   842                     if($showonly) {
   850                     if($showonly) {
   843                         print "$header [$lib]\n";
   851                         print "$header [$lib]\n";
   844                         foreach(@classes) {
   852                         foreach(@classes) {
   845                             print "SYMBOL: $_\n";
   853                             print "SYMBOL: $_\n";
   860                                 } else {
   868                                 } else {
   861                                     $colliding_headers{$file_name} = 1;
   869                                     $colliding_headers{$file_name} = 1;
   862                                     my $warning_msg = 'Inclusion of header files from include/Qt is deprecated.';
   870                                     my $warning_msg = 'Inclusion of header files from include/Qt is deprecated.';
   863                                     $header_content = "#ifndef QT_NO_QT_INCLUDE_WARN\n" .
   871                                     $header_content = "#ifndef QT_NO_QT_INCLUDE_WARN\n" .
   864                                                       "    #if defined(__GNUC__)\n" .
   872                                                       "    #if defined(__GNUC__)\n" .
   865                                                       "        #pragma warning \"$warning_msg\"\n" .
   873                                                       "        #warning \"$warning_msg\"\n" .
   866                                                       "    #elif defined(_MSC_VER)\n" .
   874                                                       "    #elif defined(_MSC_VER)\n" .
   867                                                       "        #pragma message \"WARNING: $warning_msg\"\n" .
   875                                                       "        #pragma message \"WARNING: $warning_msg\"\n" .
   868                                                       "    #endif\n".
   876                                                       "    #endif\n".
   869                                                       "#endif\n\n";
   877                                                       "#endif\n\n";
   870                                 }
   878                                 }
  1007 
  1015 
  1008 if($check_includes) {
  1016 if($check_includes) {
  1009     for (keys(%modules)) {
  1017     for (keys(%modules)) {
  1010         #iteration info
  1018         #iteration info
  1011         my $lib = $_;
  1019         my $lib = $_;
  1012         my $dir = "$modules{$lib}";
  1020         {
  1013         foreach (split(/;/, $dir)) {
       
  1014             my $current_dir = "$_";
       
  1015             #calc subdirs
  1021             #calc subdirs
  1016             my @subdirs = ($current_dir);
  1022             my @subdirs = ($modules{$lib});
  1017             foreach (@subdirs) {
  1023             foreach (@subdirs) {
  1018                 my $subdir = "$_";
  1024                 my $subdir = "$_";
  1019                 opendir DIR, "$subdir";
  1025                 opendir DIR, "$subdir" or die "Huh, directory ".$subdir." cannot be opened.";
  1020                 while(my $t = readdir(DIR)) {
  1026                 while(my $t = readdir(DIR)) {
  1021                     push @subdirs, "$subdir/$t" if(-d "$subdir/$t" && !($t eq ".") &&
  1027                     push @subdirs, "$subdir/$t" if(-d "$subdir/$t" && !($t eq ".") &&
  1022                                                    !($t eq "..") && !($t eq ".obj") &&
  1028                                                    !($t eq "..") && !($t eq ".obj") &&
  1023                                                    !($t eq ".moc") && !($t eq ".rcc") &&
  1029                                                    !($t eq ".moc") && !($t eq ".rcc") &&
  1024                                                    !($t eq ".uic") && !($t eq "build"));
  1030                                                    !($t eq ".uic") && !($t eq "build"));